
LAMP (Basic) on Ubuntu 16.04. Short Essential Version
LAMP (Linux, Apache, MySQL, PHP)
The more detailed version of this LAMP (Basic) Installation on Ubuntu 16.04 Server can be found here…
Basic Server Configuration
Set root password
Enter sudo password, then new root password twice at each prompt
Update Ubuntu 16.04
Check and Edit Network Configuration
iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.1.255 gateway 192.168.1.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 8.8.4.4 dns-search search google-public-dns-a.google.com search
Restart Network Service
Log Into Root Terminal
Download, Install, and Setup Apache 2 Web server
Ensure Function
Browser: http://192.168.1.10
Create web site directories and set ownership and permissions
Create virtual host configuration file and configure web information for web site
mydomain.home.conf configuration information
<VirtualHost *:80> ServerAdmin user@legitemail.com ServerName web.mydomain.home ServerAlias www.mydomain.home DocumentRoot /var/www/mydomain.home/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Enable new virtual host
Disable Apache default site
Restart apache service
Test new virtual host. Create test index.html page
Copy html into the file
<html> <head> <title>Welcome to my domain home page !</title> </head> <body> <h1>Success! The mydomain.home virtual host is working!</h1> </body> </html>
Check function, with web browser navigate to http://192.168.1.10 and ensure that the new test page is displayed
Install and Configure MariaDB
Fire off secure installation and answer questions
Answers for Secure Installation Questions Enter current password for root (enter for none): -- (enter) Set root password? [Y/n] -- (y) New password: -- (desiredpassword) Re-enter new password: -- (desiredpassword) Remove anonymous users? [Y/n] -- (y) Disallow root login remotely? [Y/n] -- (y) Reload privilege tables now? [Y/n] -- (y)
Restart mariadb service
Ensure SQL service is functioning correctly
Install, Enable, and Test PHP 7
Enable Apache PHP Module
Test PHP by creating a phpinfo page
Copy the following code snippet into the page
## Use the following code snippet <?php phpinfo(); ?>
Ensure PHP is functioning.
Use browser to navigate to http://192.168.1.10/phpinfo.php
PHP Information and Configuration page should display
Finished
For a more detailed version, check out the detailed LAMP (Basic) Installation on Ubuntu 16.04 Server found here…
References
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04
Install LAMP on Ubuntu 16.04