apache error 403 Opensuse 13.1

I install apache in my Opensuse 13.1 and I got this error, so I was trying to solve it, I did everything, I was looking for online and nobody have a real solution for this one. I format my HD install Opensuse again and install apache again from scratch and I got the same error, I am tired to be doing this if somebody can help me please I’ll be grateful. Access forbidden! You don’t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Apache/2.4.9 (Linux/SUSE)

Where did you install apache from?
openSUSE 13.1 comes with version 2.4.6…

Check the permissions of your DocumentRoot.
With the default configuration this would be /srv/www/htdocs/:

ls -la /srv/www/htdocs/

Apache runs as user “wwwrun:www”, so that user has to be able to access those files.

And please also post the last lines of /var/log/apache2/error_log.

On 2014-06-22 20:56, Dexter22 wrote:
>
> I install apache in my Opensuse 13.1 and I got this error, so I was
> trying to solve it, I did everything, I was looking for online and
> nobody have a real solution for this one. I format my HD install
> Opensuse again and install apache again from scratch and I got the same
> error, I am tired to be doing this if somebody can help me please I’ll
> be grateful. my email is : ...@hotmail.com

Please don’t.

First, replies are normally done here, in public. If necessary, there
are private messages via forum, without having to use email.

Second, you are exposing your own email to the entire Internet spam
crawlers. You should consider asking a moderator to edit your post and
remove the email.

If you need to exchange an email address, you can do it via PM, so that
it is not displayed here.

> Apache/2.4.9 (Linux/SUSE)

As to your problem, how did you install that Apache? That’s not the one
distributed by openSUSE. Please run this:

Ok, run these commands in a terminal:


rpm -qi apache2

