用apache服务器的虚拟主机模块配置
vim /etc/httpd/conf/httpd.conf .--------------配置虚拟主机信息
<VirtualHost *:80>
1004 # ServerAdmin [email protected]
1005 # DocumentRoot /data/wordpress
#DirectoryIndex index.php
1006 # ServerName www.plblog.com
1007 # ErrorLog logs/plblog.comerror_log
1008 # CustomLog logs/plblog.comcom-access_log common
exit 退出
mkdir /data/wordpress -p
cd /data/wordpress/
vim index.php
测试 www.plblog.com,可返回PHP官方页面首页
授权用户管理: grant all on wordpress .* to '用户' @ '主机’identified by "密码"
flush privileges
记得把wordpress 放到站点目录中: mv wordpress /data/wordpress
接着 cd /data/wordpress/ mv wordpress/* ./
最后访问 www.plblog.com 查看效果
3.创建wp-config-sam.php文件(apache无权限创建,则要修改目录权限先)
chown apache.apache -R /data/wordpress
接着就可以在图形化界面编辑文件 ~/wordpress/wp-config-sample.php了