Linux Web Hosting, DevOps, and Cloud Solutions

Empowering you with the knowledge to master Linux web hosting, DevOps and Cloud

 Linux Web Hosting, DevOps, and Cloud Solutions

Demystifying DevOps: How it Works in Real-world Scenarios

DevOps is a software development practice that emphasizes collaboration, communication, and automation between software development teams and IT operations teams. Traditional software development methodologies often create a disconnect between development and operations which often leads to slower development, more errors, and increased downtime. DevOps aims to bridge the gap between development and operations, resulting in a more efficient, reliable, and scalable development process.

To achieve these goals, DevOps incorporates several key practices, including continuous development, continuous integration, continuous delivery, continuous deployment, continuous testing, and continuous monitoring. These practices are integrated into a single pipeline known as the CI/CD pipeline, which automates and streamlines the software development and delivery process.

In this article, we will provide a comprehensive guide to how DevOps works, including a detailed explanation of the six stages in the CI/CD pipeline.

1. Continuous Development:
Continuous development is the first stage in the CI/CD pipeline. This stage involves the continuous creation and updating of software code. Developers use version control tools, such as Git or SVN, to manage code changes and collaborate on code development. They work in small, iterative cycles to create code that can be easily tested and deployed. Continuous development also involves creating and maintaining documentation, such as code comments and user manuals.
Continuous development is a key aspect of DevOps, as it promotes collaboration and communication between developers and operations teams. By working together in small, iterative cycles, developers and operations teams can quickly identify and resolve issues, resulting in faster and more reliable software development.

Example: A software development team is working on a new feature for an e-commerce website. They use version control tools to manage code changes and collaborate on code development. The team works in small, iterative cycles, with each cycle consisting of creating and testing a new piece of code. This approach ensures that each piece of code is tested thoroughly before being deployed to the next stage in the CI/CD pipeline.

2. Continuous Integration:
The second stage in the CI/CD pipeline is continuous integration. This stage involves automatically building and testing code changes as soon as they are committed to the version control system. The purpose of continuous integration is to catch and fix errors early in the process, before they become more complex and difficult to resolve.
Continuous integration involves using automated tools, such as Jenkins or CircleCI, to build and test code changes. These tools can automatically compile code changes, run unit tests, and generate reports on code quality.

Example: After the software development team completes a cycle of code development, the code changes are automatically built and tested in the continuous integration stage. This stage involves using an automated tool, such as Jenkins, to build and test the code changes. If any errors are found, they are flagged and sent back to the development team for resolution.

3. Continuous Testing:
The third stage in the CI/CD pipeline is continuous testing. This stage involves automatically testing the code changes for functionality, performance, and security. The purpose of continuous testing is to ensure that the code changes are of high quality and meet the requirements of the end-users.
Continuous testing involves using automated testing tools, such as Selenium or Appium, to test the code changes. These tools can automatically run functional and performance tests on the code changes, generate reports on test results, and provide feedback to the development team.

Example: After the code changes pass the continuous integration tests, they are automatically sent to the continuous testing stage. This stage involves using an automated testing tool, such as Selenium, to test the code changes for functionality and performance. If any issues are found during testing, they are sent back to the development team for resolution. The continuous testing stage ensures that the code changes are thoroughly tested before being deployed to the next stage in the CI/CD pipeline.

4. Continuous Deployment:
The fourth stage in the pipeline is continuous deployment. In this stage, the code changes that have passed the continuous testing stage are automatically deployed to different environments, such as staging, pre-production, and production. Continuous deployment is the process of releasing software changes automatically to one or more environments, after they have passed automated tests and quality checks.

Deploying the changes to different environments allows the development and operations teams to test the software in different scenarios, ensuring that it is stable, reliable, and secure. In each environment, the software is tested again to confirm that it meets the requirements and works as expected. If any issues are found during the testing phase, they are sent back to the development team to be resolved.

Examples:

After the code changes pass the continuous testing stage, they are automatically deployed to the staging environment for further testing and validation. Once the changes have been validated in the staging environment, they are automatically deployed to the pre-production environment to conduct user acceptance testing.Finally, the changes are deployed to the production environment after they have been approved by the stakeholders and have passed all tests and quality checks in the pre-production environment.

