Home >System Tutorial >LINUX >The Free Way to Start a WordPress Blog – Build It With LAMP
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
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 -y2 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>(2) Create the required directory
[root@CentOS7 ~]# mkdir /var/www/wordpress3 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(); ?-->4 Check the syntax and start the httpd service (1) Check syntax
[root@CentOS7 ~]# httpd -t Syntax OK(2) Start httpd service
[root@CentOS7 ~]# systemctl start httpd.service5 Test
Enter www.mywordpress.com
in the browserYou 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(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 through the browser
Enter http://www.mywordpress.com/wordpress
in the browserNote: 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
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/(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');10 Create database and user in database (1)Create database
MariaDB [(none)]> create database wordpress; Query OK, 1 row affected (0.00 sec)(2)Create user
MariaDB [(none)]> create user 'test1'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.00 sec)(3) Authorize the user
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 access the blog normally.
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!