Where is the index.* file that is served as the MA

2019-07-19 04:25发布

I'm trying to understand how MAMP manages the Apache web server but I cannot find the index.* file that is being served as the MAMP start page.

The virtual hosts configuration, httpd-vhosts.conf, is not included and Applications/MAMP/htdocs contains only my own site so how/where is http://localhost/MAMP/?language=English configured? The preferences for my installation of MAMP show that the 'Start page URL' is /MAMP/, is that an alias for another directory?

2条回答
迷人小祖宗
2楼-- · 2019-07-19 04:57

Instead of MAMP/htdocs like you might expect, you will find all the "start page" stuff in MAMP/bin/mamp (e.g. the English language page is MAMP/bin/mamp/English/index.php).

This is due to the following line in MAMP/conf/apache/httpd.conf:

    Alias /MAMP "/Applications/MAMP/bin/mamp"



A Word of Caution

If you are using MAMP as a quick-and-easy web server (as many blogs recommend, since Apple annoyingly eliminated "Web Sharing" from the System Preferences), then these maintenance pages are available to everyone everywhere (thanks to the Allow from all you'll see in the config file near the alias). Everyone in the world can see your full php configuration and edit your database. The following aliases are also problematic.

    Alias /phpMyAdmin "/Applications/MAMP/bin/phpMyAdmin"
    Alias /SQLiteManager "/Applications/MAMP/bin/SQLiteManager"

You could try to lock down MAMP, but it's probably easier to just not use MAMP, since it is not intended to be used for live websites. As the MAMP website itself says:

MAMP was created primarily as a PHP development environment for Macintosh computer and should therefore not be used as Live Webserver for the Internet. In this case, we recommend that you use Mac OS X server with the provided Apache or a Linux server.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-07-19 05:05

Hi Goto Applications from finder open up the MAMP folder then open up htdocs

查看更多
登录 后发表回答