Carried from personal blog, original post link: Wordpress build reference
Written on 2018/4/16
The following is the text:
It’s been a few days since I set up the blog. I’ve only come to write this blog now. It’s only after I have a certain understanding. WordPress is still easy to use. You don’t need to touch anything about the webpage, just tie the server and the domain name together. , And then deploy WordPress into the server.
The first thing you need is a centos7 server to deploy. The server is recommended to choose a foreign one, because domestic servers basically need to be filed, and the filing process is very cumbersome. Here I use a bricklayer's VPS.
After having the server, we need to deploy the required environment on the server. First, use the root user to establish a dialogue with the host.
step:
1. Install Apache HTTP
Just enter the following command in the terminal.
yum install httpd
Next, wait for the installation. After installation, start the Apache service and type the following command:
systemctl start httpd.service
After the startup is complete, directly enter the server's ip address in the browser, and you should be able to see the Apache welcome page (TEST123...)
If the domain name has been bound, then the corresponding domain name should also be able to see the test page.
If the test page does not appear, it may be that port 80 of the server is not open. This problem does not occur with the mobile masonry server, please refer to the solution provided by the server provider.
2. Install MySql and create a new database
There is no Mysql in the yum source in CentOS 7, and its default database is MariaDB. Although there is no big difference between the two, I still use Musql here.
You can download and install it through the following command line:
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql mysql-server mysql-libs mysql-server
Set to boot
systemctl enable mysql.service
Restart service
systemctl restart mysql.service
Test the installation at this point. Type the following command line:
mysql -u root -p
There is no password by default, just press Enter.
If a welcome statement appears, the installation has been successful.
Create wordpress database:
create database wordpress;
This way the database is ready.
You can modify the database password, refer to the link:
https://blog.csdn.net/qq_35723367/article/details/79639970
Reference blog:
https://blog.csdn.net/qq_35723367/article/details/79639180
3. Start Apache and Mysql services by default
Type the following command line:
systemctl enable httpd.service
systemctl enable mysqld.service
In order to ensure that the service is available, it is best to restart both services here:
systemctl restart httpd.service
systemctl restart mysqld.service
4. Install PHP and related PHP components
Type the command:
yum install php
yum install php-mysql
yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
Currently only these plugins are needed. You can view all plugins by washing the following command:
yum search php-
5. Test whether PHP is installed successfully
Create an info.php file:
vim /var/www/html/info.php
Then enter i to enter the editing mode and write the following PHP commands in the file:
<?php
phpinfo();
?>
Esc, exit the edit mode, :wq save the modification and exit, enter the ip address /info.php in the browser, for example: 123.56.183.34/info.php and press Enter, you can see the PHP information.
If the browser displays the code just entered, restart the Apache service and try:
systemctl restart httpd.service
6. Install ftp
WordPress needs to access server files through a user, we create a new ftpuser user to borrow it.
First install the ftp service, type the command:
yum install vsftpd
Add FTP user:
useradd ftpuser
Set a password for ftpuser, during which there will be two prompts for password confirmation;
passwd ftpuser
Set the FTP service to start automatically after booting, and restart its service:
systemctl enable vsftpd.service
systemctl restart vsftpd.service
7. Download WordPress
You can go to https://wordpress.org/ official website to browse, or download through the following command:
wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zip
Use unzip to unzip the file:
unzip wordpress-3.8-zh_CN.zip
If there is no unzip, use the following command to download:
yum install unzip
After the installation is complete, execute the decompression command above.
8. Copy the file to the /var/www/html directory
cp -rf wordpress/* /var/www/html/
(Note: It is recommended to check the wp-conten-sample.php file of WordPress)
Note that it is best not to have other files under html, not to mention index.html, otherwise you will not be able to enter the WordPress configuration page.
Finally, enter your ip address in the browser, and you can see the WordPress configuration page.
Follow the prompts to complete the final configuration.
Host name: (fill in ip address)
FTP user name: xxx
FTP password: xxx
After it is built, file permissions may be involved. The easiest way is to change the permissions of the entire www directory to 777. Although this lacks security, it is not a big problem for personal blogs. Type the command:
chmod 777 /var/www/html
If it is invalid, please add -R parameter.
No other problems have been encountered so far, please contact me if you have other problems.
Full text reference blog:
https://blog.csdn.net/qq_35723367/article/details/79544001
https://blog.csdn.net/Metropolis_cn/article/details/71374594
The above was written in the early days of my blog, and the things involved may not be enough. I hope to get your corrections.
Since many other people’s things have been cited throughout the article, and some sorting has been carried out, it is also marked as reprinted, and the link is also mentioned in the original text.
In addition, I have moved my blog to the mainframe earlier this month.