0

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.

shantanuo
  • 3,579
  • 8
  • 49
  • 66

2 Answers2

2

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

Source

Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
VembuTech
  • 36
  • 1
  • I have already tried that and it returned 41 results. I can not check all of them. – shantanuo Jan 10 '12 at 08:13
  • Welcome to Server Fault! [It would be preferable](http://meta.stackexchange.com/q/8259) 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 08:02
1

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.

hookenz
  • 14,472
  • 23
  • 88
  • 143