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.
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/.
This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles. Jan 09, 2018 In the popup window, click the “Open Directory Utility” button and yet another window will open. In the “Directory Utility” window, click the lock at the bottom left again, and then enter your password (or use Touch ID). In the menu bar, open the “Edit” menu, and then click the “Enable Root User” command.
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
![Mac Mac](https://img.17qq.com/images/fgjdjfdpefz.jpeg)
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
By default Mac doesn’t show you the Root directory in Finder or Desktop. In this guide, I will show you how to access the root directory in Mac, there are several ways to do it. I will also tell you how to see the hidden directories in root directory.
Method 1: Show Macintosh HD in Finder and Desktop
In Mac, the root directory can also be referred as Macintosh HD as this will show you the root directory files and folders. By default you won’t find it in Finder and desktop as most of the users do not need to access the system files and folders. However you can change the settings in Finder Preferences to show it in Finder sidebar and as an icon on desktop.
To do this: Open Finder, go to Finder Preferences from the top finder menu and check the Hard disks option in General tab. This will show the Mac HD on Desktop.
To show the Mac HD in Finder sidebar: Open Finder, go to Finder Preferences from the top finder menu and go to Sidebar tab then check the Hard disks sub option listed under Devices. This will make the Macintosh Hd visible in finder sidebar. Flying kick mac os.
Note: Refer this guide to read this in detail along with the screenshots: Show Mac HD in Finder and Desktop.
Method 2: Go To Folder option in Finder
You may not know this but there is a Go to Folder option in Finder that opens up a dialog where you can type the path and it would open up the content of given path in Finder.
You can use this option to open the root directory, all you have to do this is type the/ in path field and click Go.
You can use this option to open the root directory, all you have to do this is type the
To open this, Open Finder, in the finder menu under Go tab select Go to Folder.
This will open up this dialog box. Type / and hit Go.
Method 3: Using command line
You can also access the root directory from command line. To do this: Open terminal: Press Command + Space , type terminal and hit return .
Type the following command in terminal and hit return
Note: There is a space between open and / .
Show hidden files and sub directories in root directory
Root_directory (asra31) Mac Os Download
By default the root directory will not show you the directories like
/usr
, /bin
, /etc
etc. To make them visible you need to show the hidden files.Root_directory (asra31) Mac Os X
Open terminal and type the following command and hit return.
Mac Os Mojave
Refer this guide to read about it in detail: Show/hide hidden files in Mac