Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

hello my server was running successful but I uninstall it and again I have installed it In YAST(Opensuse) as apache 2

the out put of it is now:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Fri Aug 5 21:19:30 2011
Apache/2.2.10 (Linux/SUSE) 

I changed the default-server.conf in /etc/apache2 and it wasn't successful and it was the reason that I uninstall and install it again

I changed override None to override All and cause it wasn't successful I decide to delete changes by uninstall and installiation

what can I do? I tried chmod 777 /srv/www/htdocs/myfile

to set permission

http://localhost

is telling me with output: Itworks!

Now then what is the problem?

linux-llby:~ # cd /srv/www/htdocs/didebansnort/
linux-llby:/srv/www/htdocs/didebansnort # ls -lha
total 64K
drwxr-xr-x 10 root root 4.0K Aug  6 19:22 .
drwxrwxrwx  8 root root 4.0K Aug  6 19:21 ..
drwxr-xr-x  2 root root 4.0K Aug  6 19:22 SQL
-rwxr--r--  1 root root  15K Aug  6 19:22 adminuser.php
drwxr-xr-x  9 root root 4.0K Aug  6 19:22 classes
drwxr-xr-x  3 root root 4.0K Aug  6 19:22 config
drwxr-xr-x  3 root root 4.0K Aug  6 19:21 core
drwxr-xr-x  3 root root 4.0K Aug  6 19:22 docs
drwxr-xr-x  3 root root 4.0K Aug  6 19:21 images
-rwxr--r--  1 root root 3.1K Aug  6 19:21 index.php
-rwxr--r--  1 root root 2.0K Aug  6 19:22 login.php
drwxr-xr-x 10 root root 4.0K Aug  6 19:22 src
drwxr-xr-x  9 root root 4.0K Aug  6 19:22 theme

content of httpd.conf:

Include /etc/apache2/ssl-global.conf

# forbid access to the entire filesystem by default
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var index.php

I changed the DirectoryIndex and insert the index.php too

share|improve this question
    
Check your error log and post any relevant information as an edit to your answer and add the relevant portions of your server config. –  Iain Aug 6 '11 at 8:06
    
where is error log? –  Nickparsa Aug 6 '11 at 8:07
    
You configured the error log location in the default-server.conf. If not, read the documentation. –  mailq Aug 6 '11 at 8:11
    
I have errors.conf did you mean it? well I changed default-server but I deleted the folder apache2 and again I installed it then what?would you please explain it? –  Nickparsa Aug 6 '11 at 8:13
    
I mean after re installation the changes will be removed am i right? –  Nickparsa Aug 6 '11 at 8:14

3 Answers 3

up vote 1 down vote accepted

The problem you are seeing is that you have

Options none

configured for /srv/www/htdocs and the directory does not contain a valid index file as configured by DirectoryIndex.

share|improve this answer
    
I have index.html in /srv/www/htdocs/didebansnort –  Nickparsa Aug 6 '11 at 9:12
    
and have it in /srv/www/htdocs too –  Nickparsa Aug 6 '11 at 9:16
    
Problem Solved! In options I changed it to options All Thank you lian! –  Nickparsa Aug 7 '11 at 6:34
    
It is so strange I again set the options to None and again I deleted index.php and restart the apache! it is crazy! again it is working! it shows me index.php successfully I don't know why! it was a problem:-SSSSSssss –  Nickparsa Aug 7 '11 at 6:37
    
@Negin: Read about DirectoryIndex and then see what yours is set to - be amazed. –  Iain Aug 7 '11 at 6:48

The error messages talks about a file called /srv/www/htdocs/index.html. Is it there? Readable? If not, then this is why you get the error above.

Edit:

And you need at least an index.html in every (sub-)folder.

share|improve this answer
    
no it tells me it works! in bold font –  Nickparsa Aug 6 '11 at 8:15
    
maliq I have this in didebansnort and in htdocs and the content is it works –  Nickparsa Aug 6 '11 at 9:15

Guys I've been having the same issue under Windows the way I solved it by changing the following line:

Deny from all

to:

Allow from all

and it works fine. However I am not sure is that posing some security problem?

share|improve this answer
    
You're trolling, right? Please tell us you're just trolling. –  HopelessN00b Oct 11 '12 at 16:34

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.