Yearly Archive December 27, 2019

ByJUJU-dev

How to change PHP version and update PHP extensions on Shared servers

How to change PHP version and update PHP extensions on Shared servers

In some cases, the correct functioning of your website depends on a PHP version installed on the server.
This guide describes how to change php version on Shared servers (Stellar, Stellar Plus plans and old Value, Professional, Ultimate plans). For Business SSD servers, use this guide.

Thanks to the PHP Selector function, it is possible to select the necessary PHP version as well as enable/disable certain PHP modules and functions.

To check what PHP version is currently in use, refer to this article.

Change PHP version and/or manage extensions

1. Log into your cPanel account.
2. Scroll down to the Select PHP Version:
For cPanel Basic Theme:
How to change PHP version and update PHP extensions on Shared servers

How to change PHP version and update PHP extensions on Shared servers

For cPanel Retro Theme:

How to change PHP version and update PHP extensions on Shared servers

3. Here you will see the list of available modules and extensions.

If you do not need to change the PHP version and just want to turn on/off specific extensions, you can do this by checking/unchecking the corresponding boxes.

Use the PHP Version drop-down box to select the required version, click on Set as current in order to apply the changes.

NOTE: The ‘native’ PHP version does not allow changing any options. You can set the desired values using a php.ini file:

How to change PHP version and update PHP extensions on Shared servers

4. To change individual settings within the PHP version in question, click on Switch to PHP Options.

By clicking on one of the options in grey, you will be presented with a drop-down list to change specific settings. Hit Apply to implement the settings:

How to change PHP version and update PHP extensions on Shared servers

NOTE 1: It is recommended to update your website scripts and use PHP 5.6. If the latest software you run for your websites is not yet compiled for PHP 5.6, please contact the script vendor for a compatibility patch.

NOTE 2: If you used a php.ini file for editing your account PHP configuration before, you will need to replicate the custom values using PHP Selector tool.

NOTE 3: In order to increase the max upload size, make sure to modify both post_max_size and upload_max_filesize values.

NOTE 4: max_execution_time can be increased up to 300 seconds.

Change PHP version for addon domain

Sometimes your website may need to use a different PHP version from the one assigned to your domain on your cPanel account.

To set a different PHP version for an addon domain, you need to add a special code to your .htaccess file. To do this, follow the steps below.

1. Find the .htaccess file for the addon domain in question. The steps for how to find it can be located here.

2. Add the following line to your .htaccess file:

<FilesMatch ".(?:html|php)$">
SetHandler application/x-lsphpXX
</FilesMatch>

where XX is the PHP version you wish to set. It can be 52, 53, 54, 55, 56, 70, 71,72, or 73.

For example:

How to change PHP version and update PHP extensions on Shared servers

3. Click “Save changes”.

NOTE: When a different PHP version is set for the addon domain, there are no PHP extensions enabled by default. To make a website work correctly, you will need to upload a php.ini file to the folder of the addon domain. You can check this article (see point 6) to help you with uploading files to the hosting account.You can download the php.ini file for different PHP versions from the Attachments section at the end of this guide. Do not forget to rename the file to php.ini once it is uploaded to the hosting account.

Alternatively, you can run the command below via SSH:

cp /opt/alt/default_php_ini/phpXX.ini /home/cPanel_username/path_to_the_folder/php.ini
  • XX is PHP version you wish to set (it can be 52, 53, 54, 55, 56, 70, 71, 72 or 73),
  • cPanel_username should be replaced with your actual cPanel username, and
  • path_to_the_folder is a path to the folder of the addon domain.

For example:

How to change PHP version and update PHP extensions on Shared servers

You can find details on how to access a hosting account via SSH here.

The process is similar if you wish to set a different PHP version for a subdomain.

ByJUJU-dev

Access Definition

Access Definition

Access is simply being able to get to what you need. Data access is being able to get to (usually having permission to use) particular data on a computer. Web access means having a connection to the World Wide Web through an access provider or an online service provider such as America Online.

For data access, access is usually specified as read-only access and read/write access.

ByJUJU-dev

What is a Dedicated Server?

What is a Dedicated Server?

What is a Dedicated Server?

A dedicated server is a physical server that is dedicated to a single customer or organization, providing them with exclusive use of the server’s resources. This means that the customer has complete control over the server, including the ability to customize the operating system, install software, and configure the server to meet their specific needs.

