Home > System Tutorial > LINUX > The Free Way to Start a WordPress Blog – Build It With LAMP

The Free Way to Start a WordPress Blog – Build It With LAMP

WBOY
Release: 2024-01-02 12:00:00
forward
1240 people have browsed it
Introduction WordPress is a blog platform developed using PHP language. Users can set up their own website on a server that supports PHP and MySQL databases. You can also use WordPress as a content management system (CMS). WordPress is a personal blogging system that has gradually evolved into a content management system software. It is developed using PHP language and MySQL database. Users can use their blogs on servers that support PHP and MySQL databases.

Environment description:

Implementing LAMP (Linux + Apache + MariaDB + PHP) on the same host
CentOS 7.3, Apache 2.4.6, MariaDB 5.5.52, PHP 5.4.16

1 Install LAMP

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

[root@CentOS7 ~]# yum install httpd mariadb-server php php-mysql -y
Copy after login
2 Create a new virtual host (1) Add virtual host configuration file
[root@CentOS7 ~]# vim /etc/httpd/conf.d/vhost.conf

DocumentRoot "/var/www/wordpress"
ServerName www.mywordpress.com
<directory>
AllowOverride None
Require all granted
</directory>
Copy after login
(2) Create the required directory
[root@CentOS7 ~]# mkdir /var/www/wordpress
Copy after login
3 Create a new index.php file in the virtual host home directory /var/www/wordpress
[root@CentOS7 ~]# vim /var/www/wordpress/index.php
<!--?php phpinfo(); ?-->

Copy after login
4 Check the syntax and start the httpd service (1) Check syntax
[root@CentOS7 ~]# httpd -t
Syntax OK
Copy after login
(2) Start httpd service
[root@CentOS7 ~]# systemctl start httpd.service
Copy after login
5 Test

Enter www.mywordpress.com

in the browser

The Free Way to Start a WordPress Blog – Build It With LAMP

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

6 Download the wordpress compressed package, wordpress-4.7.4-zh_CN.tar.gz (1) Decompression
[root@CentOS7 ~]# tar -xf wordpress-4.7.4-zh_CN.tar.gz
Copy after login
(2) Copy the decompressed file (wordpress) to DocumentRoot (/var/www/wordpress/)
[root@CentOS7 ~]# cp -a wordpress /var/www/wordpress/
Copy after login
7 Start MariaDB service
[root@CentOS7 ~]# systemctl start mariadb
Copy after login
8 Access wordpress through the browser

Enter http://www.mywordpress.com/wordpress

in the browser

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

The Free Way to Start a WordPress Blog – Build It With LAMP

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

9 Modify wordpress configuration file (1) Enter the WordPress directory (/var/www/wordpress/wordpress/)
[root@CentOS7 ~]# cd /var/www/wordpress/wordpress/
Copy after login
(2) Copy the cp wp-config-sample.php template file to wp-config.php, and then edit
[root@CentOS7 ~]# vim /var/www/wordpress/wordpress/wp-config.php
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'test1');
/** MySQL数据库密码 */
define('DB_PASSWORD', '123456');
/** MySQL主机 */
define('DB_HOST', 'localhost');
Copy after login
10 Create database and user in database (1)Create database
MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)
Copy after login
(2)Create user
MariaDB [(none)]> create user 'test1'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
Copy after login
(3) Authorize the user
MariaDB [(none)]> grant all on wordpress.* to 'test1'@'localhost';
Query OK, 0 rows affected (0.01 sec)
Copy after login
11 Visit WordPress again

http://www.mywordpress.com/wordpress

The Free Way to Start a WordPress Blog – Build It With LAMP
Fill in the relevant information and you can access the blog normally.
The Free Way to Start a WordPress Blog – Build It With LAMP

The above is the detailed content of The Free Way to Start a WordPress Blog – Build It With LAMP. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template