We often learn how to build Linux servers! However, if you want to learn it just for the purpose of building it, there will be no strength. So as a newbie, you must be encouraged by some small successes. Next we will share with you how to build your own local wordpress on the basis of LAMP.
Environment:CentOS-6.5-x86_64,
Apache website Configuration
|
Httpd
|
MySQL database
|
Mysql Mysql-server
|
PHP
|
Php Php-mbstring character set encoding) Php-gd graphic authentication code) Connect php-mysql to MySQL database
|
Prerequisites
1) Here we also need to understand the requirements of our servers for wordpress.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911124006-0.png "title =" wp1.PNG "alt =" wKiom1LP55DzAivjAAAupM1cwW4966.png "/>
2) Here we use the yum online method to install the above software (do not leave php-mysql)
yum install -y httpd mysql mysql-server php php-mbstring php-gdphp-mysql
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911121T7-1.png "title =" wp16.PNG "alt =" wKiom1LP9JWh5GPtAADNmnVsY1A262.png "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911122502-2.png "title =" wp4.PNG "alt =" wKiom1LP6BOSCiLhAALcRD2dAbI635.png "/>
3) after the installation is complete, we need to configure the apache server.
vi etc/httpd/conf/httpd.conf
Here, our tips are: Input "/keyword" in the command mode of vi. here we need to modify the ServerName. Here, we will remove the comment in Step 6. in versions x, our domain name must be configured; otherwise, an error will be reported. The second modification is our DirectoryIndex so that our homepage is index. php; the third is to modify or add our character set UTF-8
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091112A09-3.png "title =" wp7.PNG "alt =" wKiom1LP6d-jgRH-AAMN61oJtjQ721.png "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911123264-4.png "title =" wp6.PNG "alt =" wKioL1LP6dOwWdU0AANTNy6XaPI862.png "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091112D48-5.png "title =" wp5.PNG "alt =" wKiom1LP6d-i0TBIAAMP7Leqpfg043.png "/>
4) Next, we will start our apache and MySQL services.
Service httpd start # enable apacheservice mysqld start # enable mysql
5) When we enable MySQL, we will be prompted to create a password for the root user.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091112C64-6.png "title =" wp9.PNG "alt =" wKioL1LP6uvSSOahAAMt_Y0HLa4606.png "/>
Next, we will add a password for the root user of our database.
========================================================== ========================================================== ==========
Ps: before adding a password, let's take a look at several basic database operation commands.
Service mysqld startservice mysqld stopservice mysqld restartservice mysqld status/* apache also has the corresponding command to enable it. To disable and restart our database, you only need to replace mysqld with our httpd */
The following is the command for configuring the mysql database:
Mysqladmin-u User password
========================================================== ========================================================== ==========
If we configure a root user
Mysqladmin-u root password liswind # After configuration, log on to mysql-u root-p with a password # Next, you will be prompted to enter the password
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091112O55-7.png "title =" wp10.PNG "alt =" wKiom1LP6xfTlvghAAJPRDDLFk8680.png "/>
6) The next step is to create a wordpress database (this operation is performed after logging into our database)
Create database wordpress; # create a database named "wordpress"; # view our database information show databases;
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091112GI-8.png "title =" wp11.PNG "alt =" wKiom1LP6_PxyM_tAAI0JmDxa7I100.png "/>
========================================================== ========================================================== ==========
PS: Delete the database here
Drop databse name
After the data is created, we need to modify our iptables so that we can access these ports.
vi etc/sysconfig/iptables
7) we allow the apache80 port and the database port 3306 on the rule.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911123L2-9.png "title =" wp12.PNG "alt =" wKioL1LP7SXhQdyKAAGNvrqJyTI594.png "/>
After modification, restart the iptables service.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911125A8-10.png "title =" wp13.PNG "alt =" wKiom1LP7VTCfup6AAEAZOtM9G8507.png "/>
========================================================== ========================================================== ==========
After it is enabled, we can check the running status of our services,
Service httpd status # query the httpd status
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911122C6-11.png "title =" wp8.PNG "alt =" wKioL1LP6rqgH3j-AAOIMqkwK8U009.png "/>
If this result is returned
In general, we want our httpd and mysqld services to be automatically enabled with the system, we can use the following command
chkconfig httpd onchkconifg mysqld on
========================================================== ========================================================== ==========
8) at this time, we will download the latest Chinese wordpress version from the wordpress official website and use WinSCP to transmit it to the/var/www/html directory. We need to open port 22 before using WinSCP)
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911121Q2-12.png "title =" wp14.PNG "alt =" wKiom1LP7iuTVIdBAABzE0TWuoI229.png "/>
Enter the/var/www/html directory to decompress wordpress (note that our directory is wordpress)
cd /var/www/htmltar -zxvf wordpress*.*
Then, go to the wordpress directory and perform the following operations:
cp wp-sample-config.php wp-config.phpvi wp-config.php
Modify the following data.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911122H7-13.png "title =" wp15.PNG "alt =" wKiom1LP8y7ibCLzAAHCrbDlem8422.png "/>
After the modification, restart the httpd service.
service httpd restart
(9) At this time, let's take a look at our ip address. Remember to make the configured host and server in another lan)
ifconfig -a
Here, my ip address is 192.168.1.178, so that we can access it through "http: // ip/wordpress ".
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/09111232c-14.png "title =" wp17.PNG "alt =" wKioL1LP922SOIluAAB6-7tG_yU384.png "/>
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/09111231W-15.png "title =" wp18.PNG "alt =" wKiom1LP9-6i9X-AAABns4vyHUo790.png "/>
This article is from the "and enjoy" blog, please be sure to keep this source http://skytina.blog.51cto.com/6834539/1350548