WordPress and Discuz

Source: Internet
Author: User
Tags install php php and mysql install wordpress wordpress database wordpress blog

httpd access to two kinds of resources, static resources and dynamic resources; static resources have our common picture, JSP, music, audio and so on, and dynamic resources refers to some need to be compiled code to implement the resource type, need the database MySQL or mariadb to assist the implementation, after running in the background, The result is returned to the user, the client sends the resource to the server, the Server core is accepted, and the resource is forwarded to httpd for processing, where httpd acts as a reverse proxy, and the resource is forwarded to MySQL through the CGI Universal Gateway Interface protocol. The PHP sub-process is compiled by httpd, and the result is returned to the client, and PHP is the Universal Server scripting language;

The configuration of the WordPress blog application under CentOS6.7:

① first need to configure the Httpd,mysql and PHP installation environment;

Install httpd;

In centos6.7 the MySQL version needs to install mysqld.server;

and install PHP, as well as PHP and MySQL operation between the bridge Php-mysql;

The installation of the above environment exists on the local CD-ROM;

Install using the Yum install PHP httpd php-mysql mysqld.server

② for httpd configuration, first build a virtual host, under/etc/httpd/conf.d/build vhosts-www2.conf

You only need to add documentroot and ServerName to the virtual host, and the virtual host can be accessed by all hosts by default;

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/A4/9F/wKioL1muf0-w4y_fAAAWMHL9uM0768.jpg-wh_500x0-wm_ 3-wmp_4-s_2081981035.jpg "title=" qq20170905184101.jpg "alt=" Wkiol1muf0-w4y_faaawmhl9um0768.jpg-wh_50 "/>

and create the corresponding Web page file under the path of the specified DocumentRoot, where the index.php file is created

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/05/EE/wKiom1muf9SDXALlAAAXh6jFMe4865.jpg-wh_500x0-wm_ 3-wmp_4-s_3326636990.jpg "title=" qq20170905184254.jpg "alt=" Wkiom1muf9sdxallaaaxh6jfme4865.jpg-wh_50 "/>

Used to detect the connectivity between PHP and MySQL;

Use HTTPD-T for httpd syntax detection, if there is no error, then proceed to the next step;


③ Configuring MySQL

Install WordPress This kind of blog system, need the database as support, so need to create a database, and to the database to create a separate user with any operation on the database, which requires us to give this user the ability to manipulate the WordPress database;

First, use MySQL command to enter MySQL interactive interface

Use the following command

Create a WPDB database

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/05/EE/wKiom1mugKyiGpkAAAAQWYZFmX0373.jpg-wh_500x0-wm_ 3-wmp_4-s_3736987547.jpg "title=" centos6word5.jpg "alt=" Wkiom1mugkyigpkaaaaqwyzfmx0373.jpg-wh_50 "/>

Create users and give them permission to operate

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/A4/9F/wKioL1mugLmQwkcnAAAapY-PVk8541.jpg-wh_500x0-wm_ 3-wmp_4-s_1537367169.jpg "title=" centos6word6.jpg "alt=" Wkiol1muglmqwkcnaaaapy-pvk8541.jpg-wh_50 "/>

Use the show client command to see whether to generate user rights, set up users, user passwords, and access host IP segments

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/A4/9F/wKioL1mugODSM_hKAABSGpXcMHY446.jpg-wh_500x0-wm_ 3-wmp_4-s_1042699530.jpg "title=" centos6word7.jpg "alt=" Wkiol1mugodsm_hkaabsgpxcmhy446.jpg-wh_50 "/>

④ Import WordPress Blog program, under the Windows environment, and use xftp transfer into the file root directory, that is, the DocumentRoot directory of the previous virtual host, and use the tar command to extract, download the 4.2 version of WordPress;

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/A4/9F/wKioL1mugZjSIRroAAB1a01G6dQ409.jpg-wh_500x0-wm_ 3-wmp_4-s_1458614377.jpg "title=" 67word.jpg "alt=" Wkiol1mugzjsirroaab1a01g6dq409.jpg-wh_50 "/>

In the unzipped WordPress file There is a wp-config-sample.php file to copy it

CP wp-config-sampe.php wp-config.php

And in the copied files to add wordpress database name, user name, user password, and the current host IP address;

Such as:

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/A4/9F/wKioL1mugsHR1VpGAAAqxE4aOUg792.jpg-wh_500x0-wm_ 3-wmp_4-s_2991310938.jpg "title=" qq20170905185553.jpg "alt=" Wkiol1mugshr1vpgaaaqxe4aoug792.jpg-wh_50 "/>

Using Service mysqld Restart

Service httpd Restart Restart services

By the end of this basic configuration, you can start the experiment;

Add the IP address of the current experimental host at the host file under Windows, as well as the mapped servername, so that you can use servername access in the Windows environment;

Implementation results:

View MySQL's connectivity to PHP

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/A4/9F/wKioL1mugy2hHeM7AADcyHInIa8794.jpg-wh_500x0-wm_ 3-wmp_4-s_2593331613.jpg "title=" centos6word8.jpg "alt=" Wkiol1mugy2hhem7aadcyhinia8794.jpg-wh_50 "/>

Access using the www.wujunqi2.com/wordpress

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/05/EE/wKiom1mug5uh9jTvAAB6WQTU2Kw313.jpg-wh_500x0-wm_ 3-wmp_4-s_1752542935.jpg "title=" centos6word1.jpg "alt=" Wkiom1mug5uh9jtvaab6wqtu2kw313.jpg-wh_50 "/>

