LAMP, The website construction environment based on Linux/Apache/MySQL/PHP architecture is sufficient for general websites. If our website has a large number of visits or data processing, we can choose to use NGINX architecture environment such as LNMP. However, most websites use APACHE enough, and it is relatively simple to use.
The LAMP article or one click installation package has been shared with Lao Zuo on the network before, such as“ Complete configuration CentOS6 installation LAMP (Apache/MySQL/PHP) environment setup tutorial And Complete Debian7 configuration, LAMP (Apache/MySQL/PHP) environment, and station building "Yesterday, a netizen asked me to write an article on the LAMP of the Ubuntu environment. Because I don't often use Ubuntu, I found an article from overseas, translated and sorted it out, checked the integrity of the tutorial, and shared it.
First, reinstall the VPS host environment and upgrade components
Here, I install Ubuntu 14.04 by default, and then upgrade the components.
apt-get update; apt-get dist-upgrade -y --force-yes
Second, install the Apache WEB server environment
apt-get install apache2 apache2-bin apache2-data apache2-doc apache2-mpm-prefork apache2-utils
Modify the default homepage (/etc/apache2/mods enabled/dir. conf)
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Modify to
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
Then restart service apache2 restart

We can open the default IP address or the bound domain name. If we can see such a page/interface, it means that APACHE has been installed.
Third, start the pseudo static mod_rewrite component
a2enmod rewrite
service apache2 restart
Fourth, create user management and set up multiple websites
If we only need to create a website, it is simple. We only need to create files in the/var/www/html directory. If we need to create multiple websites, we need to create a website directory, and we also need to set up separate users to manage, which is safer.
adduser laozuo
Then we need to enter the password twice according to the prompt
Adding user `laozuo' ...
Adding new group `laozuo' (1000) ...
Adding new user `laozuo' (1000) with group `laozuo' ...
Creating home directory `/home/laozuo' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for laozuo
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
We need to create a folder for public_html to store website files and logs.
cd /home/laozuo
mkdir public_html logs
After creation, we need to set the permissions of the directory, otherwise we cannot upload files and edit.
chown www-data /home/laozuo/public_html /home/laozuo/logs
chmod 755 /home/laozuo
Let's not forget to replace the corresponding directory, because I used Laozuo to create all the files inside. We need to use the files corresponding to our own site to check.
Configure virtual host name
By default, Ubuntu 14.04 will be equipped with 000-default.conf HTTP and the default ssl.conf for HTTPS. For frequent use, we will modify and use the 000-default.conf directory available on the/etc/website. Before using, we must disable the 000-default.conf configuration.
a2dissite 000-default.conf
service apache2 reload
Change the 000-default.conf (/etc/apache2/sites available) file name to our domain name (replace laozuo.org to your domain name)
mv 000-default.conf laozuo.org.conf
Empty content
> laozuo.org.conf
Then we add the following content to the laozuo.org.conf file
<VirtualHost *:80>
ServerName laozuo.org
ServerAlias laozuo.org
ServerAdmin webmaster@laozuo.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes ExecCGI Includes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
After saving the file, we start a2ensite laozuo.org.conf
If it fails to start, we can check the log. The log file is in/var/log/apache2/error.log.
Fifth, install and set MySQL database
apt-get install mysql-server mysql-client
If the error "E: Unable to locate package mysql server" occurs, we need to check whether to execute apt get update to update the data source before this tutorial.

During the installation of the MYSQL database, you need to enter the MYSQL database ROOT password twice, and both times must be consistent. Then wait for the installation to complete.
VI. Installing and Setting the PHP Environment
apt-get install php5 php-pear php5-mysql php5-dev libapache2-mod-php5 php5-dev php5-curl php5-gd php5-imagick php5-mcrypt
After installation, we can also add a PHP document to the/var/www/html/info.php file, and then check whether it takes effect.

Seventh, install PHPMyAdmin
It is easy to manage the MYSQL database. We still need to install PHPMyAdmin to manage the database on the Web.
apt-get install phpmyadmin
When installing, we were asked to select version support.

We select APACHE2, and then enter to continue. An interface will also appear to continue. Then the MYSQL ROOT user password is displayed. We have set it before, and you can enter it twice.
To sum up, we can complete the installation of the LAMP website construction environment in the Ubuntu 14.04 environment through the above steps. Compared with the one click package, manual installation is more troublesome. Now the VPS host has plenty of memory. The novice webmaster still chooses the one button package or panel application. Manual installation is a waste of more than an hour.