A dedicated server is typically a high-performance server, often housed in a data center, and is managed by the customer or a third-party provider. Dedicated servers are often used by businesses, organizations, and individuals who require:

  1. High Performance: Dedicated servers are designed to provide high levels of performance, making them suitable for demanding applications such as e-commerce, gaming, and video streaming.
  2. Security: Dedicated servers provide a high level of security, as the customer has full control over the server and can implement robust security measures to protect their data.
  3. Customization: Dedicated servers can be customized to meet specific needs, such as installing custom software, configuring network settings, and selecting hardware components.
  4. Reliability: Dedicated servers are designed to be highly reliable, with redundant systems and backup power supplies to minimize downtime.

Types of dedicated servers:

  1. Physical Dedicated Server: A physical server located in a data center, managed by the customer or a third-party provider.
  2. Virtual Dedicated Server: A virtualized server running on a physical host machine, providing multiple virtual servers on a single physical machine.
  3. Cloud Dedicated Server: A cloud-based dedicated server, providing a virtualized environment with dedicated resources.

Features of dedicated servers:

  1. Root Access: Customers have full root access to the server, allowing them to customize and manage the operating system and software.
  2. Customizable: Dedicated servers can be customized with various hardware and software configurations to meet specific needs.
  3. Scalability: Dedicated servers can be easily scaled up or down as needed to accommodate changes in traffic or resource demands.
  4. 24/7 Support: Dedicated server providers typically offer 24/7 support for customers.

Benefits of dedicated servers:

  1. Increased Security: Dedicated servers provide a high level of security, as customers have full control over the server and can implement robust security measures.
  2. Improved Performance: Dedicated servers are designed to provide high levels of performance, making them suitable for demanding applications.
  3. Customization: Dedicated servers can be customized to meet specific needs, allowing customers to tailor their infrastructure to their unique requirements.
  4. Reliability: Dedicated servers are designed to be highly reliable, minimizing downtime and ensuring business continuity.

In summary, a dedicated server is a powerful computing resource that provides customers with exclusive use of a physical server, offering high performance, security, customization, and reliability.

ByJUJU-dev

What is Dedicated Hosting?

What is Dedicated Hosting?

What is Dedicated Hosting?

Dedicated hosting is a type of web hosting where a single physical server is rented or leased by a customer for their exclusive use. The customer has full control over the server, including the ability to customize the operating system, install any software they need, and configure the server to meet their specific needs.

Dedicated hosting is often used by organizations that require a high level of customization, security, and control over their web infrastructure. It is typically more expensive than shared hosting, but provides more resources and flexibility.

Here are some key characteristics of dedicated hosting:

  1. Exclusive Use: The customer has sole use of the server, with no sharing with other customers.
  2. Full Control: The customer has complete control over the server, including the operating system, software, and configuration.
  3. Customization: The customer can customize the server to meet their specific needs, including installing custom software and configuring the network.
  4. High-Level Security: Dedicated hosting often includes advanced security features, such as firewalls and intrusion detection systems.
  5. Scalability: Dedicated servers can be easily upgraded or downgraded as needed to accommodate changing traffic demands.
  6. Reliability: Dedicated servers are typically more reliable than shared hosting, with fewer outages and downtime.

Types of dedicated hosting:

  1. Managed Dedicated Hosting: The hosting provider manages the server for the customer, including monitoring, maintenance, and upgrades.
  2. Unmanaged Dedicated Hosting: The customer is responsible for managing the server themselves.
  3. Colocation Hosting: The customer provides their own server and houses it in a data center provided by the hosting provider.

Dedicated hosting is suitable for:

  1. Large Enterprises: Companies with high traffic demands or complex infrastructure requirements.
  2. E-commerce Sites: Online stores that require high levels of security and scalability.
  3. Mission-Critical Applications: Applications that require high uptime and reliability.
  4. Customized Solutions: Companies that require customized solutions not available through shared hosting plans.

Some popular dedicated hosting providers include:

  1. Rackspace
  2. Liquid Web
  3. HostGator
  4. InterServer
  5. OVH
  6. Jujuhost

In summary, dedicated hosting provides a high level of customization, security, and control over a physical server, making it an attractive option for organizations that require a tailored solution for their web infrastructure.

ByJUJU-dev

What is SNMP and How it Works

What is SNMP and How it Works

What is SNMP and How it Works

