Web Servers

Basics of all Basics – Relocate your Apache DocRoot

Sometimes, the exciting part in configuring a virtual software server (web or application) is the activity to understand how it works and how can you manipulate it the way you want.

For this post, I would like to give a basic how to on relocating (or pointing) your apache to scan a specific directory as its DocRoot directory. :)

The DocRoot directory – Every PHP developer must ‘ve known or ask regarding about this.

Did you ever wonder if you can customise your XAMPP/LAMP or MAMP to detect or interpret PHP files on a folder other than the docroot folder? Here is how!

Locate  httpd.conf file on the apache folder – This is where you can edit that settings!

1st) Go to the DocRoot line and change the location to your location

screenshot_1_20_13_9_29_pm

2nd) and Edit the directory <location> with your location then

screenshot_1_20_13_9_33_pm

3rd) restart!

Easy  easy easy right? Now you can put all your PHP apps there and run it smoothly by using: http://localhost <or whatever your host name is>:80 <or whatever your port is>/app <or whatever your app name is>

screenshot_1_20_13_9_35_pm

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button