配置服务器(Windows与Linux)
1.安装xampp
2.xampp/htdocs/新建站点文件夹 (命名www.xx.com)
3.在站点文件夹下新建index.php
4.配置服务器
(1.)windows:xmapp/apache/conf/extra/httpd-vhost.conf
linnx:xmappfiles/etc/extra/......conf
<VirtualHost 127.0.0.1:80> //修改为外网ip
ServerAdmin admin@mengchenghui.com
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/www.a.com" //修改
ServerName a.com //修改
#ErrorLog "logs/dummy-host2.example.com-error_log" //#符号屏蔽
#CustomLog "logs/dummy-host2.example.com-access_log" common //#符号屏蔽
</VirtualHost>s
(2.) windows:xmapp/apache/conf/httpd.conf
linnx:xmappfiles/etc/......conf
# Virtual hosts
Include etc/extra/httpd-vhosts.conf //取消#符号屏蔽功能
(3.) windows:C/system32/drivers/etc 或 搜索hosts 文件
添加网站ip 与指向域名
127.0.0.1 www.xx.com