Overview
Recently bought a server, ready to build a personal blog, to continue to update their blog,
Environment
- Server operating system: CentOS 7.0
- Blog Deployment server: Apache
- Background language: PHP
- Database: MYSQL
- Front End frame: WordPress
Steps
First, install Apache
It's easy to install Apache simply by typing the following command on the terminal:
sudo means what to do with the root user, yum install is installed online, and then enter Yes to confirm the download installation.
We need to start the service after the installation is complete:
When the boot server completes, do not hurry down, you can enter the server's IP address directly in the browser, you should be able to see the Apache Welcome page.
This page was used to test the operation of the Apache HTTP server after it has been installed ... Wait a minute
If your IP address has been bound to the domain name, then enter your domain name in the browser can also be accessed, is not cool, it is so simple, we continue.
Second, the installation of MYSQL
Install MySQL, and start MySQL
sudo yum install mysql-server
sudo service mysqld start
Through the above command can install and start MySQL, install MySQL will ask you some simple configuration, enter enter and yes all the way down OK.
Third, the installation of PHP and related PHP components
Install PHP First
sudo yum install php php-mysql
Installing PHP-related components
Yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
I first installed these components, for later use, you want to know all the PHP components, you can use the following command to search:
Four, the boot default start Apache and Mysql services
You can choose to boot up Apache and Mysql using the following command:
sudo chkconfig http on
sudo chkconfig MySQL on
Test whether PHP is installed successfully
Create a info.php file:
sudo vim/var/www/html/info.php
Then enter I into edit mode and write the following PHP command in the file:
Then press ESC to enter command mode, press the Shift key and two times Z to exit the save file.
Enter the IP address/info.php in the browser, for example: 123.56.183.34/info.php carriage return, you can see the information of PHP.
Six, download WordPress
You can go to the https://wordpress.org/Web site, or through the following command to download:
wget Http://cn.wordpress.org/wordpress-3.9-zh_CN.zip
Seven, decompression
To extract files using unzip:
Unzip Wordpress-3.8-zh_cn.zip
VIII. Create a new database in Mysql
Enter the database through the command above and enter the password: password
And then create a database called WordPress.
Create DATABASE WordPress;
Ix. Modification of wp-content.php documents
Modify the wp-content.php file in the following form,
/** MySQL database name: WordPress * *
define (' db_name ', ' WordPress ');
/** MySQL Database user name: root*/
define (' Db_user ', ' root ');
/** MySQL Database password:p assword*/
define (' Db_password ', ' password ');
/** MySQL host (without modification)/
define (' db_host ', ' localhost ');
Copy the files to the/var/www/html directory.
CP-RF wordpress/*/var/www/html/
XI. Testing
Enter the server's IP in the browser to find your home page.