MAMP: where is localhost's index.html?

早过忘川 提交于 2021-01-29 02:40:58

问题


Where is MAMP's default index.html ("It works!") file installed?

My MAMP installation works fine for localhost:8888. However I am unable to find (on my machine) the index.html that is served when I type just "localhost".

I looked specifically in /opt/local/apache2/htdocs and in /Applications/MAMP/htdocs and changed the index.html files that I found there. However, localhost keeps displaying "It works!" and nothing else. I even renamed index.html but "It works!" is still displayed.

According to my httpd.conf file, document root is "/Applications/MAMP/htdocs".

SO, where is MAMP's default index.html file installed?


回答1:


When you point your browser to "localhost" you're seeing the response of OS X Apache Server (if running, that is). This "It works!" file resides in /Library/WebServer/Documents.

It's advisable to turn off OS X Apache Server and use MAMP's one instead. On OS X versions before 10.11 there's a preference in Sharing Options (Web Sharing) to turn it On/Off. On El Capitan you have to open a Terminal and write one of these:

sudo apachectl start
sudo apachectl stop
sudo apachectl restart

If you work with MAMP just put your projects in MAMP/htdocs and you'll be fine. You can access them thru "localhost:8888/your_project".

Hope it helps.



来源:https://stackoverflow.com/questions/20655966/mamp-where-is-localhosts-index-html

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