SNMP (Simple Network Management Protocol) is a protocol used for managing and monitoring network devices, such as routers, switches, servers, and other networked devices. It allows network administrators to monitor and manage the performance and configuration of these devices remotely.

How SNMP Works:

  1. Agent: The device being managed (e.g., a router or switch) runs an SNMP agent software that collects data about its internal state and performance.
  2. Manager: The network administrator uses an SNMP management software (e.g., a network monitoring tool) to connect to the SNMP agent on the device.
  3. Request-Response: The manager sends an SNMP request to the agent, asking for specific data or configuration information.
  4. Response: The agent responds with the requested data or configuration information.
  5. Trap: The agent can also send unsolicited messages (traps) to the manager when something significant occurs, such as a device failure or network congestion.

SNMP Protocols:

SNMP uses several protocols to manage and monitor devices:

  1. GET: Retrieves specific data from a device.
  2. SET: Sets specific values on a device.
  3. TRAP: Sends unsolicited messages to the manager.
  4. GETNEXT: Retrieves a list of available OID (Object Identifier) values.

OIDs (Object Identifiers):

OIDs are used to identify specific objects on a device, such as CPU usage or network interfaces. Each OID has a unique value, making it possible to request specific data from a device.

SNMP Communities:

SNMP communities are groups of devices that share the same community string, which is used to authenticate requests between the manager and agents. Communities can be public or private.

Common SNMP Applications:

  1. Network Monitoring: Monitor device performance, traffic flow, and configuration.
  2. Network Configuration: Change device settings, such as IP addresses or firewall rules.
  3. Troubleshooting: Identify and diagnose issues on devices using SNMP traps and logs.
  4. Inventory Management: Automate device discovery and inventory management.

SNMP Security Considerations:

  1. Community Strings: Use secure community strings to prevent unauthorized access.
  2. Encryption: Use encrypted communication channels (e.g., TLS/SSL) to protect sensitive data.
  3. Authentication: Implement strong authentication mechanisms, such as username/password combinations.

Popular SNMP Tools:

  1. Net-SNMP: A popular open-source SNMP implementation for Linux and Windows.
  2. MRTG: A network monitoring tool that uses SNMP to collect data from devices.
  3. Cacti: An open-source network monitoring tool that uses SNMP and RRDTool.

In summary, SNMP is a widely used protocol for managing and monitoring network devices, allowing network administrators to collect data, configure settings, and troubleshoot issues remotely.

 

ByJUJU-dev

How to – PHP Loaders

How to – PHP Loaders

What are PHP Loaders and what is their role?

PHP Loaders are a type of library or framework that allows you to load data into a PHP application. They play a crucial role in separating the data from the application logic, making it easier to manage, maintain, and scale your codebase.

What is a PHP Loader?

A PHP Loader is a PHP class or module that loads data into your application. It’s responsible for reading data from various sources, such as databases, files, or APIs, and providing it to your application in a structured and organized manner.

Role of a PHP Loader:

  1. Data Retrieval: Loaders retrieve data from various sources, such as databases, files, or APIs.
  2. Data Transformation: Loaders transform the retrieved data into a format that can be easily consumed by your application.
  3. Data Filtering: Loaders can filter the data to only include relevant information, reducing the amount of data that needs to be processed.
  4. Data Caching: Loaders can cache frequently accessed data to improve performance and reduce the load on your application.
  5. Data Validation: Loaders can validate the retrieved data to ensure it meets certain criteria or conforms to specific formats.
  6. Data Processing: Loaders can perform complex data processing tasks, such as data aggregation, calculations, or transformations.

Types of PHP Loaders:

  1. Database Loaders: Load data from relational databases like MySQL or PostgreSQL.
  2. File Loaders: Load data from files, such as CSV, JSON, or XML files.
  3. API Loaders: Load data from APIs, such as RESTful APIs or SOAP web services.
  4. Cache Loaders: Load data from caching mechanisms like Redis or Memcached.
  5. Filesystem Loaders: Load data from file systems, such as loading files or directories.

Benefits of using PHP Loaders:

  1. Separation of Concerns: Separate data retrieval and processing from application logic.
  2. Reusability: Reuse loaders across multiple applications or projects.
  3. Flexibility: Easily switch between different data sources or formats.
  4. Scalability: Improve performance by offloading data processing and caching.
  5. Maintenance: Simplify maintenance and updates by separating concerns.

