一·安裝Apache HTTP服務
- yum -y install httpd
- yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
- service httpd start # 啟動服務
- chkconfig httpd on # 設置開機自啟動
默認監(jiān)聽端口為80和443
二. 安裝MYSQL數(shù)據(jù)庫
- yum -y install mysql mysql-server
- service mysqld start
- mysql_secure_installation
- mysql -uroot -p123
- create database wordpress;
- chkconfig mysqld on
[root@ossec-server ~]# yum install mysql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package mysql-server available.
Error: Nothing to do
會報錯原因是yum安裝庫里沒有直接可以用的安裝包帆赢,這時候就需要用到MariaDB了,MariaDB是
MySQL社區(qū)開發(fā)的分支弧蝇,也是一個增強型的替代品沽一。
- yum -y install mariadb-server mariadb mariadb-devel
- systemctl start mariadb # 啟動mariadb服務
- mysql_secure_installation # 剛安裝時root是沒有密碼的赐稽,所以為了安全要設置密碼
- mysql -uroot -p123
- systemctl enable mariadb == chkconfig mysqld on # 設置開機自啟動
默認監(jiān)聽端口為3306
三.安裝PHP語言環(huán)境
- yum -y install php php-mysql
- yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap # 安裝PHP常用模塊
- service httpd restart
- echo "<?php phpinfo();?>" > /var/www/html/phpinfo.php
四.安裝WordPress并配置mysql
tar -zxf wordpress-4.7.4-zh_CN.tar.gz
cd wordpress
cp wp-config-sample.php wp-config.phpvim wp-config.php
-
mkdir /var/www/html/wp-blog
mv * /var/www/html/www/html/wp-blogsitename:wordpress
user:luli
pwd:focp#cr%jYaq3AnHQ