Instructions for Installing VestaCP on Ubuntu 18 to Run Laravel

VestaCP is a completely free Linux server management software. For those running Laravel, it's advisable to use VestaCP because it excellently supports PHP version 7.2, especially when installed on the Ubuntu 18.04 x64 environment.

Instructions for Installing VestaCP on Ubuntu 18 to Run Laravel

A great feature of VestaCP is that it allows you to choose the Webserver for your project (Nginx, Apache, or both). In this example, we will choose both as recommended on the official VestaCP website.

First, create a server running the Ubuntu 18.04x64 operating system, log in as root, and download VestaCP to your machine.

curl -O http://vestacp.com/pub/vst-install.sh

Then, run the following command combination:

bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot no --spamassassin no --clamav no --softaculous no --mysql yes --postgresql no --hostname yourserver.nencer.com --email [email protected] --password YOURPASSWORD

Wait about 15 minutes for the installation to complete, and you will be able to easily manage your server.

For some PHP source code (for example, Codeigniter) that requires the additional installation of the php-mcrypt extension for version 7.2. This can be challenging because PHP7 no longer supports mcrypt. However, you can still install it following the instructions below that I continue to use.

sudo apt-get install php7.2-dev
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libmcrypt-dev
sudo pecl install mcrypt-1.0.1
sudo bash -c "echo extension=/usr/lib/php/20170718/mcrypt.so > /etc/php/7.2/cli/conf.d/mcrypt.ini"
sudo bash -c "echo extension=/usr/lib/php/20170718/mcrypt.so > /etc/php/7.2/apache2/conf.d/mcrypt.ini"

Then, open the php.ini file and add the following line:

extension=mcrypt.so

Restart the webserver.