AMPPS Virtualhost deosn't work

不羁岁月 提交于 2019-12-12 09:46:42

问题


  1. I update /etc/hosts and test the ping, the domain works;
  2. I use ampps admin tool to add domain, and verify the modification as the content below.
<VirtualHost 127.0.0.1:80>
<Directory "/www/companyname">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName local.companyname.com
ServerAlias local.companyname.com
ScriptAlias /cgi-bin/ "/www/companyname/cgi-bin/"
DocumentRoot "/www/companyname"
ErrorLog "/Applications/AMPPS/apache/logs/local.companyname.com.err"
CustomLog "/Applications/AMPPS/apache/logs/local.companyname.com.log" combined
</VirtualHost>

then I restart the AMPPS, but it still doesn't work. It would connect to the default 127.0.0.1 page not my '/www/companyname' page.


回答1:


The problem is due the default setting of AMPPS, you should create 'extra' folder under the AMPPS/conf folder, it is not the one under AMPPS/apache/extra, should be AMPPS/conf/extra.




回答2:


I had to add an "extra" folder directly beneath the Ampps directory.

Ampps/extra/

After that everything started working as expected.




回答3:


all you need is to add your virtual host to /etc/hosts file, eg:

127.0.0.1 example.com

unfortunately ampps doesn't make this

PS Don't forget to edit /etc/hosts as root user (eg sudo nano /etc/hosts)



来源:https://stackoverflow.com/questions/39679803/ampps-virtualhost-deosnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!