and paste it all here, from initial command prompt, to last command
prompt, in a single mouse sweep, and please do so inside code tags (the
‘#’ button in the forum editor).
See photo
It is preferable to see what the commands have to say about things, than
describing them :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

rpm -qi apache2
Name : apache2
Version : 2.4.9
Release : 1.11
Architecture: i586
Install Date: Mon 23 Jun 2014 04:30:08 PM CDT
Group : Productivity/Networking/Web/Servers
Size : 3911166
License : Apache-2.0
Signature : DSA/SHA1, Fri 06 Jun 2014 04:39:15 AM CDT, Key ID 9584a164bd6d129a
Source RPM : apache2-2.4.9-1.11.src.rpm
Build Date : Fri 06 Jun 2014 04:38:22 AM CDT
Build Host : cloud102
Relocations : (not relocatable)
Vendor : obs://build.opensuse.org/Apache
URL : http://httpd.apache.org/
Summary : The Apache Web Server Version 2.2
Description :
Apache 2, the successor to Apache 1.

Apache is the most used Web server software worldwide.

Some new features in Apache 2: - hybrid multiprocess, multithreaded
mode for improved scalability

  • multiprotocol support

  • stream filtering

  • IPv6 support

  • new module API

New modules include: - mod_auth_db

  • mod_auth_digest

  • mod_charset_lite

  • mod_dav

  • mod_file_cache

Mod_ssl is no longer a separate package, but is now included in the
Apache distribution.

See /usr/share/doc/packages/apache2/, http://httpd.apache.org/, and
http://httpd.apache.org/docs-2.2/upgrading.html.
Distribution: Apache / openSUSE_13.1

/var/log/apache2/error_log/

[Mon Jun 23 17:12:19.274053 2014] [core:error] [pid 12759] (13)Permission denied: [client ::1:32903] AH00035: access to /index.php5 denied (filesystem path ‘/srv/www/htdocs/index.php5’) because search permissions are missing on a component of the path
[Mon Jun 23 17:12:19.274067 2014] [core:error] [pid 12759] (13)Permission denied: [client ::1:32903] AH00035: access to /index.php denied (filesystem path ‘/srv/www/htdocs/index.php’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:16.732238 2014] [mpm_prefork:notice] [pid 12742] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jun 23 17:15:16.843718 2014] [ssl:warn] [pid 13067] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jun 23 17:15:16.851580 2014] [mpm_prefork:notice] [pid 13067] AH00163: Apache/2.4.9 (Linux/SUSE) OpenSSL/1.0.1h PHP/5.4.20 configured – resuming normal operations
[Mon Jun 23 17:15:16.851622 2014] [core:notice] [pid 13067] AH00094: Command line: ‘/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SSL -D SYSTEMD -D FOREGROUND’
[Mon Jun 23 17:15:25.134399 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.html denied (filesystem path ‘/srv/www/htdocs/index.html’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:25.134473 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.html.var denied (filesystem path ‘/srv/www/htdocs/index.html.var’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:25.134491 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php4 denied (filesystem path ‘/srv/www/htdocs/index.php4’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:25.134506 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php5 denied (filesystem path ‘/srv/www/htdocs/index.php5’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:25.134520 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php denied (filesystem path ‘/srv/www/htdocs/index.php’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:26.316819 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.html denied (filesystem path ‘/srv/www/htdocs/index.html’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:26.316862 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.html.var denied (filesystem path ‘/srv/www/htdocs/index.html.var’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:26.316879 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php4 denied (filesystem path ‘/srv/www/htdocs/index.php4’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:26.316893 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php5 denied (filesystem path ‘/srv/www/htdocs/index.php5’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:26.316908 2014] [core:error] [pid 13085] (13)Permission denied: [client ::1:32908] AH00035: access to /index.php denied (filesystem path ‘/srv/www/htdocs/index.php’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:31.505627 2014] [mpm_prefork:notice] [pid 13067] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jun 23 17:15:31.619476 2014] [ssl:warn] [pid 13132] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jun 23 17:15:31.627156 2014] [mpm_prefork:notice] [pid 13132] AH00163: Apache/2.4.9 (Linux/SUSE) OpenSSL/1.0.1h PHP/5.4.20 configured – resuming normal operations
[Mon Jun 23 17:15:31.627234 2014] [core:notice] [pid 13132] AH00094: Command line: ‘/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SSL -D SYSTEMD -D FOREGROUND’
[Mon Jun 23 17:15:39.541641 2014] [core:error] [pid 13149] (13)Permission denied: [client ::1:32909] AH00035: access to /index.html denied (filesystem path ‘/srv/www/htdocs/index.html’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:39.541726 2014] [core:error] [pid 13149] (13)Permission denied: [client ::1:32909] AH00035: access to /index.html.var denied (filesystem path ‘/srv/www/htdocs/index.html.var’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:39.541746 2014] [core:error] [pid 13149] (13)Permission denied: [client ::1:32909] AH00035: access to /index.php4 denied (filesystem path ‘/srv/www/htdocs/index.php4’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:39.541764 2014] [core:error] [pid 13149] (13)Permission denied: [client ::1:32909] AH00035: access to /index.php5 denied (filesystem path ‘/srv/www/htdocs/index.php5’) because search permissions are missing on a component of the path
[Mon Jun 23 17:15:39.541780 2014] [core:error] [pid 13149] (13)Permission denied: [client ::1:32909] AH00035: access to /index.php denied (filesystem path ‘/srv/www/htdocs/index.php’) because search permissions are missing on a component of the path

So where did you get this version? Red Hat rpms may not work in openSUSE since thee may be subtle differences in file structures

Also factory or some other experimental area my not have functional code for 13.1

On 2014-06-24 00:26, Dexter22 wrote:
>
> rpm -qi apache2

Hey, I asked you to use code tags, and you did not.


> Name        : apache2
> Version     : 2.4.9
> Release     : 1.11
> Architecture: i586

Do you really have a 32 bit processor?


> Install Date: Mon 23 Jun 2014 04:30:08 PM CDT
> Group       : Productivity/Networking/Web/Servers
> Size        : 3911166
> License     : Apache-2.0
> Signature   : DSA/SHA1, Fri 06 Jun 2014 04:39:15 AM CDT, Key ID 9584a164bd6d129a
> Source RPM  : apache2-2.4.9-1.11.src.rpm
> Build Date  : Fri 06 Jun 2014 04:38:22 AM CDT
> Build Host  : cloud102
> Relocations : (not relocatable)
> Vendor      : obs://build.opensuse.org/Apache
> URL         : http://httpd.apache.org/

This is what you should have:


Version     : 2.4.6
Release     : 6.23.1

Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://httpd.apache.org/

You are probably using the buildservice version, not the distribution
default version.

Why?

It is not wrong to use such versions, but my guess is that your are a
newby, so why don’t you use defaults till you learn your ways?


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

So this is your problem:

[Mon Jun 23 17:12:19.274053 2014] [core:error] [pid 12759] (13)Permission denied: [client ::1:32903] AH00035: access to /index.php5 denied (filesystem path '/srv/www/htdocs/index.php5') because search permissions are missing on a component of the path

And a lot of similar ones.

Something is wrong with permissions. Apache runs as user wwwrun:www and it has to be able to access its DocumentRoot.

Please post the output of this, to see what directory has wrong permissions:

ls -ld /srv/ /srv/www/ /srv/www/htdocs/

Hm?
His rpm output says this:

Distribution: Apache / openSUSE_13.1

Apparently he is using the version from OBS’s Apache repo, as Carlos mentioned.
That’s not the reason for this problem though.

As stated, your problem is most likely due to permission problems to the /srv/www tree. Also, I see that it is trying to access several index.php files. You only need one, called “index.php”, and should look like this:


<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

I also like to add a basic html file, named “index.html”:


<html>
<header><title>This is title</title></header>
<body>
Hello world
</body>
</html>

Note, both are just plain text files, so use your favorite editor to create them, then save as the indicated names to the “/srv/www/htdocs” folder.
Next, change the owner group and permissions for our files:


cd /srv/www
chown -R wwwrun
chgrp -R www
chmod -R 644

You should now be able to see both files. I would also add, before you make your site ‘live’, delete the “index.php” file.

This is mainly caused by the fact that apache tries a few ones (i.e. index.html, index.php, index.php5, and so on) before it responds with an error message in the default configuration.
But it cannot access the actual directory in this case, it seems.

Ok guys thanks for the help I still have the problem.

I don’t have 32 bit processor but is the only one version that I can install here because I had a problem with grub2.

lindx:~ # ls -ld /srv/ /srv/www/ /srv/www/htdocs/
drwxr-xr-x 5 root root 4096 Nov 6 2013 /srv/
drwxr-xr-x 6 root root 4096 Jun 23 16:26 /srv/www/
drw-rwxrwx 9 wwwrun www 4096 Jun 23 16:26 /srv/www/htdocs/

I ran the command that you guys told me but I have not success.

lindx:/srv/www # chown -R wwwrun
chown: missing operand after ‘wwwrun’
Try ‘chown --help’ for more information.
lindx:/srv/www # chgrp -R www
chgrp: missing operand after ‘www’
Try ‘chgrp --help’ for more information.
lindx:/srv/www #
lindx:/srv/www # chmod -R 644
chmod: missing operand after ‘644’
Try ‘chmod --help’ for more information.

anyone have another idea?
Thanks.

chmod -R 644

This looks ok, Apache should have access.

Then it must be the / directory itself I suppose.

ls -ld /

And to be sure show the content inside /srv/www/htdocs/ as well.

ls -l /srv/www/htdocs/

I ran the command that you guys told me but I have not success.

lindx:/srv/www # chown -R wwwrun
chown: missing operand after ‘wwwrun’
Try ‘chown --help’ for more information.
lindx:/srv/www # chgrp -R www
chgrp: missing operand after ‘www’
Try ‘chgrp --help’ for more information.
lindx:/srv/www #
lindx:/srv/www # chmod -R 644
chmod: missing operand after ‘644’
Try ‘chmod --help’ for more information.

Well, you have to specify of course for which directory you want to change the owner, group, or permissions.
F.e. “chown -R wwwrun /srv”.

But those things are ok anyway.

I did what you said but I still have the error

ls -l /srv/www/htdocs/
total 52
drwxr-xr-x 2 wwwrun www 4096 Mar 22 13:41 RemoteSystemsTempFiles
drwxr-xr-x 15 wwwrun www 4096 Mar 22 13:41 biblio
drwxr-xr-x 9 wwwrun www 4096 Mar 22 13:41 blog
drwxr-xr-x 8 wwwrun www 4096 Mar 22 13:41 dw
-rw-r–r-- 1 wwwrun root 302 Mar 12 2006 favicon.ico
drwxr-xr-x 2 wwwrun www 4096 Nov 6 2013 gif
-rw-r–r-- 1 wwwrun root 45 Jun 11 2007 index.html
-rw------- 1 wwwrun www 57 Jan 2 12:56 index.php
-rw------- 1 wwwrun www 21 Jan 2 18:00 info.php
-rw-r–r-- 1 wwwrun www 2356 Sep 28 2013 info2html.css
drwxr-xr-x 2 wwwrun www 4096 Mar 22 13:41 logeo
drwxr-xr-x 7 wwwrun www 4096 Mar 22 13:41 otro
-rw-r–r-- 1 wwwrun root 26 Jun 6 04:37 robots.txt

Access forbidden! You don’t have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403 localhost
Apache/2.4.9 (Linux/SUSE)

guys I am frustrated.

No.
I meant you should post the output of:

ls -ld /

Looking at your output, you will see you still have permission problems. Here is an example of what it should look like:


I am Root: cd /srv/www/htdocs
I am Root: l
total 24
drw-r--r-- 3 wwwrun www  4096 Jun 24 10:16 ./
drwxr-xr-x 6 root   root 4096 May 19 13:09 ../
drw-r--r-- 2 wwwrun www  4096 May 11 18:07 gif/
-rw-r--r-- 1 wwwrun www   174 Jun 24 10:14 index.html
-rw-r--r-- 1 wwwrun www   130 Jun 24 10:14 index.php
-rw-r--r-- 1 wwwrun www  2356 Sep 28  2013 info2html.css
I am Root: 

So you still have 3 files that belong to the ‘root’ group. Your ‘index.php’ is not readable by anyone other than apache ‘wwwrun’.
Also, I notice your index.html and index.php are very small. The two example files I posted earlier are the minimal required, yet you’ll notice my ‘index.html’ file is 174 bits, where as yours is 45., Like wise my ‘index.php’ is 130 bits, yours is 57. Once you fix these problems, you should be able to access your site. Or at least the index.html page.

Again, permissions are **very **important. You are allowing strangers into your machine and, except for rare occasions, should not have more than a ‘read’ ability.

But all of them are readable by ‘wwwrun’, so there should not be a problem.
In other words, this doesn’t really matter, for the problem at hand at least.

Also, I notice your index.html and index.php are very small. The two example files I posted earlier are the minimal required, yet you’ll notice my ‘index.html’ file is 174 bits, where as yours is 45., Like wise my ‘index.php’ is 130 bits, yours is 57. Once you fix these problems, you should be able to access your site. Or at least the index.html page.

That 45 Bytes index.html is the standard one shipped in openSUSE’s apache packages, mine has 45 Bytes as well. It looks like this:

<html><body><h1>It works!</h1></body></html>

The index.html would “shadow” index.php, so he should better remove it I suppose (uninstall the package apache2-example-pages), but he should get at least a simple test page and no error message.

Again, permissions are **very **important. You are allowing strangers into your machine and, except for rare occasions, should not have more than a ‘read’ ability.

Yes, but I see nothing wrong with his permissions.
He hasn’t shown the permissions of / itself yet though, according to the error message I would suspect something wrong there.

Ok, my install didn’t have default index files. I would direct to this line tho:

-rw-------  1 wwwrun www    57 Jan  2 12:56 index.php

no one will be able to read his index.php file.
Might just be me, but I don’t like anything involving ‘root’ in the /srv/www. But then again, I also don’t like putting my servers in ‘htdocs’ :slight_smile:

As I wrote, this is part of the package “apache2-example-pages”.

I would direct to this line tho:

-rw-------  1 wwwrun www    57 Jan  2 12:56 index.php

no one will be able to read his index.php file.

Wrong.
User “wwwrun”, i.e. Apache, is able to read his index.php file, and can serve the generated web page to anybody that connects to this web server.

But as I said, index.html is preferred, so this index.php is ignored anyway unless explicitely specified (http://localhost/index.php).

Might just be me, but I don’t like anything involving ‘root’ in the /srv/www. But then again, I also don’t like putting my servers in ‘htdocs’ :slight_smile:

Well, ok. Probably not the best practice anyway.

But the point is that those files’ permissions are ok and should not cause that error. :wink:

OK, Thanks Guys, this morning I was using Yast with HTTP Server and I went to User and Group Management, Firewall and Service Manager, and I still have the same problem. I don’t know what I have to do, last year I was using same Opensuse 13.1 and Lamp with no problem but I think the problem was the update, I am tired about this, I am thinking to move back to MS Windows and install Wamp or Xampp but I really don’t like windows anymore.

Tomas do you think I need to enable SELinux?