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

http://192.168.1.2/admin/index.php

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.

link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

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

Source

link|improve this answer
I have already tried that and it returned 41 results. I can not check all of them. – shantanuo Jan 10 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 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 at 8:02
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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