problem with apache2 server on Linux
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.
Related videos on Youtube
Nickool
Web Developer specializing in PHP, JavaScript, Ajax, JQuery and CSS3 with 3 years of experience creating and maintaining professional web applications. Experience developing technical specifications, documenting code and procedures. Effectively develop well structured, easily maintainable applications, web components, pages, style sheets.
Updated on September 18, 2022Comments
-
Nickool over 1 year
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
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
-
user9517 over 12 yearsCheck your error log and post any relevant information as an edit to your answer and add the relevant portions of your server config.
-
Nickool over 12 yearswhere is error log?
-
mailq over 12 yearsYou configured the error log location in the default-server.conf. If not, read the documentation.
-
Nickool over 12 yearsI 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 over 12 yearsI mean after re installation the changes will be removed am i right?
-
Nickool over 12 yearswhere is error_log I serached it in /etc it is not there
-
mailq over 12 yearsIN your
default-server.conf
FILE there is a line likeErrorLog ${APACHE_LOG_DIR}/error.log
. At that location is the error log. -
Nickool over 12 yearsno such line I put the default-server.conf
-
Nickool over 12 yearsthe 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
-
mailq over 12 yearsIs it in
httpd.conf
then? -
Nickool over 12 yearsI found the error log from what you said it is on /var/log/apache2/error_log
-
Nickool over 12 yearsI 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 over 12 years
directive:/srv/www/htdocs/didebansnort/
it is my file that I tried to browse it from browser -
Nickool over 12 yearsI have index.html
-
gravyface over 12 yearsCan you
cd
to your/srv/www/htdocs/didebansnort/
and type inls -lha
and paste that in your question? -
Nickool over 12 yearsok I updated up there
-
Nickool over 12 yearsI 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 over 12 yearsin past times successfuly I tried them and the index pages was the same it is my reason
-
Nickool over 12 yearsTo 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 over 12 yearsno it tells me it works! in bold font
-
Nickool over 12 yearsI have index.html in /srv/www/htdocs/didebansnort
-
Nickool over 12 yearsmaliq I have this in didebansnort and in htdocs and the content is it works
-
Nickool over 12 yearsand have it in /srv/www/htdocs too
-
Nickool over 12 yearsProblem Solved! In options I changed it to options All Thank you lian!
-
Nickool over 12 yearsIt 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
-
user9517 over 12 years@Negin: Read about DirectoryIndex and then see what yours is set to - be amazed.
-
Nickool over 12 years@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!!!
-
HopelessN00b over 11 yearsYou're trolling, right? Please tell us you're just trolling.