Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can browse the company intranet site using the following URL.

How do I find the full path of the file "index.php"? I tried...

locate admin/index.php 

and it gave me a lot of results from different directories. What I need to do is to make some changes to index.php file.

I searched for httpd.conf and again I found several files in different locations.

share|improve this question
up vote 2 down vote accepted

Using grep -i 'DocumentRoot' <Location of your config file> you can find the DocumentRoot location.


share|improve this answer
I have already tried that and it returned 41 results. I can not check all of them. – shantanuo Jan 10 '12 at 8:13
Welcome to Server Fault! It would be preferable if you had originally included the essential parts of the answer here, and provided the link for reference. I have copied the most important part from the website you linked, but please bear this in mind for the future. – Ben Pilbrow Jan 10 '12 at 20:17
Sorry about that @BenPilbrow. shantanuo, Believe you are using linux and Apache2 in your machine, try to identify the location of Apache2 using "which apache" command. From the results, say "/usr/sbin/" is listed then run the following command "/usr/sbin/httpd2 -V". It will display the results where the httpd.conf file is located as '-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"'. – VembuTech Jan 11 '12 at 8:02

Since you're talking about httpd.conf I presume you're running apache.

By default the main httpd.conf file is /etc/apache2/httpd.conf or /etc/apache/httpd.conf

If you type locate httpd.conf you should get some results there.

Now if you locate that file open it up and look at it.

You should find either some includes and other paths or some virtual hosts. You might be lucky and see DocumentRoot in there. Often this is in another file but at least this file provides a starting point.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.