配置Apache的虚拟主机
时间:2023-10-17 23:07:02
环境:好的apache服务。页面可以通过浏览器访问。
1编译安装的apache安装目录//usr/local/apache
2 打开配置文件httpd.conf里面463行Include conf/extra/httpd-vhosts.conf去掉前面的注释。
然后打开配置虚拟主机的配置文件:
vi extra/httpd-vhosts.conf
DocumentRoot "/kk"
DirectoryIndex index.php index.html
ServerName bbs.xuchunfang.tk
Options None
Require all granted
AllowOverride All
3apachetl -t
重启apache服务,域名在本机hosts写下文件,打开命令行ping通域名表示本地分析正常,页面可以通过浏览器访问。