LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-20-2007, 07:14 AM   #1
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Rep: Reputation: 0
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.
 
Old 12-20-2007, 09:45 AM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by debarros View Post
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>
 
Old 12-20-2007, 07:09 PM   #3
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi David,

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

Any suggestions ?
 
Old 12-21-2007, 06:24 AM   #4
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 12-21-2007, 09:42 AM   #5
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by debarros View Post
So it seems that affects only accessing the server from another machines both inside and outside my network.
What does your access log show?
 
Old 12-22-2007, 03:43 AM   #6
jonespg
LQ Newbie
 
Registered: Feb 2004
Location: Portland,OR
Distribution: xubuntu
Posts: 24

Rep: Reputation: 15
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.

Last edited by jonespg; 12-22-2007 at 03:54 AM.
 
Old 12-23-2007, 09:39 AM   #7
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 12-26-2007, 01:53 PM   #8
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by debarros View Post
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.
 
Old 12-27-2007, 06:46 AM   #9
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
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
 
Old 12-27-2007, 07:49 AM   #10
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Prasanta,

iptables - or any other firewall - is NOT running on that machine.
 
Old 12-27-2007, 11:18 AM   #11
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by debarros View Post
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?
 
Old 12-27-2007, 11:40 AM   #12
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
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
 
Old 01-01-2008, 04:28 PM   #13
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 01-13-2008, 03:14 PM   #14
debarros
LQ Newbie
 
Registered: Dec 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

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.
 
Old 01-14-2008, 06:39 AM   #15
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by debarros View Post
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.
 
  


Reply

Tags
apache, index



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files and sub-directories of a directory except the directories named ".abc" sri1025 Linux - General 2 08-24-2010 08:53 AM
"Forbidden / You don't have permission to access /~user/index.html on this server." honglin_8 Linux - Newbie 8 10-30-2007 08:41 AM
Apache "Forbidden 403" on index - default install flycast Linux - Server 8 04-02-2007 08:35 PM
LXer: <a href="http://blogs.zdnet.com/threatchaos/index.php?p=311">Why is Linux more secure than Windows?</a> LXer Syndicated Linux News 0 04-18-2006 02:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration