CentOS6.6 build the Wordpress open source blog platform

Source: Internet
Author: User
Tags php and mysql

CentOS6.6 build the Wordpress open source blog platform

A few days ago, I set up a blog platform with open source Wordpress on my CentOS 6 system, mainly for fun. I can also use this framework to graffiti a few times on my machine. The following are the main steps and problems encountered during the setup process.


1. Main steps to build Wordpress

1.

Check whether the environment requirements are met (refer to the official website)


If not, install or update PHP and Mysql first.

2.

To Wordpress (http://wordpress.org/unzip to the default path of the local Apache Http Server/var/www/html, I put all the content in the/var/www/html/blog/directory.

3.

Enable httpd and mysqld services on the local machine

[Plain] view plaincopy
  1. Servicehttpdstart
  2. Servicemysqldstart
Create a database and add a database user. At the same time, you must grant the user all permissions to operate the newly created database. This is achieved through the MySQL Workbench graphical interface.

4.

Open the/var/www/html/blog/wp-config-sample.php file with editing tools, and fill in the Database Name, database user, and password that you just created in the corresponding location, you only need to fill in the three on the line, and the file name to the wp-config.php, that is, remove-sample, the file location remains unchanged.

5.

Run the command as root on the terminal.

[Plain] view plaincopy
  1. Setsebool-Phttpd_enables_homedirs = 1
It is used to set the selinux permission, indicating that users are allowed to access the www folder through httpd. This permission is very important.

6.

Enter http: // localhost/blog/wp-admin/install. php In the browser to go To the Wordpress installation page. Enter the corresponding user and website information and complete the configuration process.

7.

Next, through http: // localhost/blog/wp-login.php to enter the new user login interface, through the user name and password you just set to complete the login, now you can manage your site, the management process is implemented through a graphical interface, which is very convenient. loading is slow during logon, partly because the site is loading Google APIs, which is unavailable to Google recently, however, the site will automatically select other alternatives, so be patient. Is the graphical management interface after login:

Ii. Problems and precautions when constructing Wordpress

1.
An individual user does not have the permission to access a folder under www?
Solution: Modify the user's selinux Configuration
[Plain] view plaincopy
  1. Setsebool-Phttpd_enables_homedirs = 1
The selinux settings of the server software determine the operations that users can perform on the local machine through network access, and the basic functions must be added by themselves. Therefore, pay attention to this attribute.

2.

The following problems occur when starting the httpd service:

Cause: extra spaces are added when the/etc/vsftpd. conf file is configured.
Solution: vim/etc/vsftpd. conf to remove unnecessary spaces in each line.

3.
Unable to locate WordPress content directory (wp-content )?
Before the last line of code in the configuration file wp-config.php (my/var/www/html/blog/wp-config.php), that is?> Add the following code:
[Php] view plaincopy
  1. If (is_admin ()){
  2. Add_filter ('filesystem _ method', create_function ('$ A', 'Return "direct ";'));
  3. Define ('fs _ CHMOD_DIR ', 0751 );
  4. }

4.

To enable the www Service on the local machine in a browser, You need to enable two services: httpd and mysqld, as shown above.


5.

An error occurred while upgrading Wordpress online?

Solution: Download the update package and manually upgrade the package. Because online upgrades involve reading and writing files on the server, you need to grant more permissions to FTP users, involving security issues. We recommend that you only update some theme packages or plug-ins online. You can manually update the system by downloading related software packages. When a permission problem occurs during online update of the topic package or plug-in, you need to modify the permissions of the wp-content folder. The simple method is as follows:

[Plain] view plaincopy
  1. Chmod-R777wp-content/

However, for higher security, we recommend that you try other better settings.

Ps: hosts file. As for the various problems encountered during the installation process, it is best to use Baidu. However, using the wisdom of everyone, standing on the shoulders of giants is certainly easier to solve the problem. Some of the above methods are for reference by netizens. Since there are already many such methods on the network, there is no reference.

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.