xampp

mac中配置 xampp

下载 https://www.apachefriends.org/zh_cn/index.html
示例:
(1)把工程目录放到/Users/gzty1/p_workspace
(2)在/Applications/XAMPP/xamppfiles/etc/httpd.conf 尾部添加

<Directory "/Users/gzty1/p_workspace/mobile">
 Options Indexes FollowSymLinks ExecCGI Includes
 AllowOverride All
 Require all granted
</Directory>

(3)去掉 Include etc/extra/httpd-vhosts.conf 前面的#注释,引入 vhosts 虚拟主机配置文件。
(4)在/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf 尾部添加或者替换为

<VirtualHost *:80>
 DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
 ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/gzty1/p_workspace/mobile"
ServerName www.mytest.com
ServerAlias  mytest.com
</VirtualHost>

(5)sudo vi /etc/hosts 配置域名映射
127.0.0.1 local.com

(6)重启apache。

windows中配置

hosts文件位于C:\Windows\System32\drivers\etc。其它步骤同上

centos中配置Apache Web服务器
vim /etc/httpd/conf.d/ssl.conf

发表评论