1 Installing Apache
sudo apt-get install apache2 installation apache2
After the apache2 installation is complete, the boot file is/etc/init.d/apache2.
Sudo/etc/init.d/apache2 start Apache
Sudo/etc/init.d/apache2 stop off Apache
Sudo/etc/init.d/apache2 Restart Restart Apache
Apache2 configuration file in/etc/apache2/httpd.conf, the initial file is empty.
Apache2 default projects in the/VAR/WWW directory, projects developed later (such as the WordPress Panorama Web project for this).
Enter 127.0.0.1 in the browser if it works to show that Apache installation is complete.
2 Installing PHP5
sudo apt-get install php5 installation php5
If you want to view the PHP5 configuration file, use the following command:
sudo Find " php.ini "
3 Configuring apache+php
sudo Install LIBAPACHE2-MOD-PHP5
Configuration Complete Restart Apache:sudo/etc/init.d/apache2 restart
Test whether Apache and PHP are combined to complete:
① Create a new file under/var/www. index.php
② input in Browser: 127.0.0.1/index.php, if display index.php content indicates configuration complete
4 Installing MySQL
See blog: "Ubuntu simple online installation MySQL"
5 Install plugin lets Apache PHP support MySQL
sudo Install Libapache2-mod-auth-mysql
6 Installing Components connect PHP and MySQL
sudo Install Php5-mysql
This apache+php+mysql online installation is complete.
Migrating the company website via WordPress
Because the company's website has been completed, the task here is simply to migrate the site to another server, need two pieces of data: WordPress and database files
1 Unzip the WordPress file into the/var/www directory and modify the wp-config.php file
① will
Define (' Db_password ', ' XXXX ');
Modified to:
Define (' Db_password ', ' root ');
② will
Define (' Db_host ', ' 119.97.194.189 ');
Modified to:
Define (' Db_host ', ' 172.16.4.119 ');
2 Import the database files into the database and modify the IP addresses in each table (modify the 119.97.194.189 to 172.16.4.119)
Modification Method:
Update Table set Field=replace(field,'oldvalue','newvalue ');
To this, the company website configuration is complete.
(PS: By default, PHP allocates 128M of memory, if small, you can modify the php.ini file in the memory_limit=128m, will increase the value).
Install Apache+php5+mysql online under Ubuntu