Build WordPress personal site under Linux

Source: Internet
Author: User
Tags mysql host php and mysql wordpress database wordpress version

WordPress is built on the lamp environment. Here is the CentOS 7 wordpress version required for PHP and MySQL. WordPress version 4.7.4 database mariadb-5.5.52, php-5.4.16

A combination of Lamp:linux+apache+mysql (MariaDB) +php.


You need to shut down iptables and SELinux before the environment is deployed, otherwise you will not be able to access it after you configure it.

~]# Iptables-f # #清空防火墙规则;

~]# Setenforce 0 # #临时关闭selinux, to permanently shut down SELinux needs to be changed in/etc/selinux/config.


Here, we install httpd through yum.

PHP php-mysql Mariadb-server

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

After installation, start httpd php mysqld here PHP is as a module here as long as the start httpd, MySQL can, it is best to start before using SS-TNL to see the httpd 80, MySQL 3306 port is not occupied otherwise it will lead to not start. Neither of the phones started here, so they started up two of them.

[Email protected] ~]# SS-TNL

State recv-q send-q Local address:port Peer addre Ss:port

LISTEN 0 128::: 111 :::*

LISTEN 0 128 *:111 *:*

LISTEN 0 128::: 22 :::*

LISTEN 0 128 *:22 *:*

LISTEN 0 128:: 1:631 :::*

LISTEN 0 100:: 1:25 :::*

]# systemctl Start httpd

Starting httpd: [OK]

]# SYSTEMCLT Start mariadb

Starting mysqld: [OK]

Configure httpd configuration file in/etc/httpd/conf/httpd.conf, here just change the documentroot path to the corresponding directory can be. Note It is best to back up the configuration file before you change it, just in case. Because the http2.4 security mechanism is denied by default, the need to add Require all granted allow all hosts access

]# Vim httpd.conf

DocumentRoot "/www/htdocs"

<directory "/www/htdocs" >

Require all granted

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

]# httpd-t

Syntax OK

Create a/www/htdocs directory

]# MKDIR/WWW/HTDOCS-PV

mkdir: The directory "/www" has been created

mkdir: The directory "/www/htdocs" has been created

Parameters:

-P: If the top-level directory to be set up is not yet established, the upper-level directory will be established;

-V: Prints a message for each directory created

Download the unpacked WordPress package and copy the extracted directories 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 the wp-config.php! You need to change these items in the name of the WordPress database. Other defaults are not modified. Then save the exit. You need to add the database and user name, password in 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 ');


/** The default text encoding when creating data tables */

Define (' Db_charset ', ' UTF8 ');


/** the database collation type. If you are unsure do not change */

Define (' db_collate ', ');


New additions to the database wpdb this library, Wpuser and WPPASSWD.

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


The Web page then installs and verifies that the installation is successful.

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/9A/3F/wKioL1lTW5TAfOioAAEvwLTF3fE437.png-wh_500x0-wm_ 3-wmp_4-s_2857851584.png "title=" Wp.png "alt=" Wkiol1ltw5tafoioaaevwltf3fe437.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/9A/3E/wKiom1lTW_Wzt47NAABZlshnqCI173.png-wh_500x0-wm_ 3-wmp_4-s_3450400222.png "title=" Wp1.png "alt=" Wkiom1ltw_wzt47naabzlshnqci173.png-wh_50 "/>

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/9A/3E/wKiom1lTXDHQ7ItcAAA3KoYXAeY027.jpg-wh_500x0-wm_ 3-wmp_4-s_3786076430.jpg "title=" wp2.jpg "alt=" Wkiom1ltxdhq7itcaaa3koyxaey027.jpg-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/9A/3F/wKiom1lTXH6x_3hMAADPtCPygGY400.jpg-wh_500x0-wm_ 3-wmp_4-s_203707463.jpg "title=" wp3.jpg "alt=" Wkiom1ltxh6x_3hmaadptcpyggy400.jpg-wh_50 "/>

To here the words of the deployment has been completed, but also smoothly into the WordPress management interface, which has any problems, I hope you help point out to thank!!

This article is from the "Luo" blog, make sure to keep this source http://dklwj.blog.51cto.com/9199080/1942730

Build WordPress personal site under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.