LAMP+wordpress 部署博客
软件安装
1 yum -y install httpd 2 yum -y install php 3 yum -y install php-mysql 4 yum -y install mariadb-server
编辑Web服务配置文件
vim /etc/httpd/conf/httpd.conf ServerName www.example.com:80 # 服务器有域名解析就填写 DirectoryIndex index.html index.php
不讨论防火墙的影响
1 systemctl stop firewalld
启动服务
systemctl restart httpd
systemctl restart mariadb
systemctl enable httpd
systemctl enable mariadb
创建应用数据库、用户并授权
>create database blog charset=utf8; >grant all on blog.* to aaa@localhost identified by '123456'; >flush privileges;
官网下载wordpress: https://wordpress.org/download/
将wordpress文件移动到http服务目录之下
cp -r wordpress /var/www/html/. cd /var/www/html/wordpress cp wp-config-sample.php wp-config.php
编辑wordpress配置文件
vim wp-config.php # 修改使用的本地数据库名 define('DB_NAME', 'blog'); # /** MySQL database username */ define('DB_USER', 'aaa'); # /** MySQL database password */ define('DB_PASSWORD', '123456'); # /** MySQL hostname */ define('DB_HOST', 'localhost'); # /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8');
访问博客网站
http://127.0.0.1/wordpress
http://192.168.198.128/wordpress