What is the mac equivalent of “/etc/apache2/sites-available”?

蹲街弑〆低调 提交于 2019-11-30 18:19:48
Andrew Medico

It looks like /private/etc/apache2/other/ would be the approximately corresponding folder. /etc/apache2/httpd.conf contains a directive Include /private/etc/apache2/other/*.conf that includes all files in that folder, much like the sites-available folder common on Linux installations of Apache.

Run apachectl -S which is shorthand for apachectl -t -D DUMP_VHOSTS

According to the apachectl man file, this will show parsed settings (currently only vhost settings). Incidentally, it also checks your config file for errors.

Andrew's answer is correct. On my install, I additionally had to change

Order allow,deny
Deny from all

to

Order allow,deny
Allow from all

in /etc/apache2/httpd.conf.

The fact that you're getting a server at :8080 indicates that you may be running a different apache config from the base system install, such as MAMP; I don't believe that apache by default listens on :8080.

I had this problem too. It seems to occour because the default version of apache that is installed on osx over-rides other versions. to disable it go to "System Preferences > Sharing" and untick "web sharing".

good luck!

Please note that ServerRoot specifies where the subdirectories conf and logs can be found.

In my httpd.conf, it is set to /usr

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