{"id":2359,"date":"2019-10-05T13:52:30","date_gmt":"2019-10-05T13:52:30","guid":{"rendered":"https:\/\/ekozel.com\/?p=2359"},"modified":"2020-11-28T05:47:06","modified_gmt":"2020-11-28T10:47:06","slug":"install-ubuntu-18-4-apache2-php-7-3-and-mysql-5-6","status":"publish","type":"post","link":"https:\/\/ekozel.com\/2019\/10\/05\/install-ubuntu-18-4-apache2-php-7-3-and-mysql-5-6\/","title":{"rendered":"Install Ubuntu 18.4, Apache2, PHP 7.3 and Percona 5.7"},"content":{"rendered":"\n
Update system repositories<\/p>\n\n\n\n
Install Apache 2 with the apt command<\/p>\n\n\n\n Allow Apache on UFW and verify its status<\/p>\n\n\n\n Update system repositories<\/p>\n\n\n\n Install extensions through:<\/p>\n\n\n\n Adjust php.ini file<\/p>\n\n\n\n Restart Apache2 and PHP services<\/p>\n\n\n\n Test PHP7.3 and Apache2 install<\/p>\n\n\n\n Add the following line and save<\/p>\n\n\n\n Load web browser with localhost\/phpinfo.php<\/p>\n\n\n\n The following is ONLY for dev environment<\/em><\/strong><\/p>\n\n\n\n Add current user to group that owns \/var\/www\/html folder<\/p>\n\n\n\n sudo usermod -a -G GROUPNAME USERNAME<\/p>\n\n\n\n Reboot system<\/p>\n\n\n\n Change group permissions to rwx<\/p>\n\n\n\n sudo chmod -R g+rwx \/var\/ww\/html<\/p>\n\n\n\n Source: https:\/\/www.percona.com\/doc\/percona-server\/5.7\/installation\/apt_repo.html<\/a><\/p>\n\n\n\n Update max_allowed_packet in mysqld.cnf to 32M to prevent Mysql went away message when doing large imports like: “ERROR 2006 (HY000) at line XXXX: MySQL server has gone away”<\/p>\n\n\n\n Install PHPMyAdmin<\/p>\n\n\n\n Enable mod_rewrite<\/p>\n\n\n\n By default, Apache prohibits using an .htacess file to apply rewrite rules.<\/p>\n\n\n\n Add the following code between <VirtualHost *:80><\/p>\n\n\n\n sudo systemctl restart apache2<\/p>\n\n\n\n Create a .htaccess file in the web root folder<\/p>\n\n\n\n Add default WordPress .htaccess file contents:<\/p>\n\n\n\n <\/p>\n\n\n\n Source: https:\/\/vitux.com\/how-to-install-and-configure-apache-web-server-on-ubuntu\/<\/a><\/p>\n\n\n\n Source: https:\/\/www.cloudbooklet.com\/how-to-install-php-7-3-on-ubuntu-18-04\/<\/a><\/p>\n\n\n\nsudo apt update<\/code><\/p>\n\n\n\n
Install Apache 2<\/h2>\n\n\n\n
sudo apt install apache2<\/code><\/p>\n\n\n\n
sudo ufw allow 'Apache'<\/code><\/p>\n\n\n\n
Install PHP 7.3<\/h2>\n\n\n\n
sudo apt update
sudo apt upgrade<\/code><\/p>\n\n\n\nAdd PPA for PHP 7.3<\/h3>\n\n\n\n
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej\/php
sudo apt update<\/code><\/p>\n\n\n\nInstall PHP 7.3 for Apache<\/h3>\n\n\n\n
sudo apt install php7.3<\/code><\/p>\n\n\n\n
Install PHP 7.3 Extensions<\/h3>\n\n\n\n
sudo apt install php7.3-extension_name<\/code><\/p>\n\n\n\n
sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl<\/code><\/p>\n\n\n\n
sudo nano \/etc\/php\/7.3\/apache2\/php.ini<\/code><\/p>\n\n\n\n
upload_max_filesize = 100M
post_max_size = 48M
memory_limit = 512M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000<\/code><\/p>\n\n\n\nsudo systemctl restart apache2.service<\/code><\/p>\n\n\n\n
sudo nano \/var\/www\/html\/phpinfo.php<\/code><\/p>\n\n\n\n
<?php phpinfo( ); ?><\/code><\/p>\n\n\n\n
Install Persona 5.7<\/h2>\n\n\n\n
sudo nano \/etc\/mysql\/percona-server.conf.d\/mysqld.cnf<\/code><\/p>\n\n\n\n
[mysqld]\nmax_allowed_packet=32M<\/pre>\n\n\n\n
sudo service mysql restart<\/code><\/p>\n\n\n\n
sudo apt update && sudo apt install phpmyadmin<\/code><\/p>\n\n\n\n
For WordPress installation \/ <\/h2>\n\n\n\n
sudo a2enmod rewrite<\/code><\/p>\n\n\n\n
sudo systemctl restart apache2<\/code><\/p>\n\n\n\n
sudo nano \/etc\/apache2\/sites-available\/000-default.conf<\/code><\/p>\n\n\n\n
<Directory \/var\/www\/html>\n Options Indexes FollowSymLinks MultiViews\n AllowOverride All\n Require all granted\n <\/Directory><\/code><\/pre>\n\n\n\n
sudo nano \/var\/www\/html\/.htaccess<\/code><\/p>\n\n\n\n
# BEGIN WordPress\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php [L]\n<\/IfModule>\n# END WordPress<\/pre>\n\n\n\n
<\/h2>\n\n\n\n