实验:以rpm包的方式安装LAMP,配置基于域名的虚拟机主机并部署PhpMyAdmin
1 安装httpd并配置基于域名的虚拟主机
1.1安装
yum install httpd
systemctl start httpd.service
1.2 配置基于域名的虚拟机主机实现
(1) 关闭防火墙和SELINUX
systemctl stop firewalld
systemctl disable firewalld
(2)建立虚拟主机的根目录和文件
mkdir /data/{a,b,c}site
echo asite > /data/asite/index.html
echo bsite > /data/bsite/index.html
echo csite > /data/csite/index.html
(3)创建虚拟主机的配置文件
vim /etc/httpd/conf.d/virtualhost.conf
<virtualhost *:80>
DocumentRoot "/data/asite"
servername www.a.com
<directory /data/asite>
Require all granted
</directory>
customlog /var/log/httpd/access_a.log testlog
</virtualhost>
<virtualhost *:80>
servername www.b.net
DocumentRoot "/dat