Before I start explaining on how we can change the root directory on Apache Server using MAMP, it’s important to remember that although MAMP was originally designed for Apple MAC systems, there is also a Windows version. I will be explaining how we can change the root directory on Apache server on both cases.
Dec 09, 2015 I'm talking about using the iPad Pro to replace my current MacBook Air. The only thing currently stopping that is that there are times when I need to do some local dev when I have no available network - usually whilst travelling. With the Air it's easy. Spin up MAMP do my work, commit the changes and push them when I have a connection. While MAMP PRO offers configuration options for the most common settings of Apache, MySQL and PHP, experienced users may want to fine-tune some of the lesser used options. Instead of directly editing config files such as http.conf, php.ini or my.cnf, MAMP PRO uses template files to allow for custom changes to your server environment.
- Easily test your MAMP PRO virtual hosts on your iPhone or iPad right in your LAN. No more router configuration needed. Testing your projects on iPhone or iPad is just one click away.
- Easily test your MAMP PRO virtual hosts on your iPhone or iPad right in your LAN. No more router configuration needed. Testing your projects on iPhone or iPad is just one click away. This app needs version 4 of MAMP PRO.
The examples below are for the standard versions of MAMP (free) and not the PRO versions (you have to pay after the trial period has expired).

If you don’t have MAMP yet you can get your free copy from http://www.mamp.info/en/.

MAMP on MAC (method 1)
- Open MAMP
- Select Preferences
- Select Apache
- You will be able to see the current location of your document root
- Click on the object next to the ‘Document Root:‘ text
- You will now have a new Finder window opened
- Select the new location for your document root and click on the ‘Select‘ button
- You have now setup the new document root location
- Select OK
- MAMP automatically stops and starts the Apache and MySQL servers

MAMP on MAC (method 2)
- Using Finder, select your HD device
- Go to Applications > MAMP > conf > apache
- Edit file httpd.conf
- Do a find on ‘DocumentRoot’
- Replace the current path of your DocumentRoot (e.g.: /Applications/MAMP/htdocs) by your new (e.g.: /WebServers).
- Do another find on ‘DocumentRoot’ until you get to the line that says “This should be changed to whatever you set DocumentRoot to.“
- Replace the path on DocumentRoot (e.g.: /Applications/MAMP/htdocs) by your new path (e.g.: /WebServers).
- Save the modified httpd.conf file
- Go to MAMP
- Select StopServers (if they are up and running)
- Once the Apache and MySQL servers are stopped, select Start Servers
MAMP on Windows (method 1)
In these instructions I will assume that you’ve installed MAMP on its default location (C:MAMP). If this is not the case, then you should replace ‘C:MAMP‘ in the instructions by your own MAMP location.
- Open MAMP
- Select Preferences
- Select Apache
- Click on ‘Select’
- Select where your new document root should be located
- Click on the ‘OK’ button
- Click on the ‘OK’ button
- MAMP automatically stops and starts the Apache and MySQL servers
Ipad Pro 10.5
MAMP on Windows (method 2)
- Using Windows Explorer, select drive C
- Go to C:MAMPconfapache
- Edit file httpd.conf
- Do a find on ‘DocumentRoot’
- Replace the current path of your DocumentRoot (e.g.: C:MAMPhtdocs) by your new path (e.g.: C:WebServers).
- Do another find on ‘DocumentRoot’ until you get to the line that says “This should be changed to whatever you set DocumentRoot to.“
- Replace the path on DocumentRoot (e.g.: C:MAMPhtdocs) by your new path (e.g.: C:WebServers).
- Save the modified httpd.conf file
- Go to MAMP
- Select Stop Servers (if they are up and running)
- Once the Apache and MySQL servers are stopped, select Start Servers
好,故事开始。以前就在想,在retina屏幕的iPad上看漫画该多爽。可是现在捧着iPad却发现看漫画很困难,自己电脑上下载了一堆漫画都是jpg图片,导入iBook也很麻烦。现在通过家里的iMac建立一个家庭漫画服务器,直接在线浏览速度快、体验好,而且还很方便。以后下载了漫画往目录里一扔,就可以拿起iPad看了。
需要工具:
- MAMP是Mac下出名的Apache – MySQL – PHP服务器套件。简单易用,傻瓜式启动停止。MAMP Pro是一个基于MAMP的更高级的管理GUI,MAMP免费,不过pro的需要花钱,如果有钱可以买Pro的GUI。
- PHPPI 一个php图片浏览程序, 用来管理漫画。
过程:
安装MAMP非常简单,解压后吧MAMP目录拖到Applications目录里即可。在MAMP里修改http服务器主目录到自己用户目录下得Sites目录。
建立一个/Users/用户名/Sites/Manga子目录,然后下载PHPPI解压到这里。然后把你的漫画放到这个目录下,结果如下图:
Manga Dir

然后启动MAMP服务器
如果没有问题,打开浏览器输入:

http://127.0.0.1/Manga/
如果可以看到类似下图,就说明成功了:
Manga Site
Ipad Pro 11
现在打开你的iPad从局域网访问这个站点吧:
Mamp Ipad Pro 2
未来值得改进的地方,目前PHPPI对移动设备的多触点支持还没有,今后可以增加一下。
