On the CentOS system, set up the full process record of the WordPress blog from scratch, centoswordpress. In the CentOS system, the full process of building a WordPress blog is recorded from scratch. centoswordpress overview recently bought a server and is ready to build a personal blog to continuously update its own 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.
Tips overview recently I bought a server and I am going to build my blog to continuously update my blog ,...