Hello.
I installed “Apache/2.4.16” and when I want browse “localhost” then it show me "Access forbidden!. Which part of “httpd.conf” must be changed:
<Directory />
Options None
AllowOverride None
<IfModule !mod_access_compat.c>
Require all denied
</IfModule>
<IfModule mod_access_compat.c>
Order deny,allow
#Deny from all
Allow from all
</IfModule>
</Directory>
Thank you.
NOTE:
In post #10 below the OP states that he uses in fact
Apache/2.4.23 (Linux/SUSE)
Usually /etc/apache2/httpd.conf has a comment for the section you’ve mentioned:
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
<IfModule !mod_access_compat.c>
Require all denied
</IfModule>
<IfModule mod_access_compat.c>
Order deny,allow
Deny from all
</IfModule>
</Directory>
Within /etc/apache2/httpd.conf there’s usually the following section:
### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf
If you look in /etc/apache2/default-server.conf you should find:
#
# Configure the DocumentRoot
#
<Directory "/srv/www/htdocs">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
# NOTE: For directories where RewriteRule is used, FollowSymLinks
# or SymLinksIfOwnerMatch needs to be set in Options directive.
Options None
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
<IfModule mod_access_compat.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
The following points have to be checked:
The permissions on the directory /srv/
The permissions on the directory /srv/www/
The permissions on the directory /srv/www/htdocs/
The permissions on the files within /srv/www/htdocs/
In all cases, there has to be read access for “world” (also known as “other”) …
When yo use one of the unsupported versions of openSUSE (you choose OTHER VERSION), then please at least explain which version that is. It makes it easier to understand what sort of environment you use for your potential helpers.
Yes, I’m also more than a little bit worried by the Apache version the thread’s originator has mentioned …
It ain’t in any openSUSE Repository – at least from what I’ve seen here – regardless of the Operating System – Tumbleweed, Leap, SLE, Debian, Ubuntu: <https://software.opensuse.org/package/apache2>.
Also, the thread’s originator doesn’t mention which Operating System is being used to run the Apache server …
But first and foremost people have aksed you (in post #3 and post #5) what version of openSUSE you use (because you said OTHER VERSION, thus we only know it is not a supported version, but we want to know which one) and where you got that Apache 2.4.16 from (because it is not in any openSUSE repo).
Hi
In you first post you need to remove the # from the Order deny,allow, this needs to be this way to forbid access to / In your post you omitted the comment;
# forbid access to the entire filesystem by default
The file you need to modify is /etc/apache2/default-server.conf but since the files you installed are php related, then I would think php needs to be active.
I you pop a test html file in there called index.html and see if you can browse to that;
<Directory />
Options None
AllowOverride None
<IfModule !mod_access_compat.c>
Require all denied
</IfModule>
<IfModule mod_access_compat.c>
Order deny,allow
#Deny from all <== Remove the # here
Allow from all
</IfModule>
</Directory>
Apart from the fact that, the thread’s originator commented out the configuration parameter which prevents the system’s entire directory structure from being presented via the Apache Web Server, I suspect that, “hack3rcon” needs to concentrate on the permissions in the “DocumentRoot” section of the configuration file ‘/etc/apache2/default-server.conf’ …