Installing Wordpress on CentOS 6

Source: Internet
Author: User
Tags mysql host vps filezilla install wordpress using git


1. Two ways to WordPress


First of all, you can go to the latest WordPress official website to see how many downloads wordpress. Example WordPress 3.9.1:



Http://cn.wordpress.org/wordpress-3.9-zh_CN.zip



First use the mkdir command to create a folder, here using WordPress, in this folder with wget to request WordPress, here with:








wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zipunzip  Wordpress-3.8-zh_cn.zip





Use unzip to unzip the zip file.



Then edit the wp-config-sample.php file. Major changes to database information.





nano wp-config-sample.php
/**Mysql database name*/
define(‘DB_NAME’, ‘wordpress’);
/**Mysql database username*/
define(‘DB_USER’, ‘root’);
/**Mysql database password*/
define(‘DB_PASSWORD’, ‘password’)
/**MySQL host (no need to change)*/
define(‘DB_HOST’, ‘localhost’);/

Database name We'll fill it in here first, because the database is not yet established. The username and password of the database are all in the previous step and are filled in here.






Remember CTRL + O when saving files. Choose a file name called wp-config.php.



Then copy all the files to the/var/www/html folder.



Use





CP-RF wordpress/*/var/www/html/  

This will make WordPress completed, but some students may be a little fear of command operation. Under Windows, you can use FileZilla software to upload local files to the VPS.





FileZilla in the file's site manager. Select New site, configure the interface protocol to select SFTP.












On the right is the Linux folder, on the left is your computer. Right-click a folder or file to upload it.



Selecting a folder on the right or a file can also be downloaded locally, like FTP.












Upload speed is probably just 40-50kb/s





2. Create a new database in MySQL




Mysql-u root-p





Enter MySQL by entering the above command, to enter password.



Use the following command to create a new database called WordPress.








Create DATABASE WordPress;





Through the two steps above. Visit the IP address, a brand new WordPress can be built. Visit the domain name of your register should be able to install WordPress.





3. Importing SQL files


If you go from a virtual host to a VPS, you import the SQL file. Be able to use the following command:




Mysql-uusername-ppassword Database name < database name. sql

Note the U and username. There is no space between P and password!













4.Wordpress Simple Setup
4.1 Upload file limit size changes


To try uploading an attachment in the background, you will find:



Maximum upload file size:2mb. Very painful. How to change it?



Use locate to search for php.ini file locations.




Locate-i php.ini

Then edit it:






Nano/etc/php.ini

In the Nano, you can search for text by Ctrl + W, search here, post_max_size and upload_max_filesize. Make them bigger, for example, I'll change to 64M.







4.2 Overriding URL Settings





WordPress In addition to the default URL format, the others need to support the URL again. The default is not supported. VPS can only be done by themselves, the virtual host is usually turned on by default.







Nano/etc/httpd/conf/httpd.conf

You need to edit the httpd.conf file. CTRL + W search for "/var/www/html" to find:





<directory "/var/www/html" >
...
# AllowOverride Controls What directives is placed in. htaccess files.
# It can be ' all ', ' None ', or any combination of the keywords:
# Options FileInfo authconfig Limit
#
AllowOverride None



put allowoverride None Change to allowoverride All





4.3 Install plugin, update need to enter FTP account




Nano/etc/httpd/conf/httpd.conf





This is mainly due to insufficient authority.



Edit this file in the same way. Find this:



User Apache



Group Apache



Change group to root. Of course it's risky, but it's the quickest ...



There is also a way to put all the files of WordPress the full rights to Apache this user.



All of the above three operations need to restart Apache to take effect.




sudo service httpd restart  


Using Git in 5.VPS


The ability to install git with the following commands is very easy




sudo yum install git





Do not know git classmate to search, here space is limited not in-depth, we talked about using wget to get the latest WordPress, in fact, the most convenient should be git, in the local windows to complete the full wordpress, install plug-ins. Your favorite theme, all push to GitHub or bitbucket, then clone the complete site in/var/www/html/. Later assume that there is an update, can also be submitted.



It's really cool to keep track of changes at the same time back.






1. References:





Installing WordPress on CentOS 6





Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.



Installing Wordpress on CentOS 6


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.