Run WordPress on Ubuntu

Source: Internet
Author: User
Tags install wordpress
Help WordPress webmasters build a local Ubuntu-based testing environment. By the way, we recommend the super open-source Linux operating system Ubuntu to WP friends. this helps Ubuntu fans build a local Ubuntu + Apache2 + PHP5.1.6 + MySQL5.0.24a environment, so that they can do what you want to do. If you want to build a site, by the way, we recommend WordPress, an open-source super blog program. webmasters should have an experience in uploading files

Help WordPress webmasters build a local Ubuntu-based testing environment. By the way, we recommend the super open-source Linux operating system Ubuntu to WP friends.

This helps Ubuntu fans build a local Ubuntu + Apache2 + PHP5.1.6 + MySQL5.0.24a environment, so that they can do what you want to do. If you want to build a site, by the way, we recommend WordPress, an open-source super blog program.

Webmasters should have an experience that when you develop a website and upload files to the server, if you change the layout or add modules in the future, the changed content must be uploaded to the server again. A problem occurs here. How can I perform the test after the change? I can't always modify them. Can I upload them for testing? If you make any changes and the traffic on your site is good, it will surely scare innocent people and negatively affect the website image, the best solution is to build a testing environment for WordPress under Ubuntu locally, so that the above problems can be solved.

Let's get down to the point. Let's talk about how to run WordPress on Ubuntu:

[Ubuntu + Apache2 + PHP5.1.6 + MySQL5.0.24a]

Reference: NetworkAdvancedSerivce-UbuntuChina Wiki

1. Install Apache2 + PHP5 + MySQL

Sudo apt-get install apache2 libapache2-mod-security libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql phpmyadmin

2. Configure php. ini

Sudo gedit/etc/php5/apache2/php. ini

If the following sentence is not provided or commented out, add this sentence or cancel the semicolon ";"

Extension = mysql. so

3. Configure apache2.conf

Sudo gedit/etc/apache2/apache2.conf

Load the mod_rewrite module and add the following statement:

LoadModule rewrite_module/usr/lib/apache2/modules/mod_rewrite.so

Load the mod_deflate module and add the following statement:

LoadModule deflate_module/usr/lib/apache2/modules/mod_deflate.so

To add modules, remember that they are all in/usr/lib/apache2/modules.

Add a VM:

DocumentRoot/var/www/

Options FollowSymLinks

AllowOverride all

After installation, apache and mysql are automatically started.

You don't have to worry about optimization and security. You can configure the Server as needed. The key Server is yours only.

If you need to change the configuration in the future, just remember these commands.

Sudo/etc/init. d/apache2 restart # restart apache

Sudo gedit/etc/php5/apache2/php. ini # configure php. ini

Sudo gedit/etc/apache2/apache2.conf # configure apache2.conf

/Var/www/# home directory location

4. install WordPress

Finally, put the downloaded WordPress under the/var/www/directory and Use http: // localhost/wordpress/

You can also use http: // 127.0.0.1/wordpress/for normal installation.

The MySQL and local versions used in my space are 4.0/5.0, respectively,

So I set it in wp-shortdes/wp-db.php so it won't be garbled.

Find:

$ This-> dbh = @ mysql_connect ($ dbhost, $ dbuser, $ dbpassword );

Add:

$ This-> query ("set names 'utf8 ′");

The server is ready. Now you can use it to debug plug-ins, templates, and Rewrite.

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.