Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Build WordPress personal site under Linux

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

WordPress is based on the LAMP environment. What is used here is CentOS 7 wordpress, which has version requirements for php and mysql. Database mariadb-5.5.52, php-5.4.16 of wordpress version 4.7.4

The combination of LAMP:Linux+Apache+Mysql (MariaDB) + PHP.

You need to turn off iptables and selinux before deploying the environment, otherwise you will find that you cannot access it after you have configured it.

~] # iptables-F # # clear firewall rules

~] # setenforce 0 # # temporarily disable selinux. To permanently disable selinux, you need to change it in / etc/selinux/config.

Httpd is installed here through yum

Php php-mysql mariadb-server

# yum-y install httpd php php-mysql mariadb-server

Start httpd php mysqld after installation. Here, PHP is as a module. Just start httpd and mysql. It is best to use ss-tnl to check whether port 80 of httpd and port 3306 of mysql are occupied before startup, otherwise it will fail to start. Neither of the phones is activated here, just turn them on.

[root@xiong ~] # ss-tnl

State Recv-Q Send-Q Local Address:Port Peer Address:Port

LISTEN 0 128: 111: *

LISTEN 0 128 *: 111 *: *

LISTEN 0 128:: 22: *

LISTEN 0 128 *: 22 *: *

LISTEN 0 128:: 1 LISTEN:: *

LISTEN 0 100:: 1:25: *

] # systemctl start httpd

Starting httpd: [OK]

] # systemclt start mariadb

Starting mysqld: [OK]

The configuration file for configuring httpd is / etc/httpd/conf/httpd.conf. Here, you only need to change the path of DocumentRoot to the corresponding directory. Note that it is best to back up the configuration file before changing it, just in case. Because the security mechanism of http2.4 is denied by default, plus Require all granted allows all hosts to access.

] # vim httpd.conf

DocumentRoot "/ www/htdocs"

Require all granted

Use httpd-t to check if the httpd.conf has reported an error. The words here show OK.

] # httpd-t

Syntax OK

Create / www/htdocs directory

] # mkdir / www/htdocs-pv

Mkdir: directory "/ www" has been created

Mkdir: directory "/ www/htdocs" has been created

Parameters:

-p: if the upper directory of the directory to be created has not been created yet, the upper directory will be created as well

-v: print a message for each directory created

Download the unzipped wordpress package and copy the extracted directory to the / www/htdocs directory

] # unzip wordpress-4.7.4-zh_CN.zip

] # cp-a wordpress / www/htdocs/

Copy your own template and rename it to wp-config.php, and edit wp-config.php! You need to change these items in the name of the WordPress database. Do not modify other defaults. Then save the exit. Later, you need to add the corresponding database, user name and password to the database.

] # cp wp-config-sample.php wp-config.php

] # vim wp-config.php

/ * * name of WordPress database * /

Define ('DB_NAME',' wpdb')

/ * * MySQL database user name * /

Define ('DB_USER',' wpuser')

/ * * MySQL database password * /

Define ('DB_PASSWORD',' wppasswd')

/ * * MySQL host * /

Define ('DB_HOST',' localhost')

/ * default text encoding when creating a datasheet * /

Define ('DB_CHARSET',' utf8')

/ * * Database collation type. If you are not sure, do not change * /

Define ('DB_COLLATE',')

Add wpdb library, wpuser and wppasswd to the database.

MariaDB [(none)] > create database wpdb

MariaDB [(none)] > grant all on wpdb.* to 'wpuser'@'localhost' identified by' wppasswd'

MariaDB [(none)] > grant all on wpdb.* to 'wpuser'@'127.0.0.1' identified by' wppasswd'

MariaDB [(none)] > flush privileges

MariaDB [(none)] > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | test |

| | wpdb |

+-+

5 rows in set (0.00 sec)

MariaDB [(none)] > exit

Bye

Then use the web page to install and verify that the installation is successful.

If you come here, then the deployment has been completed, and you can successfully enter the wordpress management interface. If you have any problems, I hope you can help me to point out thank you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report