The full process record for building a WordPress blog from scratch on the CentOS system, centoswordpress

Source: Internet
Author: User
Tags mysql host wordpress blog

The full process record for building a WordPress blog from scratch on the CentOS system, centoswordpress

Overview

I recently bought a server to build a personal blog to continuously update my blog,

Environment

  • Server Operating System: CentOS 7.0
  • Blog Deployment Server: Apache
  • Background language: PHP
  • Database: MySql
  • Front-end framework: WordPress

Procedure

1. install Apache

Installing Apache is simple. You only need to enter the following command on the terminal:

sudo yum install httpd

Sudo indicates what operations are performed by the root user. yum install is an online installation. Then, enter yes to confirm the download and installation.

After installation, we need to start the service:

sudo service httpd start

After the server is started, do not worry about it. You can directly enter the ip address of the server in the browser. You should be able to see the welcome page of Apache.

This page is used to test the operation of the Apache HTTP server after it has been installed ......... And so on.

If your ip address has been bound to the domain name, you can enter your domain name in the browser to access it. Is it cool? That's just that simple. Let's continue.

Ii. Install MySql

Install MySql and start MySql

sudo yum install mysql-server sudo service mysqld start

Through the above command, you can install and start mysql. When installing mysql, you will be asked about some simple configurations. enter and yes.

3. install PHP and related PHP Components

Install PHP first

sudo yum install php php-mysql

Install PHP Components

yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

I have installed these components first. For future use, you can use the following command to search for all PHP components:

yum search php-

4. Start Apache and Mysql services by default.

Run the following command to start Apache and Mysql:

sudo chkconfig http onsudo chkconfig mysql on

5. Test whether PHP is successfully installed.

Create an info. php file:

sudo vim /var/www/html/info.php

Enter I to enter the editing mode and write the following PHP Command to the file:

<?phpphpinfo();?>

Press the esc key to enter the command mode. Press the Shift key and the z key twice to exit and save the file.

Enter the IP address/info. php In the browser, for example, 123.56.183.34/info. php, and press enter to view the PHP information.

6. Download WordPress

You can go to https://wordpress.org/, or download the following command:

wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zip

VII. Decompress

Use unzip to decompress the file:

unzip wordpress-3.8-zh_CN.zip

8. Create a database in Mysql

mysql -u root -p

Run the above command to enter the database, and then enter the password: password

Create a database called wordpress

create database wordpress;

9. Modify the wp-content.php File

Modify the wp-content.php file as follows,

/** MySQL Database NAME: wordpress */define ('db _ name', 'wordpress ');/** MySQL database username: root */define ('db _ user', 'root');/** MySQL Database password: PASSWORD */define ('db _ password', 'Password '); /** MySQL HOST (no need to modify) */define ('db _ host', 'localhost ');

10. copy the file to the/var/www/html directory

cp -rf wordpress/* /var/www/html/

11. Test

Enter the Server ip address in the browser to view your home page.

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.