xampp下Apache虚拟站点配置
1、打开xampp下apache的虚拟主机选项。
编辑/opt/lampp/etc/httpd.conf
查找下面信息:
#Include etc/extra/httpd-vhosts.conf
去掉本行前面的注释,保存退出。
注意:启用httpd-vhosts模式后httpd-xampp模式就失效了
2、在终端运行“sudo vi /XAMPP/etc/httpd.conf”,打开Apche的配置文件
3、在httpd.conf中找到“#Include /XAMPP/etc/extra/httpd-vhosts.conf”,去掉前面的“#”,保存并退出。
3.重启Apache服务之后就开启了它的虚拟主机配置功能。
##xxxx.com <VirtualHost *:80> DocumentRoot /opt/lampp/htdocs/xxxx.com ServerName xxxx.com ServerAlias www.xxxx.com ErrorLog "| /opt/lampp/bin/rotatelogs /opt/lampp/logs/xxxx.com/%Y_%m_%d_error_log 100M" CustomLog "| /opt/lampp/bin/rotatelogs /opt/lampp/logs/xxxx.com/%Y_%m_%d_access_log 100M" common </VirtualHost>
Comments are currently closed.