安装XAMPP
下载xampp最新版FOR LINUX #wget http://nchc.dl.sourceforge.net/sourceforge/xampp/xampp-linux-1.7.1.tar.gz 安装: tar xvfz xampp-linux-1.7.1.tar.gz -C /opt 运行: /opt/lampp/lampp start 测试: http://ip或域名 |
一:配置多域名
# vi /opt/lampp/etc/httpd.conf |
找到
#Include etc/extra/httpd-vhosts.conf
修改成为:Include etc/extra/httpd-vhosts.conf (去掉前面的#号)
# vi /opt/lampp/etc/extra/httpd-vhosts.conf |
#虚拟主机VHOST文件
NameVirtualHost *:80
#默认站点
<VirtualHost *:80>
ServerAdmin [email protected] DocumentRoot /opt/lampp/htdocs/nowebserver
ServerName localhost
</VirtualHost>
# 主域名网站
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/lampp/htdocs/www.wbsz.com
ServerName www.wbsz.com
ServerAlias www.wbsz.com
</VirtualHost>
二:如何使用泛域名!
(首先你的主机要是独立IP或默认IP可以访问你的空间的)!
#主站(泛域名)标签:opt,xampp,虚拟主机,wbsz,域名,lampp,com From: https://blog.51cto.com/u_5112239/5833889
<VirtualHost *:80>
ServerAdmin [email protected] DocumentRoot /opt/lampp/htdocs/wbsz.com
ServerName www.wbsz.com
ServerAlias *.wbsz.com
</VirtualHost>