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

How to build WordPress blog under LAMP

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to build WordPress blog under LAMP, the article is very detailed, has a certain reference value, interested friends must read it!

WordPress is a blogging platform developed using PHP, where users can host their own blogs on servers that support PHP and MySQL databases.

1 Install LAMP

Use yum to install httpd, MariaDB, php, php-mysql, php-mysql is used to connect php and MariaDB databases.

[root@CentOS7 ~]# yum install httpd mariadb-server php php-mysql -y2 Create a new virtual host

(1) Add virtual host configuration file

[root@CentOS7 ~]# vim /etc/httpd/conf.d/vhost.confDocumentRoot "/var/www/wordpress"ServerName www.mywordpress.com"/var/www/wordpress">AllowOverride NoneRequire all granted

(2) Create the required directory

[root@CentOS7 ~]# mkdir /var/www/wordpress3 Create index.php file [root@CentOS7 ~]# vim /var/www/wordpress/index.php4 Check syntax and start httpd service

(1) Check the grammar

[root@CentOS7 ~]# httpd -tSyntax OK

(2) Start httpd service

[root@CentOS7 ~]# systemctl start httpd.service5 Test

Enter www.mywordpress.com in your browser

Free WordPress Blog with LAMP Free WordPress Blog with LAMP

You can see that the PHP default page has been successfully displayed, indicating that the test was successful.

6 Download wordpress archive, wordpress-4.7.4-en_CN.tar.gz

(1) Decompression

[root@CentOS7 ~]# tar -xf wordpress-4.7.4-zh_CN.tar.gz

(2) Copy the decompressed file (wordpress) to DocumentRoot (/var/www/wordpress/)

[root@CentOS7 ~]# cp -a wordpress /var/www/wordpress/7 Start MariaDB service [root@CentOS7 ~]# systemctl start mariadb8 Access wordpress via browser

Type http://www.example.com in your browser www.mywordpress.com/wordpress

Note: Configure DNS server resolution www.test.com to 192.168.29.100 or modify C:\Windows\Systeme32\drivers\etc\hosts file under windows to 192.168.29.100 www.test.com

Free WordPress Blog with LAMP Free WordPress Blog with LAMP

You can see that the wordpress page has been released. You can click "Start Now" to configure it, or you can manually modify the configuration file.

9 Modifying WordPress Profiles

(1) Go to WordPress directory (/var/www/wordpress/wordpress/)

[root@CentOS7 ~]# cd /var/www/wordpress/wordpress/

(2) Copy the cp wp-config-sample.php template file to wp-config.php and edit it.

[root@CentOS7 ~]# vim /var/www/wordpress/wordpress/wp-config.php// ** MySQL Settings-Details come from the host you are using **///** WordPress database name */define ('DB_NAME', ' wordpress');/** MySQL database username */define ('DB_USER', ' test1');/** MySQL database password */define ('DB_PASSWORD','123456');/** MySQL Host */define ('DB_HOST','localhost');10 Create database and user in database

1) Creating a database

MariaDB [(none)]> create database wordpress;Query OK, 1 row affected (0.00 sec)

(2) Creating users

MariaDB [(none)]> create user 'test1'@'localhost' identified by '123456';Query OK, 0 rows affected (0.00 sec)

(3) Authorizing users

MariaDB [(none)]> grant all on wordpress.* to 'test1'@'localhost';Query OK, 0 rows affected (0.01 sec)

11 Visit WordPress again

http://www.mywordpress.com/wordpress

Fill in the relevant information and you can visit the blog normally.

The above is "how to build WordPress blog under LAMP" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

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

Development

Wechat

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

12
Report