Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I type 127.0.0.1 in address bar of browser, I get the following result:

Not Found

The requested URL / was not found on this server.

Apache/2.2.22 (Fedora) Server at 127.0.0.1 Port 80

What can cause this problem?

share|improve this question
4  
A misconfiguration. See your logs. –  Ignacio Vazquez-Abrams Mar 28 '12 at 18:20
    
@IgnacioVazquez-Abrams: This is in log: Directory index forbidden by Options directive: /var/www/html/. www and html directories have permission 755 –  hknik Mar 28 '12 at 18:30
1  
Well there you go then. –  Ignacio Vazquez-Abrams Mar 28 '12 at 18:35
3  
You could change the question title. It is pretty clear, from the result you quote, that you are able to access the HTTP server which is running on 127.0.0.1, port 80. –  njsg Mar 28 '12 at 18:56
add comment

2 Answers

up vote 7 down vote accepted

You are asking the server for /. The server, unlike the question title may suggest, is indeed accessible, and it tells you the URL was not found.

You get, in the logs, the error "Directory index forbidden by Options directive", for the filesystem directory which is — I suppose — being served as /.

You tried to check if the permissions are okay for the webserver to read the folder, but what the error message is saying is not "Unable to read directory ...", it is saying it cannot deliver a directory index as a response because that is currently not allowed under the current server configuration.

Either add a file under a name the server can serve as / (these are frequently index.html and the like) or change the server configuration to allow directory listing, depending on your goal...

share|improve this answer
add comment

As previously said, you're able to access localhost, you're just not able to get the directory listing. Either place an index.html file in the root directory or enable directory listing. To enabled Directory Listing:

$ sudo vi /etc/httpd/conf/httpd.conf

Look for:

<Directory />
</Directory>

Edit it to look like:

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

Save the configuration (escape character: wq!)

Then you'll need to restart apache:

$ sudo /etc/init.d/httpd restart

You should now see a directory listing when connecting 127.0.0.1 on port 80.

share|improve this answer
add comment

Your Answer

 
discard

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.