Install Apache+php5+mysql online under Ubuntu

Source: Internet
Author: User
Tags apache php php and mysql

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.