5. Continuous Monitoring:
The final step in the DevOps process is Continuous Monitoring, which involves monitoring the production environment to identify and resolve any issues that may arise. This step involves using various monitoring tools to track the performance of the application, server, and other infrastructure components. The data collected from these tools is analyzed to identify any performance issues or potential risks to the system’s stability. This helps the DevOps team to proactively address any issues before they turn into critical problems that can negatively impact the users.
For example, let’s say that a company’s application is experiencing a high volume of traffic, and the servers are struggling to keep up with the demand. The DevOps team can use monitoring tools like Nagios, New relic, or Prometheus to identify the root cause of the performance issue. They may find that the servers are running low on memory or that there is a bottleneck in the application’s code. By identifying the issue early on, the team can take corrective action to optimize the application’s performance and prevent any downtime or service disruptions.

In summary, DevOps is not just a set of tools and practices, but also a mindset that emphasizes collaboration, automation, and continuous improvement, and agility. By breaking down the silos between development and operations teams, organizations can achieve faster release cycles, better collaboration, and higher-quality software products. The five key steps in the DevOps process – Continuous Development, Continuous Integration, Continuous Testing, Continuous Delivery, Continuous Deployment, and Continuous Monitoring – are all critical to achieving these goals. By following these best practices, organizations can streamline their software development and deployment processes and deliver value to their customers faster and more efficiently.

6 Essential DevOps Best Practices for Success

DevOps has become a key driver of software delivery in many organizations, as it promotes collaboration, automation, and continuous improvement across the entire software development lifecycle. However, implementing DevOps is not always easy, as it requires significant changes in culture, processes, and tooling. In this post, we will provide some tips and best practices for implementing DevOps in your organization and achieving success.

1. Foster a Culture of Collaboration
One of the key principles of DevOps is collaboration, which means breaking down silos and promoting teamwork between different teams, such as development, operations, and quality assurance. To foster a culture of collaboration, it is important to create cross-functional teams that have a shared goal and work towards it together. This can be achieved by organizing regular meetings, sharing information, and encouraging open communication.

2. Automate Everything You Can
Automation is another key principle of DevOps, as it helps to streamline processes, reduce errors, and speed up delivery. Automating everything you can, from building and testing to deployment and monitoring, is essential for achieving continuous delivery and improving efficiency. Some popular automation tools for DevOps include Jenkins, Ansible, and Puppet.

3. Continuously Improve Your Processes
Continuous improvement is a core DevOps principle, which means constantly looking for ways to optimize your processes and workflows. To achieve this, you should regularly assess your current practices, identify areas for improvement, and implement changes to address them. This can be done through regular retrospectives, feedback loops, and metrics tracking.

4. Use Containers and Microservices
Containers and microservices are becoming increasingly popular in DevOps, as they allow for greater scalability, flexibility, and agility. Containers provide a lightweight, portable way to package applications and their dependencies, while microservices break down applications into small, independent components that can be developed and deployed separately. Using these technologies can help you achieve faster delivery and more efficient resource utilization.

5. Implement Continuous Testing
Continuous testing is a critical component of DevOps, as it helps to ensure that your software is always of high quality and meets your customers’ needs. To implement continuous testing, you should integrate testing into every stage of the software development lifecycle, automate as much as possible, and use metrics to track and improve the quality of your tests.

6. Make Security a Priority
It is important to make security a top priority when implementing DevOps. Security threats are becoming increasingly common and sophisticated, and can result in costly data breaches and reputational damage. To ensure the security of your applications and infrastructure, you should adopt a security-first mindset, perform regular security assessments, and implement security controls and best practices throughout the software development lifecycle.

By making security a top priority and integrating it into your DevOps processes, you can reduce the risk of security threats and improve the overall quality and reliability of your software.

In conclusion, DevOps is a powerful approach to software delivery that can help organizations achieve faster delivery, higher quality, and greater customer satisfaction. By following these best practices, you can successfully implement DevOps in your organization and reap the benefits of this approach. Remember to foster a culture of collaboration, automate everything you can, continuously improve your processes, use containers and microservices, and implement continuous testing.

Do You Need DevOps? A Guide to Making the Right Decision

