0

I have installed (well, almost) RoundCubeMail on CentOS7. I set up Apache/2.4.6 server, so when I nagivate to localhost (or 127.0.0.1) I can see the start/test page of the Apache (Testing 1 2 3 ...).

I have installed roundcube in in /var/www/html/roundcube. I made all the configuration in db.inc.php and main.inc.php files, my roundcube root directory has 755 permission.

My Apache server works perfectly... But When I go to http://localhost/roundcubemail/installer I have 403 forbidden Error.

I made the directory writeable for Apache:

setenforce 0
sudo chown -R apache /var/www/html
sudo chmod 755 -R /var/www/html

Any ideas, what can be wrong?

Here's my Apache config file:

ServerRoot "/etc/httpd"
Listen *:80

Include conf.modules.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    #Require all granted
allow from all
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Allow from all
    # Require all granted
</Directory>

<Directory "/var/www/html/roundcubemail">
     Options Indexes FollowSymLinks
    AllowOverride None
    Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"

LogLevel warn

<IfModule log_config_module>

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>

EnableSendfile on
IncludeOptional conf.d/*.conf
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
Brian Brown
  • 39
  • 1
  • 1
  • 7

2 Answers2

1

Access control refers to any means of controlling access to any resource.

Reference: Access Control - Apache HTTP Server Version 2.4


Make sure your /etc/httpd/conf/httpd.conf contains following:

<Directory "/var/www/html">
  Require all granted
</Directory>

also, take a look at following:

Upgrading to 2.4 from 2.2 - Apache HTTP Server Version 2.5

alexus
  • 13,112
  • 32
  • 117
  • 174
  • Thanks for the answer. This is my Apache server at work, so for now on I dont have access to it (tomorrow will check it). However, as I remember, I have something like this http://pastie.org/private/h4eflnfngex68rr7irlw in my `/etc/httpd/conf/httpd.conf`. I dont know if I understand it right, but if I hadn't this, I wouldnt be able to see Apache test page, is that right? Now I can see the Apache test page, but cant access round cube installer – Brian Brown Feb 19 '15 at 20:52
  • @BrianBrown Your syntax is from 2.2, but CentOS7 comes with 2.4. Are you on 2.2 or 2.4? – alexus Feb 19 '15 at 21:02
  • Can you please suggest what more can I do about this? I pasted my Apache config file and it seems that this is Apache 2.4 (at least from comments in this config file). Yes, it is: Apache/2.4.6 – Brian Brown Feb 20 '15 at 17:54
  • @BrianBrown Carefully read my answer to your question, it has everything that you need to do in order to fix it. – alexus Feb 20 '15 at 20:14
0

This may be caused by apache server settings Because Brian had his server directory indexing as

<IfModule dir_module>
     DirectoryIndex index.html
</IfModule>

but Roundcube requires index.php to be recognized by server for indexing. That's why it was denied.

Tennom
  • 1