First, set the Host Name and IP address correctly to connect to the Internet.
1. Enter the following command to obtain the root permission:
Sudo su
2. Run the following command to install MySQL 5:
Aptitude install mysql-server mysql-client
During installation, you must set the MySQL database administrator password and enter the new password twice in a row.
3. install Apache 2
Aptitude install apache2
After the installation is complete, enter the vps ip address in the browser. If the installation is successful, It works is displayed!
The default www directory of Apache is/var/www. The main configuration file is/etc/apache2/apache2.conf. Other configuration files, such as/etc/apache2/mod-enabled, are stored in the Module Settings, the/etc/apache2/sites-enabled directory stores VM settings.
4. Run the following command to install PHP 5:
Aptitude install php5 libapache2-mod-php5
Restart Apache
/Etc/init. d/apache2 restart
5. Test whether PHP is successfully installed.
Use the vi editor to create a PHP File
Vi/var/www/env. php
Enter the following code and save it.
Copy codeThe Code is as follows: <? Php
Phpinfo ();
?>
Open a browser and request the php file from VPS, for example, http: // 192.168.100.100/env. php.
(Replace 192.168.100.100 with the IP address of VPS)
6. install other PHP 5 modules
Aptitude install php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode
Restart Apache
/Etc/init. d/apache2 restart
Open the phpinfo page (env. php) and check whether the component is installed successfully.
7. Install phpMyAdmin
PhpMyAdmin is a tool for managing MySQL databases through the web interface.
Enter the following command:
Aptitude install phpmyadmin
The following questions are asked during installation:
Web server to reconfigure automatically: <-- apache2
Whether to automatically configure the web server. Yes, select apache2.
Configure database for phpmyadmin with dbconfig-common? <-- No
Create a database for phpMyAdmin. No
After installation, you can open the tool in a browser to manage MySQL:
Http: // 192.168.100.100/phpmyadmin (replace 192.168.100.100 with the IP address of VPS)
Enter the login name root and the previously set Database Password to log on to the management database.