Popular PHP Loaders:

  1. Doctrine DBAL (Database Abstraction Layer)
  2. Symfony’s Doctrine Bundle
  3. Laravel’s Eloquent ORM (Object-Relational Mapping)
  4. PDO (PHP Data Objects)
  5. PHP-CSV (CSV File Loader)

In summary, PHP Loaders play a vital role in loading data into your PHP application by providing a flexible and reusable way to separate concerns, improve performance, and simplify maintenance.

How can I enable PHP loaders:

Enabling PHP Loaders involves a few steps, depending on the type of loader you want to use and the PHP version you’re running. Here’s a general guide:

1. Install a PHP Loader:

You can install a PHP Loader using various methods:

  • PEAR: PHP Extension and Application Repository (PEAR) is a package manager for PHP. You can install PEAR using the command pear install php_loader and then enable the loader by adding extension=php_loader.so (or .dll on Windows) to your php.ini file.
  • Composer: Composer is a popular package manager for PHP. You can install a PHP Loader using Composer by running the command composer require php-loader/php-loader.
  • PECL: PECL (PHP Extension Community Library) is a package manager for PHP extensions. You can install PECL using the command pecl install php_loader and then enable the loader by adding extension=php_loader.so (or .dll on Windows) to your php.ini file.

2. Enable the Loader in Your PHP Configuration File:

Once you’ve installed the loader, you need to enable it in your PHP configuration file (php.ini). Open the file and add the following line:

extension=php_loader.so

or

extension=php_loader.dll

Save the changes to the file and restart your web server or PHP-FPM service.

3. Configure the Loader:

After enabling the loader, you’ll need to configure it. The configuration options vary depending on the loader you’re using. Here are some common options:

  • PHP Loaders: You can configure the loader using environment variables or an INI file. For example, you can set the loader.cache_dir variable to specify the directory where cached files will be stored.
  • Symfony’s Doctrine ORM: If you’re using Symfony’s Doctrine ORM, you’ll need to configure it in your doctrine.yml file.

4. Test Your Loader:

Once you’ve enabled and configured the loader, test it by creating a new PHP script that uses the loader. For example:

<?php

require_once 'autoload.php';

echo 'Hello, World!';

This script should output “Hello, World!” if the loader is working correctly.

Remember to check your PHP version compatibility before installing and configuring a PHP Loader. Some loaders may only work with specific versions of PHP.

 

 

ByJUJU-dev

How to change PHP version on Business servers

Changing the PHP version on a business server can be a bit more complex than on a shared hosting environment, as it requires manually editing configuration files and restarting services. Here’s a step-by-step guide on how to change the PHP version on a business server:

Step 1: Identify the current PHP version

  • Log in to your business server using SSH or your preferred method.
  • Check the current PHP version by running the command php -v or php --version.
  • Note down the current PHP version, as you’ll need it later.

Step 2: Update the package manager

  • If you’re using an RPM-based distribution like CentOS or RHEL, update the package manager (Yum) by running the command sudo yum update.
  • If you’re using a DEB-based distribution like Ubuntu or Debian, update the package manager (Apt) by running the command sudo apt-get update.

Step 3: Install the new PHP version

  • Use your package manager to install the desired PHP version. For example:
    • RPM-based distributions: sudo yum install php71w-fpm (for PHP 7.1) or sudo yum install php73-fpm (for PHP 7.3).
    • DEB-based distributions: sudo apt-get install php7.1-fpm (for PHP 7.1) or sudo apt-get install php7.3-fpm (for PHP 7.3).

Step 4: Enable the new PHP version

  • Create a symbolic link to the new PHP version:
    • RPM-based distributions: sudo ln -s /opt/rh/php71/root/usr/bin/php /usr/bin/php71 (for PHP 7.1) or sudo ln -s /opt/rh/php73/root/usr/bin/php /usr/bin/php73 (for PHP 7.3).
    • DEB-based distributions: sudo update-alternatives --install /usr/bin/php php /usr/lib/php/7.1/bin/php 1 (for PHP 7.1) or sudo update-alternatives --install /usr/bin/php php /usr/lib/php/7.3/bin/php 1 (for PHP 7.3).

Step 5: Set the default PHP version

  • Update the default PHP version by running:
    • RPM-based distributions: sudo alternatives --set php /usr/bin/php71 (for PHP 7.1) or sudo alternatives --set php /usr/bin/php73 (for PHP 7.3).
    • DEB-based distributions: sudo update-alternatives --set php /usr/lib/php/7.1/bin/php (for PHP 7.1) or sudo update-alternatives --set php /usr/lib/php/7.3/bin/php (for PHP 7.3).

