.安装apache、php、php库
yum -y install httpd php php-mbstring php-pear
2.修改php配置文件地区
vim /etc/php.ini
在878行左右
date.timezone = "Asia/Shanghai"
3.启动apache
systemctl restart httpd systemctl enable httpd
4.安装mariadb
yum -y install mariadb-server
5.修改mariadb配置文件
vim /etc/my.cnf
添加于[mysqld]下
character-set-server=utf8
6.启动mariadb
systemctl start mariadb systemctl enable mariadb
7.安装配置mysql及mysql root密码
mysql_secure_installation
回车,输入两次root密码,全选y 8.登录mysql
mysql -u root -p
输入刚才设置的密码即可登录 9.创建数据库
create database 数据库名; grant all privileges on 数据库用户名.* to 数据库用户名@'localhost' identified by '密码'; flush privileges; exit
10.下载wordpress
wget https://cn.wordpress.org/wordpress-4.4.2-zh_CN.tar.gz
11.解压wordpress
tar -xzvf wordpress-4.4.2-zh_CN.tar.gz
12.复制wordpress至网站根目录/var/www/html/
cp -rf /root/wordpress/* /var/www/html/
13.安装php-mysql,并重启apache(此步骤应该可以在第一步时候一起安装)
yum install php-mysql systemctl restart httpd
14.赋予apache修改网站的权限,如安装插件是需要ftp账号密码着执行此命令
chown -R apache:apache /var/www/html/