Enter password

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/A4/9F/wKioL1mug4rT0DipAAAtiA2LdzQ437.jpg-wh_500x0-wm_ 3-wmp_4-s_3298590073.jpg "title=" centos6word2.jpg "alt=" Wkiol1mug4rt0dipaaatia2ldzq437.jpg-wh_50 "/>

Login success:

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/05/EE/wKiom1mug8agqCT6AABF8dWRWaA620.jpg-wh_500x0-wm_ 3-wmp_4-s_1937861867.jpg "title=" centos7word6.jpg "alt=" Wkiom1mug8agqct6aabf8dwrwaa620.jpg-wh_50 "/>


CentOS7 configuration WordPress:

Installation Environment:

The CentOS7 configuration is consistent with CentOS6, except that the MySQL system is mariadb

need to install mariadb.server;

Yum install httpd php mariadb.server php-mysql

In the httpd virtual configuration file, you need to set the access control of the site resources, because CentOS7 access by default is all not allowed to access;

Such as:

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/05/EE/wKiom1mukS7xdnMZAAAg9D6i6g8780.jpg-wh_500x0-wm_ 3-wmp_4-s_1863356417.jpg "title=" qq20170905195653.jpg "alt=" Wkiom1muks7xdnmzaaag9d6i6g8780.jpg-wh_50 "/>

The rest of the configuration is ibid.


CentOS6 Installing Discuz:

① First installation Environment

Yum install php php-mysql mysql-server httpd

② Building a httpd virtual host

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/A4/9F/wKioL1muf0-w4y_fAAAWMHL9uM0768.jpg-wh_500x0-wm_ 3-wmp_4-s_2081981035.jpg "title=" qq20170905184101.jpg "alt=" Wkiol1muf0-w4y_faaawmhl9um0768.jpg-wh_50 "/>

③ Create a database, provide database users for Discuz, and set user permissions;

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/A4/A2/wKioL1murO7zm_TmAAAQmX_TS9Y161.jpg-wh_500x0-wm_ 3-wmp_4-s_2149744688.jpg "title=" 6dis5.jpg "alt=" Wkiol1muro7zm_tmaaaqmx_ts9y161.jpg-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/A4/A2/wKioL1murPijbDbBAAAdFvvmoR0535.jpg-wh_500x0-wm_ 3-wmp_4-s_560058642.jpg "title=" 6dis6.jpg "alt=" Wkiol1murpijbdbbaaadfvvmor0535.jpg-wh_50 "/>

Restart Service:

Service mysqld Restart

Service httpd Restart


④ Download the Discuz application and import it into the file root directory;

Use unzip decompression to generate three files upload utility and Readme

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/A4/A2/wKioL1murUzDByoVAAAdnLp4Yek839.jpg-wh_500x0-wm_ 3-wmp_4-s_110599220.jpg "title=" 6dis3.jpg "alt=" Wkiol1muruzdbyovaaadnlp4yek839.jpg-wh_50 "/>

Access using a browser

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/A4/A2/wKioL1murZiQsQ6CAADUGI7CAvQ227.jpg-wh_500x0-wm_ 3-wmp_4-s_47476696.jpg "title=" 6dis1.jpg "alt=" Wkiol1murziqsq6caadugi7cavq227.jpg-wh_50 "/>

A file that does not exist in the directory requires that we give it 777 permissions:

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/A4/A2/wKioL1murUGiv7DrAAB0sbnv-IE724.jpg-wh_500x0-wm_ 3-wmp_4-s_922027084.jpg "title=" 6dis4.jpg "alt=" Wkiol1murugiv7draab0sbnv-ie724.jpg-wh_50 "/>

Once the permissions have been set, re-refresh the page to:

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A4/A2/wKioL1murc7SD8i7AABVuqlv6l0154.jpg-wh_500x0-wm_ 3-wmp_4-s_1085287493.jpg "title=" 6dis2.jpg "alt=" Wkiol1murc7sd8i7aabvuqlv6l0154.jpg-wh_50 "/>

Click Next to select the new installation

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/A4/A2/wKioL1murgmjpT3JAABba6Ck24Y628.jpg-wh_500x0-wm_ 3-wmp_4-s_1052917553.jpg "title=" qq20170905220029.jpg "alt=" Wkiol1murgmjpt3jaabba6ck24y628.jpg-wh_50 "/>

Configure the database, populate the database previously created on the command line, and database user information

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/05/F1/wKiom1murn_Tv1WXAACEZnqJdt8131.jpg-wh_500x0-wm_ 3-wmp_4-s_4281280399.jpg "title=" qq20170905220156.jpg "alt=" Wkiom1murn_tv1wxaaceznqjdt8131.jpg-wh_50 "/>


Click Next to proceed to the final stage of the installation, the installation results are as follows

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/A4/A2/wKioL1murnzxq_AUAADKD_YKtXg845.jpg-wh_500x0-wm_ 3-wmp_4-s_727528913.jpg "title=" 6dis8.jpg "alt=" Wkiol1murnzxq_auaadkd_yktxg845.jpg-wh_50 "/>


Configuration of CentOS7 under Discuz:

The configuration under CentOS7 is roughly the same as 6, unlike

CENTOS7 installation environment requires the installation of MySQL version mariadb.server

The/etc/httpd/conf.d/vhosts-www1.conf configuration file needs to be given its access scope, otherwise it cannot be accessed by default;

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/A4/A2/wKioL1musl3wwgeAAAAfVajkr6M343.jpg-wh_500x0-wm_ 3-wmp_4-s_368678130.jpg "title=" qq20170905221759.jpg "alt=" Wkiol1musl3wwgeaaaafvajkr6m343.jpg-wh_50 "/>

The rest of the configuration operation with CentOS6 indistinguishable;

WordPress and Discuz

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.