静态站点
1.yum -y install httpd
2.systemctl start httpd
3.systemctl stop firewalld
4.mkdir /var/www/html/a.org //创建网站目录
5.vim /var/www/html/a.org/index.html
6.vim /etc/httpd/conf.d/a.org.conf //配置文件
7.
<VirtualHost *:80>
ServerName www.a.org
DocumentRoot /var/www/html/a.org
</VirtualHost>
<Directory “/b.org”>
Require all granted
</Directory> //斜体为未在默认配置目录下写入配置
8.http -t 测试
动态站点(WP)
1.yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd //安装LAMP
2.systemctl start httpd mariadb
3.
sed -ri ‘/^SELINUX=/cSELINUX=disabled’ /etc/selinux/config
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service //关闭防火墙
4.vim /etc/httpd/conf.d/wordpress.conf //配置虚拟主机文件
5.mkdir -p /webroot/wordpress
6.unzip wordpress-4.9.4-zh_CN.zip
7.cp -rf wordpress/* /webroot/wordpress/
8.chmod -R 777 /webroot/wordpress
9.mysql -uroot -p //数据库
10.vim /etc/hosts
192.168.142.134 www.wordpress.com //域名解析