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