Step 6: Restart services

  • Restart the Apache or Nginx service to apply the changes:
    • RPM-based distributions: sudo systemctl restart httpd
    • DEB-based distributions: sudo service apache2 restart

Step 7: Verify the new PHP version

  • Run the command php -v or php --version again to verify that the new PHP version is active.

That’s it! You’ve successfully changed the PHP version on your business server.

Remember to test your website and applications after changing the PHP version to ensure everything is working as expected.

ByJUJU-dev

Telnet Definition

Telnet Definition

Telnet Definition

Telnet Definition

What is Telnet?
Telnet is a user command and an underlying TCP/IP protocol for accessing remote computers. Through Telnet, an administrator or another user can access someone else’s computer remotely. On the Web, HTTP and FTP protocols allow you to request specific files from remote computers, but not to actually be logged on as a user of that computer. With Telnet, you log on as a regular user with whatever privileges you may have been granted to the specific application and data on that computer.A Telnet command request looks like this (the computer name is made-up):

telnet library.jujuhost.com

The result of this request would be an invitation to log on with a userid and a prompt for a password. If accepted, you would be logged on like any user who used this computer every day.

Telnet is most likely to be used by program developers and anyone who has a need to use specific applications or data located at a particular host computer.

ByJUJU-dev

How to get an SSH client

How to get an SSH client

How to get an SSH client
To access your account via SSH, you should download and install one of available SSH clients. You can find the list of free SSH clients in the table below. If you have Windows, we recommend to use PuTTY as your SSH client.

SSH Client Operating Systems Supported Download
PuTTY Windows and Unix
WinSCP Windows (SCP and SFTP, no SSH)
Fugu Macintosh

 

ByJUJU-dev

How to connect via SSH using keys

Connecting to a server via SSH using keys is a secure and convenient way to access your server without having to remember a password. Here’s a step-by-step guide on how to connect to a server via SSH using keys:

Prerequisites:

  • You have a Unix-based operating system (such as Linux or macOS) or a tool that allows you to use SSH, such as PuTTY on Windows.
  • You have generated a pair of SSH keys using a tool like OpenSSL or Git Bash.
  • You have the public key saved on your local machine and the private key saved on your server.

Step 1: Generate a pair of SSH keys

If you haven’t already, generate a pair of SSH keys using a tool like OpenSSL or Git Bash. The process is as follows:

  • Open Terminal or Git Bash.
  • Run the command ssh-keygen -t rsa -b 4096 (or ssh-keygen -t ed25519 for newer versions of OpenSSH).
  • Follow the prompts to create a new key pair.
  • Save the private key in a secure location, such as ~/.ssh/id_rsa (or ~/.ssh/id_ed25519 for newer versions of OpenSSH).
  • Save the public key in a file, such as ~/.ssh/id_rsa.pub (or ~/.ssh/id_ed25519.pub for newer versions of OpenSSH).

Step 2: Copy the public key to your server

Copy the contents of the public key file (id_rsa.pub or id_ed25519.pub) and add it to the authorized_keys file on your server. You can do this using SFTP, SCP, or by pasting it directly into the file using SSH.

Step 3: Configure SSH client

To connect to your server using SSH, you’ll need to configure your SSH client. The process is as follows:

  • On Linux/macOS, open Terminal and run the command ssh-add ~/.ssh/id_rsa (or ssh-add ~/.ssh/id_ed25519 for newer versions of OpenSSH).
  • On Windows, open PuTTY and load the private key file by clicking “File” > “Load private key” and selecting your private key file.

Step 4: Connect to your server

Use your configured SSH client to connect to your server. The command would be:

ssh user@your-server-ip-or-hostname

Replace user with your username and your-server-ip-or-hostname with your server’s IP address or hostname.

Tips and Variations:

  • Make sure to set the correct permissions on the authorized_keys file and ensure it’s only readable by the owner.
  • If you’re using a non-standard port for SSH, specify it in the connection command: ssh -p 2222 user@your-server-ip-or-hostname.
  • If you’re connecting from a corporate network or behind a firewall, you may need to configure your firewall rules or ask your network administrator for assistance.

By following these steps, you should be able to connect to your server via SSH using keys. This method provides an additional layer of security compared to traditional password-based authentication.