A: build environment
1. Install Apache environment
Installing Apache Online
yum install httpd
Start Apache Service
service httpd start
Set boot from the start
chkconfig httpd on
If the installation is successful, then use the public network ip access Apache's interface will appear
2. Install mysql database
There are two method of installation is to install one kind is to install 5.7 version 5.6 version 5.6 version of the installation is relatively simple, version 5.7 for more stringent password requirements and prior releases, the password field is a field name password, 5.7 to release the authentication_string, 5.6 and 5.7, and therefore above the modified version of the password is not the same, the following two methods can be optionally installed a method
Note: Since the installation of the mirror is CentOS7, it is not as simple as directly online using the command yum install mysql-server mysql database at the time of installation, this will lead to a series of problems may arise later;
method one:
Install mysql community resources rpm package
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
Install mysql
yum -y install mysql-server
Note: You need to set a series of mysql configuration including passwords when you install mysql and so on, there is one thing to note is too simple mysql password after mysql version 5.7 can not be set
Set boot from the start
chkconfig mysqld on
startup mysql process
service mysqld start
configuration mysql (password, etc.)
Because we are here to install the 5.7 version of the above it is the default mysql generate a random password at this time we could not get the mysql mysql password is required to skip verification to change the password
1. First /etc/my.cof modify the file by adding a line skip-grant-tables represents the [mysqld] Skip password authentication
2. Restart the mysql service mysqld restart
3. This time can avoid password to log into the database mysql -u root -p
4. After mysql5.7 because of more stringent password authentication can not use too simple password or password less than eight this time we want to do something to set it to random passwords with a password that we want to use, but may be security reduce, on the issue of security not be described herein,
First set password strength allow simple password,
set global validate_password_policy=0;
Then set password allows any number of bits (mysql5.7 default minimum allowable eight)
set global validate_password_length=4;
After setting these we can change the password
update user set authentication_string = password('想设置的密码'), password_expired = 'N', password_last_changed = now() where user = 'root';
Change your password after
SET PASSWORD = PASSWORD ( 'want to set password'); (ps: here and password should be set above the same), if an error here, then it is the first exit and then re-entering the mysql /etc/my.cof file to add the skip start -grant-tables delete this line, the restart mysql, then after entering the password again performed mysql sET pASSWORD = pASSWORD ( 'want to set a password'); command
Method two: Install the lower version of mysql (5.6 and below)
<1> Install to install the rpm package with mysql5 series of community resources currently available version.
-Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm RPM
<2> then view the current resources available to install mysql:
. yum repolist Enabled | grep "mysql * -community. * "
<. 3> version installation Mysql5.6 manner directly yum
yum -y install mysql-community-serverAfter the installation is complete to enter the mysql configuration
Boot
<1> systemctl enable mysqld
start mysql process
<2> systemctl start mysqld
configuration mysql (set password)mysql_secure_installation
The main contents are as follows:
the Set root password [the Y-/ the n-] // set the root password (preferably set their own password, select the Y-)?
Anonymous the Users [the Y-/ the n-] // delete anonymous user (choose the Y-)?
Disallow root the Login remotely? [Y / n] // prohibit root user remote login (selected the n-)
the Remove test database and Access to IT? [Y / n] // delete the default test database (choose the Y-)
Reload the Tables Privilege now? [the Y-/ the n-] // whether to immediately apply the latest settings (option Y)
Create a database: After we installed mysql on it you can create a database using the wordpress
First enter mysql: mysql -u root -p
Create a database
create database wordpress;
drop out
exit;
3. Install PHP environment and components
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmyum install -y php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt
After the installation is complete, you can use the command php -v to check whether the installation environment
4. Installation wordpress
Download WordPress: wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zip
Software Installation Extract the zip of yum -y install zip unzip
Unzip WordPress: the unzip wordpress-3.9-zh_CN.zip
Wordpress copied to the web root directory
cp -rf wordpress /var/www/html/
In html directory permissions and change the folder owner as apache
chown -R apache:apache /var/www/html/wordpress
chmod -R 775 /var/www/html/wordpress
Create upload directory
mkdir -p /var/www/html/wordpress/wp-content/uploads
Change directory owner
chown -R apache:apache /var/www/html/wordpress/wp-content/uploads
important:
Modify apache main configuration file with wordpress profile will not change the former newspaper PHP is not running error, which does not change the error occurs when entering five minutes to create:
Enter the main configuration directory
cd /etc/httpd/conf
Modify the configuration file
vim httpd.conf
All of AllowOverride None None All modified to express open support to override all the virtual path modify, save and exit and restart apache after
service httpd restart
Wordpress wordpress modify the configuration file into the directory to find the wp-config.php file If you do not put this file wp-config-sample.php rename the file wp-config.php
Rename command: mv wp-config-samp.php wp-config.php
After editing the configuration file wordpress
vim wp-config.php
Locate the file contents mysql configuration information
define ( 'DB_NAME', 'your database name') The DB_NAME DB_USER DB_PASSWORD value corresponding to each of these three into the database name, user name (usually root), database password, the other can not change, then save and exit
5. Ali cloud security group is provided, into the release port 22,3306,80 direction.
Finally, visit your ip address /wordpress/wp-admin/install.php entered into after wordpress installation interface only need to follow him step by step procedure to do so can have a blog of your own!