1

So I'm running apache2 on Debian and trying to run Roundcube. I have conf.d file and it runs fine but I want to use the base domain instead of example.com/webmail. I would like also when I put example.com to go the roundcube. Ultimately I would like to be able to go to http://example.com and it be redirected to https://example.com which would be my Roundcube webmail. I have tried using "/" as alias for the base domain doesn't seem to work.

Also I have SSL working in other parts of the server. Here is the conf.d/roundcube I'm using

roundcube

# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /var/lib/roundcube
Alias /webmail /var/lib/roundcube
Alias /        /var/lib/roundcube

# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
</Directory>

<Directory /var/lib/roundcube/>
  Options +FollowSymLinks
  DirectoryIndex index.php

  <IfModule mod_php5.c>
    AddType application/x-httpd-php .php

    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .:/usr/share/php
  </IfModule>

  # This is needed to parse /var/lib/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
</Directory>

# Protecting basic directories:
<Directory /var/lib/roundcube/config>
        Options -FollowSymLinks
        AllowOverride None
</Directory>

<Directory /var/lib/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>

<Directory /var/lib/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>

<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /webmail>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://%{HTTP_HOST}:8080%{REQUEST_URI}  [L]

    </Location>
  </IfModule>
</IfModule>

<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /roundcube>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://%{HTTP_HOST}:8080%{REQUEST_URI}  [L]
    </Location>
  </IfModule>
</IfModule>
1
  • I do not see the VirtualHost for your domain. You may be able to forget the Alias directive and change the DocumentRoot directive in VirtualHost for your domain. See if that does what you want.
    – closetnoc
    Sep 17, 2014 at 22:19

1 Answer 1

1

You will want to create a virtual host file for the the webmail. Create a new file: /etc/apache2/sites-available/example.com.conf with contents like:

<VirtualHost *:80>
    Servername example.com

    Alias /program/js/tiny_mce/ /usr/share/tinymce/www/
    Alias /        /var/lib/roundcube

    RewriteEngine on
    RewriteCond %{HTTPS} !^on$ [NC]
    RewriteRule . https://%{HTTP_HOST}:8080%{REQUEST_URI}  [L]
</VirtualHost>

Remove the alias and HTTPS rewrite rules from the roundcube configuration file.

Enable your new virtual host with: sudo a2ensite example.com

Restart your webserver with: sudo service apache2 restart

1
  • Instead of Alias / /var... you could also write DocumentRoot /var/lib/roundcube.
    – vstm
    Dec 10, 2014 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.