Use lamp to create a WordPress-based blog site from

Source: Internet
Author: User
Tags mysql host wordpress database

Reference:

http://blog.csdn.net/ck_boss/article/details/27866117

First, MySQL configuration1. Install MySQL
Yum Install Mysql-server
This step is ignored in CentOS, which is already installed by default.
2. Start MySQL
Service mysqld Start

3. Log in to MySQL

By default, the root user of MySQL does not have a password, and the password is created in the following way

Service mysqld Stopmysqld_safe--skip-grant-tables &mysql-uroot-p do not enter password directly enter >use mysql;> update user set Passwo Rd=password ("Newpass") where user= "root"; Change password to Newpassord > flush privileges; Update permissions > Quit quit service mysqld restartmysql-uroot-p

New Password entry


Second, Apache configuration

1. Download Apache RPM Package and install


or install it in a different way (recommend this method)

Http://www.cnblogs.com/rainisic/archive/2012/05/23/Linux_Apache2_4_Install.html

2. Start Apache

Start Apach with Apachectl

Apachectl start

Check if there is an Apache process

PS aux | grep httpd

If there is Apache process, then prove the success of the launch, the browser address bar input http://localhost Try it ~

3. Set Apache default boot

After successful startup, you can copy the Apachectl to/ETC/INIT.D and start as a service.

sudo cp/usr/local/apache2/bin/apachectl/etc/init.d/httpdsudo service httpd start


Third, PHP configuration

1. Install PHP

Yum Install Phpservice httpd restart

2. Create Inspection documents

CD  /var/www/html

Create a info.php with the following content:

<?phpphpinfo ();? >

To open a page using a browser:

localhost/info.php, you can see the following pages


3 . Install the MYQL component in PHP

[email protected] html]# Yum install php-mysql.x86_64

after the installation is complete, the above pages have a lot more MySQL related content.

4, installation phpMyAdmin

[email protected] html]# Yum install phpMyAdmin

phpMyAdmin can not be opened directly in the browser, need to build a shortcut

Ln-s/usr/share/phpmyadmin/var/www/html  

And then we can open the phpMyAdmin interface.

Http://localhost/phpmyadmin

Log in with your MySQL username and password


If you cannot access it at this time:

Forbidden

You don't have permission to access/phpmyadmin on this server.

Workaround:

Locate the vi/etc/httpd/conf.d/phpmyadmin.conf in the PhpMyAdmin folder

The following configuration can be seen in the file

<directory "C:/WAMP/APPS/PHPMYADMIN3.4.10.1/" >    Options Indexes followsymlinks multiviews    allowoverride all        Order deny,allowdeny from all to        127.0.0.1</directory>

Find Deny from all means prohibit all access, but allow access from 127.0.0.1

Then we'll delete allow from 127.0.0.1

and modify the Deny from all to allow from all

It means to allow access from all addresses

Then service httpd restart


Four, WordPress configuration

1. Create a database

mysql> CREATE DATABASE WordPress; Query OK, 1 row Affected (0.00 sec) mysql> Show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Test | | WordPress |+--------------------+4 rows in Set (0.00 sec)

2. Download and unzip the WordPress archive and edit the following files:

/home/jediael/setupfile/wordpress/wp-config-sample.php

Modify the following configuration

* * MySQL Settings-specific information from the host you are using * *///** WordPress database name */define (' db_name ', ' WordPress ');/** MySQL Database user name */define (' Db_use R ', ' root ');/** MySQL database password */define (' Db_password ', ' newpass ');/** MySQL host */define (' db_host ', ' localhost ');

and move to the/var/www/html directory:

[Email protected] html]# cp-rf/home/jediael/setupfile/wordpress/var/www/html

Use this address to configure:

http://localhost/wordpress/wp-admin/install.php

CP /var/www/html/wordpress/wp-config.php /var/www/html/

To access

User name, Password: j/l

Email: 139


Then click Create, then log in or do not log in can be


Get......


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.