DevOps has become a buzzword in the world of software development, and for good reason. It’s a methodology that emphasizes collaboration, communication, and automation between development and operations teams. But does your organization actually need DevOps? And if so, how can you make sure you’re implementing it effectively? In this post, we’ll explore these questions and provide some guidance on how to approach the decision.

The Benefits of DevOps

Before we dive into whether or not you need DevOps, it’s worth examining the benefits that it can provide. Some of the key advantages of DevOps include:

Faster and more frequent releases – DevOps can help teams to automate their release processes, allowing for more rapid iteration and feedback.

Increased collaboration – DevOps emphasizes communication and teamwork between development and operations teams, which can help to break down silos and improve overall efficiency.

Improved quality – By using automation to manage testing and deployment, DevOps can help to reduce the risk of errors and improve the quality of software products.

Better alignment with business goals – DevOps can help to ensure that development efforts are closely aligned with business objectives, leading to better outcomes and greater success.

Do You Need DevOps?

So, how do you know if your organization needs DevOps? The answer will depend on a variety of factors, including the size of your organization, the complexity of your software systems, and your overall development goals. Here are some questions to consider:

Are you experiencing bottlenecks or delays in your software development process?

Are you struggling to keep up with the pace of change in your industry?

Are you looking to improve the quality and reliability of your software products?

Are you seeking to increase collaboration and communication between your development and operations teams?

If you answered yes to any of these questions, then DevOps may be worth exploring further.

Implementing DevOps Effectively

If you’ve decided that DevOps is the right approach for your organization, then it’s important to implement it effectively. Here are some tips to keep in mind:

Start small – DevOps can be a major shift in how your organization approaches software development, so it’s important to start small and scale up gradually.

Build a strong culture of collaboration – DevOps relies heavily on teamwork and communication, so it’s important to create a culture that supports these values.

Use automation tools wisely – Automation can be a powerful tool for improving efficiency and quality, but it’s important to use it wisely and not rely on it exclusively.

Continuously measure and improve – DevOps is all about continuous improvement, so make sure you’re measuring key metrics and making changes as needed.

In conclusion, DevOps can provide significant benefits for organizations looking to improve their software development processes. However, it’s important to carefully consider whether it’s the right approach for your organization, and to implement it effectively if you decide to move forward. With the right approach, DevOps can help to drive greater efficiency, collaboration, and success in software development.

DevOps: A Brief Introduction

DevOps: A Brief Introduction

In the world of software development, DevOps is a term that is often used to describe a methodology that emphasizes collaboration and communication between software developers and IT operations professionals. The goal of DevOps is to create a more streamlined and efficient development process that allows for faster and more reliable software releases.

At its core, DevOps is all about breaking down the barriers that exist between development and operations teams. Traditionally, these two teams have operated independently of one another, which can create bottlenecks and delays in the software development process. DevOps seeks to overcome these challenges by encouraging collaboration, sharing of knowledge, and the use of automation tools.

One of the key benefits of DevOps is that it allows for faster and more frequent software releases. By using automation tools to manage the software delivery pipeline, developers can quickly deploy new code changes to production environments, allowing for more rapid iteration and feedback. This can help to reduce the time-to-market for new features and products, which can be a critical competitive advantage in many industries.

Another important aspect of DevOps is the emphasis on continuous improvement. By constantly monitoring and measuring the performance of software systems, DevOps teams can identify areas for improvement and implement changes that lead to better outcomes. This iterative approach to development can help to create more reliable and stable software systems over time.

devops

To be successful with DevOps, organizations must be willing to invest in the necessary infrastructure, tools, and processes. This includes things like automation tools for testing, deployment, and monitoring, as well as training and support for team members who are new to the DevOps methodology.

Overall, DevOps is a powerful approach to software development that can help organizations to create more efficient and effective development processes. By emphasizing collaboration, automation, and continuous improvement, DevOps teams can deliver higher-quality software products in less time, ultimately driving greater business success.

WordPress Migration: A Comprehensive Guide for Beginners

Migrating a WordPress site from one host to another can be a daunting task, but it’s sometimes necessary to ensure your website is running smoothly and securely. There are several reasons why you might consider migrating your WordPress site, such as poor website performance, unreliable hosting, or the need for more resources or features.

