一·安装Apache HTTP服务
- yum -y install httpd
- yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
- service httpd start # 启动服务
- chkconfig httpd on # 设置开机自启动
默认监听端口为80和443
二. 安装MYSQL数据库
- 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社区开发的分支,也是一个增强型的替代品。
- 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 # 设置开机自启动
默认监听端口为3306
三.安装PHP语言环境
- 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.php -
vim wp-config.php
-
mkdir /var/www/html/wp-blog
mv * /var/www/html/www/html/wp-blogsitename:wordpress
user:luli
pwd:focp#cr%jYaq3AnHQ
网友评论