Install WordPress (ii) installation Wordpress_linux in CentOS 6

Source: Internet
Author: User
Tags mysql host create database vps filezilla install wordpress

1. Two ways to get WordPress

First you can go to the official WordPress website to see the latest wordpress download address how much. For example, the wordpress 3.9.1 download address is:
Http://cn.wordpress.org/wordpress-3.9-zh_CN.zip

First use mkdir command to create a directory, here using WordPress, in the directory with wget to request WordPress download address, here with:

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

Use unzip to extract the zip file.
Then edit the wp-config-sample.php file, mainly modify the 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 (without modification) * * *
define (' db_host ', ' localhost ') ;

Database name let's just fill in a random one, because the database hasn't been established yet. The username and password for the database are all in the previous step, and this is filled in.
Remember CTRL + O when you save the file, select the file name wp-config.php.
Then copy all the files to the/var/www/html directory. Use

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

This will be completed WordPress, but some students may be a bit afraid of command operation, Windows can use FileZilla software, to the local files uploaded to the VPS. FileZilla in the file's site manager, select New site, configure the interface of the protocol select SFTP.

The right is the Linux directory, the left is your computer, right click on a directory or file can be uploaded. Select a directory or file on the right side can also be downloaded to the local, and FTP a bit like.

Upload speed is probably only 40-50kb/s

2. Create a new database in MySQL

Mysql-u root-p

Enter the command above to enter the MySQL, password.
Use the following command to create a new database called WordPress.

Create DATABASE WordPress;

Through the two steps above, access to the IP address, a new WordPress can be established. Visit your registered domain name should be able to install WordPress.

3. Import SQL files

If you are transferring from a virtual host to a VPS, you will need to import the SQL file. You can use the following command:

Mysql-u User name-p password database name < database name. sql

Note that there is no space between U and username, p and password!

4.Wordpress Simple Setup

4.1 Upload file size limit modification


To the background to try to upload an attachment, you will find:
Maximum upload file size:2mb. Very painful. How to modify?
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 words by CTRL + W, search here, post_max_size and upload_max_filesize, change them to bigger, like I'm 64M.
4.2 Overriding URL Settings

WordPress In addition to the default URL format, all the other needs URL to support. The default is not supported. VPS can only do their own, the virtual host is generally open by default.

Nano/etc/httpd/conf/httpd.conf

You need to edit the httpd.conf file. CTRL + W Search "/var/www/html" to find:
<directory "/var/www/html" >
...
# AllowOverride Controls What directives may is placed in. htaccess files.
# It can be ' all ', ' None ', or any combination of the keywords:
# Options FileInfo authconfig Limit
#
AllowOverride None
Change allowoverride None 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 permissions.
Also edit this file and find this:
User Apache
Group Apache
Change group to root. Of course it's risky, but it's the quickest ...
Another way is to put the ownership of all the files in WordPress to the Apache user.
All three of these operations need to restart Apache to take effect.

sudo service httpd restart

Use Git in 5.VPS
You can install git with the following command, very simple

sudo yum install git

Do not know git classmate to search, where the space is 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 build a complete WordPress, installed Plug-ins, their favorite theme, Push all the GitHub or BitBucket, then clone the complete site in/var/www/html/. If you have updates later, you can also submit them. It's really cool to back up and make it easy to see the change record.

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.