When it comes to migrating a WordPress site, there are two primary methods: manual migration and plugin migration. Manual migration involves transferring all of the files and database from one host to another manually, while plugin migration involves using a plugin to transfer the files and database.

Manual migration is generally preferred for larger or more complex sites that may not be easily migrated using a plugin, and it gives you more control over the migration process. On the other hand, plugin migration is usually faster and easier, making it a good option for smaller websites or those without a lot of technical expertise.

Regardless of the method you choose, it’s important to ensure that your website is fully backed up before migrating to avoid any potential data loss or other issues. Additionally, it’s a good idea to test your website thoroughly after the migration to ensure everything is working as expected.

How to Migrate Your WordPress Site Manually

It is advisable to have an understanding of the WordPress migration process, even if you are utilizing a plugin for the migration of your website. Following the steps for migrating a WordPress website manually from one host to another.

Step 1: Set up your new host

Selecting a trustworthy website host is essential. You can opt for a reputable shared hosting provider or choose to have your own server based on your needs. Shared hosting includes all necessary web hosting tools and software already installed, while for VPS or Dedicated servers, you will need to install and set up WordPress hosting on the server.

Step 2: Backup your website files and database
Before starting the migration process, it’s important to make a backup of your website files and database. This will ensure that you have a copy of your website in case anything goes wrong during the migration process.

To create a backup of your website, you can use a plugin like UpdraftPlus or manually download your website files via FTP or file manager, and your database using phpMyAdmin. If you possess SSH access to the host, you can also utilize zip or tar to compile the files and download them. Furthermore, you can utilize the mysqldump command to create backups of your database.

Step 3: Transfer your website files

After setting up your new host, you can transfer your website files from your old host to your new host. To do this, connect to your old host using an FTP client and download your website files. Then, connect to your new host using the same FTP client and upload your website files to the appropriate folder.

Step 4: import your database

Next, you’ll need to export your website database from your old host and import it into your new host. To do this, log in to your new host’s phpMyAdmin, select your new database, and choose the “Import” option. Upload the exported database file from your computer and import it into your new database. If you have SSH access to the new host, then you may use “mysql” command line utility to import the database backup sql files.

Step 5: Update your website configuration

After transferring your website files and database, you’ll need to update your website configuration to point to your new host. To do this, open your wp-config.php file on your new host and update the database settings with your new database name, username, and password. Here are the three lines you’ll normally need to update:

define(‘DB_NAME, ‘db_name’);
define(‘DB_USER, ‘db_user’);
define(‘DB_PASSWORD, ‘db_pass’);

If your new databases are hosted on another host, you will have to update the “DB_HOST” section also.

If you are changing the WordPress domain url, you may also need to update your website URLs in your WordPress database using a tool such as the Better Search Replace plugin. This will ensure that your website links and URLs are updated to point to your new host.

Step 6: Test your website and Change DNS.

Finally, you’ll need to make sure your Domain Name Server (DNS) is pointed toward the correct host. It’s important to test your website on your new host to ensure everything is working correctly. Check your website’s pages, posts, media files, and any other features make sure they’re all functioning properly.

If you encounter any issues, refer to your backup files and try to troubleshoot the issue. Once you’ve confirmed that everything is working correctly, you can cancel your old hosting account.

How to Migrate Your WordPress Site With a Plugin

Using a migration plugin can save you a significant amount of time and effort, as it automates many of the technical steps involved in migrating your site. With a good migration plugin, you can quickly and easily move your entire website to a new server or domain without worrying about the complexities of manually transferring files and databases.

Overall, migrating a WordPress site can be a complex process, but with the right preparation and tools, you can ensure a successful migration that keeps your website running smoothly and securely.

Step 1: Choose a migration plugin

There are many migration plugins available for WordPress, both free and paid. Some of the popular ones include Duplicator, All-in-One WP Migration, and WPvivid Backup Plugin. For this tutorial, we’ll be using the All-in-One WP Migration plugin.

Step 2: Install the plugin

To install the All-in-One WP Migration plugin, log in to your WordPress dashboard and go to Plugins > Add New. Search for “All-in-One WP Migration”, install and activate the plugin.

Step 3: Export your WordPress site

Once you’ve installed and activated the plugin, go to All-in-One WP Migration > Export. This will create a backup of your WordPress site, including all your posts, pages, media files, plugins, themes, and the database. The backup will be saved as a downloadable file.

