Install apache+mysql+php+wordpress Build Blog on CentOS

Source: Internet
Author: User
Tags install php wordpress database

1. Installing Apache

Enter this line to install Apache

sudo yum install httpd

And then start

sudo service httpd start

If you want to verify that the installation is successful, enter your server's IP address in the browser to access

An Apache test interface will appear, which means the installation is successful.

2. Install MySQL

Enter the following statement to install and run MySQL

sudo yum install mysql-serversudo service mysqld start

Open Security Settings initialization

sudo /usr/bin/mysql_secure_installation

Since just installed MySQL, no password, enter skip can

Enter current password for root (enter for none): OK, successfully used password, moving on...

Next, enter Y for each security setting

3. Install PHP

WordPress is written in PHP, requires PHP, the installation of PHP statements

sudo yum install php php-mysql
4. Install Wordpress4.1 download wordpress

Download WordPress to root directory and unzip it directly

4.2 Creating a WordPress database and users

Log in to MySQL

mysql -u root -p

Create a database with a new user and set a password

CREATE DATABASE wordpress;CREATE USER [email protected];SET PASSWORD FOR [email protected]= PASSWORD("password");

Add permissions to the database WordPress for users

GRANT ALL PRIVILEGES ON wordpress.* TO [email protected] IDENTIFIED BY 'password';

Refresh database Permissions and exit

FLUSH PRIVILEGES;exit
4.3 Configuring WordPress

Find wordpress/wp-config.php This file

Replace the database name, user name, and password

// ** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */define('DB_NAME', 'wordpress');/** MySQL database username */define('DB_USER', 'wordpressuser');/** MySQL database password */define('DB_PASSWORD', 'password');

Then upload the wordpress file to the server, then install a library of PHP, and finally restart Apache

sudo cp -r ~/wordpress/* /var/www/htmlsudo yum install php-gdsudo service httpd restart
4.4 Visit Blog

The last is to visit for example http://example.com/wp-admin/install.php to configure the blog

Install apache+mysql+php+wordpress Build Blog on CentOS

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.