LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   fc7/apache - cannot access directories only "directory/index.php" (https://www.linuxquestions.org/questions/linux-server-73/fc7-apache-cannot-access-directories-only-directory-index-php-608097/)

debarros 12-20-2007 07:14 AM

fc7/apache - cannot access directories only "directory/index.php"
 
Hi,

I am have recently upgraded to FC7, and now, I cannot access any webpage inside my /var/www/html directories unless I specify the index file inside it.

For instance:


mydomain.com/mysite does not work, but if I do:

mydomain.com/mysite/index.php


I checked my /etc/http/conf file and it has a list of the expected index files under the directory index directive:

DirectoryIndex index.php index.html index.htm index.shtml index.cgi index.php3 index.pl

Any ideas, and/or suggestions?

Thanks,

MD.

David1357 12-20-2007 09:45 AM

Quote:

Originally Posted by debarros (Post 2996882)
DirectoryIndex index.php index.html index.htm index.shtml index.cgi index.php3 index.pl

I had to use this:
Code:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.htm index.html index.htmls index.php index.php3 index.phps \
                  default.htm default.html default.htmls default.php default.php3 default.phps
</IfModule>


debarros 12-20-2007 07:09 PM

Hi David,

I tried that... and the problem still remains...:scratch:

Any suggestions ?

debarros 12-21-2007 06:24 AM

One other thing I noticed... If I try to access the pages from the server itself, I do not need to specify the index.php, the directory its is resolved. So it seems that affects only accessing the server from another machines both inside and outside my network.

David1357 12-21-2007 09:42 AM

Quote:

Originally Posted by debarros (Post 2997981)
So it seems that affects only accessing the server from another machines both inside and outside my network.

What does your access log show?

jonespg 12-22-2007 03:43 AM

I was having a similar problem. In the top level directory /var/www/ the index html and php filenames were required and it wouldn't display stylesheets, colors or images, but directories below it did.

My discovery was I needed to call /var/www using localhost. Using the address 127.0.0.1 for some reason acted as described before.

debarros 12-23-2007 09:39 AM

76.97.196.144 - - [23/Dec/2007:10:32:11 -0500] "GET /jinzora2 HTTP/1.1" 301 302 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

76.97.196.144 - - [23/Dec/2007:10:32:44 -0500] "GET /jinzora2/lib/jinzora.js HTTP/1.1" 304 - "http://76.97.193.144:8080/jinzora2/index.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

Hi David, these are two entries from the log, in the first instance I get the failure. On the second one I add index.php to the URL and it goes through.

David1357 12-26-2007 01:53 PM

Quote:

Originally Posted by debarros (Post 2999677)
76.97.196.144 - - [23/Dec/2007:10:32:44 -0500] "GET /jinzora2/lib/jinzora.js HTTP/1.1" 304 - "http://76.97.193.144:8080/jinzora2/index.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"

If you are listening on 8080, you have to use "http://blah:8080/" syntax for all requests. The default port is 80.

prasanta 12-27-2007 06:46 AM

Quote:

If I try to access the pages from the server itself, I do not need to specify the index.php, the directory its is resolved. So it seems that
Iptables might be the culprit as you are unable to browse from other comps. Check whether iptables is running there?

--
Prasanta

debarros 12-27-2007 07:49 AM

Hi Prasanta,

iptables - or any other firewall - is NOT running on that machine.

David1357 12-27-2007 11:18 AM

Quote:

Originally Posted by debarros (Post 3002833)
iptables - or any other firewall - is NOT running on that machine.

Do you have virtual hosts setup in your httpd.conf file? From what you said about "127.0.0.1" not getting resolved to localhost, it sounds like something is broken.

What does your "Listen" line in "/etc/httpd/httpd.conf" say?

prasanta 12-27-2007 11:40 AM

Quote:

iptables - or any other firewall - is NOT running on that machine.
Just try telneting to the machine in that particular port from a different machine.

--
Prasanta

debarros 01-01-2008 04:28 PM

David,

As for the 8080 port, my ISP blocks the port 80 so I use a no-ip port service to the port 8080. Remember, the only issue is that the server does not resolve the index file automatically when I specify the directory. If I specicy the index file in it, the forwarding and the site works perfectly.

Also, in the http.conf file for the Listen directive I have:

Listen *:80
Listen *:1158
Listen *:8080

Thanks for all the help and ideas so far.

--MD.

debarros 01-13-2008 03:14 PM

Thanks for all the help. After some time I was able to figure it out myself.
I had the directive UseCanonicalName set to On, and this was causing Apache to use the value of the Server name to create directives. By setting it to off did the trick.

David1357 01-14-2008 06:39 AM

Quote:

Originally Posted by debarros (Post 3021246)
I had the directive UseCanonicalName set to On, and this was causing Apache to use the value of the Server name to create directives. By setting it to off did the trick.

I guess that was why "127.0.0.1" was not getting resolved properly.


All times are GMT -5. The time now is 05:14 AM.