Step 4: Import your WordPress site

Next, you install fresh WordPress on your new hosting provider. You’ll need to import the backup file to your new WordPress site. Install and activate the All-in-One WP Migration plugin on your new site, and go to All-in-One WP Migration > Import. Upload the backup file you created in Step 3.

The plugin will then import all the data from the backup file, including the database, plugins, themes, posts, pages, and media files. Once the import is complete, you’ll have a fully functional WordPress site on your new server.

Step 5: Update your website URL

After migrating your WordPress site, you’ll need to update your website URL to reflect your new domain. Go to Settings > General in your WordPress dashboard and update the WordPress Address (URL) and Site Address (URL) fields to your new domain.

Step 6: Test your website

Finally, test your website to make sure everything is working properly. Check all the pages and posts, and make sure all the links are working. You may also want to check your website’s performance and ensure that it’s running smoothly.

Best plugins for WordPress migration

There are several great migration plugins available for WordPress. Here are some of the most popular ones:

1. Duplicator: Duplicator is a free migration plugin that allows you to backup, transfer, and migrate your WordPress site. It’s easy to use and has a user-friendly interface.

2. All-in-One WP Migration: All-in-One WP Migration is another popular migration plugin that lets you export your entire WordPress site, including the database, plugins, themes, and media files, and import it to a new server or domain.

3. WPvivid Backup Plugin: WPvivid Backup Plugin is a comprehensive backup and migration plugin that allows you to backup and restore your WordPress site, as well as transfer it to a new server or domain.

4. UpdraftPlus: UpdraftPlus is a backup and migration plugin that allows you to backup your WordPress site and transfer it to a new server or domain. It also has a paid version with additional features.

5. Jetpack: Jetpack is a popular WordPress plugin that offers a suite of features, including backup and migration tools. It’s an all-in-one solution that includes security, performance, and marketing tools, making it a great choice for website owners who want an all-in-one solution.

These are just a few examples of the many great migration plugins available for WordPress. The best migration plugin for you will depend on your specific needs and budget. It’s always a good idea to research different plugins and read reviews before choosing one to ensure it meets your requirements.

In summary, migrating a WordPress site from one host to another can be necessary for a variety of reasons, such as poor website performance or unreliable hosting. There are two primary methods for migrating a WordPress site: manual migration and plugin migration. Manual migration is preferred for larger or more complex sites, while plugin migration is usually faster and easier for smaller sites or those without a lot of technical expertise. Regardless of the method chosen, it’s important to backup the website fully before migrating and to thoroughly test the website after the migration to ensure everything is working as expected. With the right preparation and tools, a successful migration can ensure a website runs smoothly and securely on a new host.

How to remove or compress huge MySQL general and query log table

How to remove or compress huge MySQL general and query log table

If you have enabled MySQL general or slow logging, it can create quite big log, depending upon your MySQL usage/queries.
So we may have to periodically clear them to save space.

Please note that MySQL can save logs to either table or files. This document assumes you are using table as log output.

Files: slow_log.CSV and general_log.CSV (The location and the name of the file can be different)

By default, logging is to CSF file.

MYSQL supports run time clearing of these logs. So no need to restart the MySQL service.
Never delete the CSV file directly. It can crash MySQL.

Slow query log

SET GLOBAL slow_query_log='OFF';
DROP TABLE IF EXISTS slow_log2;
CREATE TABLE slow_log2 LIKE slow_log;
RENAME TABLE slow_log TO slow_log_backup, slow_log2 TO slow_log;
gzip /var/db/mysql/mysql/slow_log_backup.CSV 
DROP TABLE  slow_log_backup;
SET GLOBAL slow_query_log = 'ON';

General log

USE mysql;
SET GLOBAL general_log = 'OFF';
DROP TABLE IF EXISTS general_log2;
CREATE TABLE general_log2 LIKE general_log;
RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log;
gzip /var/db/mysql/mysql/general_log_backup.CSV 
DROP TABLE  general_log_backup;

What we did is create new log table, move current log file to a backup copy and compress the backup and remove it.

Password protect phpMyAdmin through CentOS Web panel(CWP)

