-1

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

Nickool
  • 133
  • 2
  • 8
  • Check your error log and post any relevant information as an edit to your answer and add the relevant portions of your server config. – user9517 Aug 06 '11 at 08:06
  • where is error log? – Nickool Aug 06 '11 at 08:07
  • You configured the error log location in the default-server.conf. If not, read the documentation. – mailq Aug 06 '11 at 08: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? – Nickool Aug 06 '11 at 08:13
  • I mean after re installation the changes will be removed am i right? – Nickool Aug 06 '11 at 08:14
  • NEVER `chmod` 777. Have a look at error_log. – quanta Aug 06 '11 at 08:15
  • where is error_log I serached it in /etc it is not there – Nickool Aug 06 '11 at 08:17
  • IN your `default-server.conf` FILE there is a line like `ErrorLog ${APACHE_LOG_DIR}/error.log`. At that location is the error log. – mailq Aug 06 '11 at 08:24
  • no such line I put the default-server.conf – Nickool Aug 06 '11 at 08:28
  • the thing that I changed and then again I uninstall it was the line override None that I changed it to override All but then when I tried vim /etc/apache2/default-server.conf in shell it wasn't successful and cause I didn't have knowledge to how to recover it I uninstall my apache and install it again – Nickool Aug 06 '11 at 08:36
  • Is it in `httpd.conf` then? – mailq Aug 06 '11 at 08:37
  • I found the error log from what you said it is on /var/log/apache2/error_log – Nickool Aug 06 '11 at 08:40
  • I found it it is a huge file it has many lines that tell this one:`[Fri Aug 05 21:24:37 2011] [error] [client ::1] Directory index forbidden by Options directive:` – Nickool Aug 06 '11 at 08:41
  • `directive:/srv/www/htdocs/didebansnort/` it is my file that I tried to browse it from browser – Nickool Aug 06 '11 at 08:48
  • This is not a file. This is a folder. You need an index.html in that folder. – mailq Aug 06 '11 at 08:50
  • I have index.html – Nickool Aug 06 '11 at 09:10
  • Can you `cd` to your `/srv/www/htdocs/didebansnort/` and type in `ls -lha` and paste that in your question? – gravyface Aug 06 '11 at 11:54
  • ok I updated up there – Nickool Aug 07 '11 at 06:04
  • I am sure that it is not from index pages cause I changed something it is now has error but I uninstalled the whole just apache2 etc/sysconfig the apache2 didn't changed when I uninstalled it that I moved it to trash and again uninstall and install it but no reslult I am so confused that what i have done to cause this issue – Nickool Aug 07 '11 at 06:15
  • in past times successfuly I tried them and the index pages was the same it is my reason – Nickool Aug 07 '11 at 06:16
  • To the people here that votted me down I think it was a good issue to understand about permissions,httpd.conf,server-default.conf and specially the attribiutes and the usage of them. – Nickool Aug 07 '11 at 07:00

3 Answers3

0

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.

mailq
  • 17,023
  • 2
  • 37
  • 69
0

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.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • I have index.html in /srv/www/htdocs/didebansnort – Nickool Aug 06 '11 at 09:12
  • and have it in /srv/www/htdocs too – Nickool Aug 06 '11 at 09:16
  • Problem Solved! In options I changed it to options All Thank you lian! – Nickool Aug 07 '11 at 06: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 – Nickool Aug 07 '11 at 06:37
  • @Negin: Read about DirectoryIndex and then see what yours is set to - be amazed. – user9517 Aug 07 '11 at 06:48
  • @lain:you are right well I am so newbie in configuring my server I wanted to install Cake PHP and for some problem I change override I'll study it it take many times to me to understand the whole of it.I'm happy to solve this problem! I was too angry! I decided to format the whole and install my open suse again!! thanks God! that I understood!!! – Nickool Aug 07 '11 at 06:57
-2

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?

mgorven
  • 30,615
  • 7
  • 79
  • 122
Peter
  • 1