Rapid establishment of WordPress website based on lamp

Time:2021-2-22

WordPress is a blog platform developed with PHP language. Users can set up their own website on the server supporting PHP and MySQL database.

Download from the official websiteWordPressIf the speed is slow, it can be downloaded locally and uploaded to the server through SCP. Unzip it through the unzip command. My lamp directory is/var/www/html/So unzip and store it in this directory.

Access in browserlamp.test.com/wordpress/wp-admin/setup-config.php, the following page appears to tell us to configure the database.

Rapid establishment of WordPress website based on lamp

View database statussystemctl status mysqld, showing that it is running.

Rapid establishment of WordPress website based on lamp

Log in to the database, create a new database and test the user who uses the database.

create database wordpress_test;
mysql> GRANT ALL ON wordpress_test.* TO 'tester'@'192.168.1.10' IDENTIFIED BY "A123bbcvoa$";

staywordpressDirectory to generate relevant database configuration files.

cp wp-config-sample.php wp-config.php

editwp-config.phpFile, fill in your own database information.

/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress_test' );

/** MySQL database username */
define( 'DB_USER', 'tester' );

/** MySQL database password */
define( 'DB_PASSWORD', 'A123bbcvoa$' );

/** MySQL hostname */
define( 'DB_HOST', '192.168.1.10' );

Restart Apache and visit againlamp.test.com/wordpress/wp-admin/setup-config.php, clickLet’s go!Button, if the following error prompt appears, adjust SELinux settings.

Rapid establishment of WordPress website based on lamp

Temporary shutdown, invalid after restart.

setenforce 0

Permanent shutdown, but there is a system security risk.

vim /etc/selinux/config
SELINUX=disabled

Set the Boolean value of each rule of SELinux policy flexibly to realize the normal operation of httpd.

getsebool -a | grep httpd | grep -v grep

Rapid establishment of WordPress website based on lamp

Set off to on.

setsebool -P  http_can_network_connect=1

Rapid establishment of WordPress website based on lamp

This time, I successfully enter the personal information setting page, and log in after registration.

Rapid establishment of WordPress website based on lamp

Click the appearance to make simple settings, and the personal home page is completed.

Rapid establishment of WordPress website based on lamp

This work adoptsCC agreementReprint must indicate the author and the link of this article