phpMyAdmin is installed with CentOS Web Panel. By default, it is not protected and there is only MySQL user authentication. This can put your server vulnerable. So it is recommended to add additional layer protection.

phpMyAdmin is available through the following url in a CWP based server.

http:/hostname/phpmyadmin
http:/hostname:2030/pma

CWP panel runs its core services through its own version of Nginx. So normal htaccess based password protection will not work.

Create the Password File

You can do this by using the OpenSSL utilities that may already be available on your server. Alternatively, you can use the purpose-made htpasswd utility included in the apache2-utils package(Debian/ubuntu) or httpd-tools(Redhat/Centos).

Using OpenSSL Utilities

We will create a hidden file called .pma_pass /usr/local/cwpsrv/var/services/ folder. You can use any username. I am using dbadmin here as an example

sudo sh -c "echo -n 'dbadmin:' >> /usr/local/cwpsrv/var/services/.pma_pass"

Next, add an encrypted password entry for the username by typing:

sudo sh -c "openssl passwd -apr1 >> /usr/local/cwpsrv/var/services/.pma_pass"

Using Apache Utilities

This tool is already installed and available on all CWP servers.

/usr/local/apache/bin/htpasswd -c /usr/local/cwpsrv/var/services/.pma_pass dbadmin

Configure Nginx Password Authentication

We will need to configure Nginx to read this file before serving our protected content.
CWP Service Nginx configuration file: /usr/local/cwpsrv/conf/cwp_services.conf

Open the above file add the following to the location block of phpMyAdmin.

auth_basic “Admin Login”;
auth_basic_user_file /usr/local/cwpsrv/var/services/pma_pass;

So the full block should look like this now.

location /pma {
    root /usr/local/cwpsrv/var/services;
    index  index.html index.htm index.php;
    ModSecurityEnabled off;
    ModSecurityConfig /usr/local/cwpsrv/conf/security/conf/pma_rules.conf;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_read_timeout 600;
        fastcgi_pass    unix:/usr/local/cwp/php71/var/sockets/cwpsvc.sock;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME   $fastcgi_script_name;
        include                 fastcgi_params;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        access_log    off;
        log_not_found    off;
        expires 1M;
    }

       auth_basic "Admin Login";
       auth_basic_user_file /usr/local/cwpsrv/var/services/.pma_pass;
}

Restart CWP nginx service by below commands

systemctl restart cwpsrv.service

Confirm the Password Authentication

To confirm that your content is protected, try to access your restricted content in a web browser. You should be presented with a username and password prompt

How to block Outgoing Port 25 for all VPS/Containers of SolusVM

How to block Outgoing Port 25 for all VPS/Containers of SolusVM(Both OpenVZ/KVM)

Sometimes,when providing VPS service, it is necessary to block mailing service for VPS. Otherwise your IP ranges will be blocked by RBLs and other common mail providers like Gmail, Hotmail, AOL, etc. It is recommended to open ports by case by case for your customers, after establishing trust with your client.

Normally we block the port using the “OUTPUT” chain. However, SolusVM uses the chain “FORWARD” for routing traffic from containers/VPSs.

So by adding following rules, you can block all outgoing mails ports completely for all VPSs.

iptables -I FORWARD -d 0.0.0.0/0 -p tcp -m tcp --dport 25 -j DROP
iptables -I FORWARD -d 0.0.0.0/0 -p tcp -m tcp --dport 465 -j DROP
iptables -I FORWARD -d 0.0.0.0/0 -p tcp -m tcp --dport 587 -j DROP

Then save the iptables by running

service iptables save

Install Ajenti V on Ubuntu 16.04 on Ubuntu 16.04

Install Ajenti v on Ubuntu 16.04

Ajenti is an open source, web-based control panel that can be used for a large variety of server management tasks. Optionally, an add-on package called Ajenti V allows you to manage multiple websites from the same control panel


Step 1: First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2: Installing Ajenti Control Panel.
wget -O- https://raw.github.com/ajenti/ajenti/1.x/scripts/install-ubuntu.sh | sudo sh

Step 3: Start the service:
systemctl start ajenti

Step4: Install Agenti hosting module + nginx+ mail+ftp

If you have Apache installed, but don’t use it, remove it first:
apt-get remove apache2

If you have Sendmail or Postfix installed, remove them too
apt-get remove sendmail postfix

Install Ajenti-v

apt-get install ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-php7.0-fpm php7.0-mysql

# If you need Python
apt-get install ajenti-v-python-gunicorn

# If you want FTP
apt-get install ajenti-v-ftp-pureftpd

# If you want mail
apt-get install ajenti-v-mail

# If you want POP support (for gmail etc.)
apt-get install courier-pop

Step 5: Restart All Services
systemctl restart nginx
systemctl restart php7.0-fpm
systemctl restart mysql
systemctl restart exim4
systemctl restart pure-ftpd
systemctl restart ajenti

Step 6: Accessing Anjeti control panel.

Anjeti will be available on HTTP port 8000 by default. Open your favourite browser and navigate to http://yourdomain.com:8000 or http://server-ip:8000 and enter default username “admin” or “root” and password is “admin”.

Change the password immediately to something secure.

How To Install PHP 7 On A cPanel/WHM Server With EasyApache 3

How To Install PHP 7 On A cPanel/WHM Server With EasyApache 3

Latest versions of cPanel come with EasyApache 4 which provides lots of new features like native support for multiple PHP versions, PHP 7 support, very fast, etc. So it is recommended to migrate to EasyApache 4. However, if you cannot migrate EasyApache 4 because of some reason (Example: Tomcat support), you will have to compile the PHP 7 manually from source.

To migrate to EasyApache for, just run the below command. cPanel will try to build a matching PHP setup using EasyApache 4.

/scripts/migrate_ea3_to_ea4 --run

If anything goes wrong during the upgrade process you can always go back with /scripts/migrate_ea3_to_ea4 –revert –run

Manually install PHP 7

Following steps are tested with cPanel 11.64.0.36 and CentOS 6.9 64 bit. The PHP handler should be suphp to get this working.

cd /usr/local/src/
wget http://php.net/distributions/php-7.0.22.tar.gz #Go to php.net site to find the latest version
tar xvf php-7.0.22.tar.gz

Build it.

 #./configure  --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=/usr/local/php70  --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysqli --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-xpm-dir=/usr --with-zlib --with-zlib-dir=/usr

You may add any additional parameters required. You can run ./configure --help to see all available options first.
Important: Do not forget to set the "--prefix=/usr/local/php70". Otherwise, your existing PHP installation will be lost.

 make
 make install

If everything is successful, the PHP binaries will be installed in "/usr/local/php70/bin/" directory.

Copy the default php.ini:

 cp -pr /usr/local/src/php-7.0.22/php.ini-production /usr/local/php70/lib/php.ini

Add pdo,opcache, other modules to php.ini file.

 echo "extension=pdo.so" >> /usr/local/php70/lib/php.ini
 echo "extension=pdo_mysql.so" >> /usr/local/php70/lib/php.ini
 echo "zend_extension=opcache.so" >> /usr/local/php70/lib/php.ini

Verify the installation

/usr/local/php70/bin/php -v
PHP 7.0.22 (cli) (built: Aug 5 2017 01:56:23) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22, Copyright (c) 1999-2017, by Zend Technologies

Now link our new PHP 7 installation with Apache web server

Generate the PHP config:

cat >  /usr/local/apache/conf/php70.conf << EOF
AddType application/x-httpd-php7 .php7 .php

    suPHP_AddHandler application/x-httpd-php7

EOF

Add new handler to suphp

Edit the /opt/suphp/etc/suphp.conf and add below code, at the end of the handlers list to enable PHP7 handler.

;Handler for php-scripts
#... existing handlers are here ... put yours below them
application/x-httpd-php7="php:/usr/local/php70/bin/php-cgi"

Now add our custom php config file to EasyApache list so that the changes will not be lost future EasyApache builds.

There are two options here. You can either go into WHM and edit the post_virtualhost_global.conf file from there or you just run: vi /usr/local/apache/conf/includes/post_virtualhost_global.conf. Add the line below in that file and you should be all done.

Include /usr/local/apache/conf/php70.conf

Now restart Apache

service httpd restart

Configure a website To Use This new PHP 7
Add following code to .htaccess file(/home/username/public_html/.htaccess)

AddType application/x-httpd-php7 .php7 .php

Page 3 of 7

Powered by WordPress & Theme by Anders Norén