Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
subdomain, horde, ssl trouble pointing right [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
soth
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 207

PostPosted: Wed May 11, 2005 9:42 pm    Post subject: subdomain, horde, ssl trouble pointing right [solved] Reply with quote

Howdy!

I have a domain, I call it "www.example.com" here.
I have a named running on my machine. I have my subdomains registered, more specific "webmail.example.com" which is functioning, verified through dig...

I want to be able to go to https://webmail.example.com and use my horde installation, which I have been able to utilise when installed under https://www.example.com/horde.

Now, I have one directory for each subdomain under my document root, like:
Code:

ls /var/www/localhost/htdocs
example.com webmail.example.com
It always fails. I have tried alot of different setups but something is always wrong.
With my current setup i get "You don't have permission to access / on this server." with https.

My apache2.conf:

Code:

cat /etc/apache2/conf/apache2.conf |grep -v "#"

ServerRoot /usr/lib/apache2
ServerName example.com
PidFile /var/run/apache2.pid
ErrorLog logs/apacheserver-error_log
LogLevel warn
DocumentRoot /var/www/localhost/htdocs

LoadModule access_module                 modules/mod_access.so
LoadModule auth_module                   modules/mod_auth.so
LoadModule auth_anon_module              modules/mod_auth_anon.so
LoadModule auth_dbm_module               modules/mod_auth_dbm.so
LoadModule auth_digest_module            modules/mod_auth_digest.so
LoadModule include_module                modules/mod_include.so
LoadModule log_config_module             modules/mod_log_config.so
LoadModule env_module                    modules/mod_env.so
LoadModule mime_magic_module             modules/mod_mime_magic.so
LoadModule cern_meta_module              modules/mod_cern_meta.so
LoadModule expires_module                modules/mod_expires.so
LoadModule headers_module                modules/mod_headers.so
LoadModule usertrack_module              modules/mod_usertrack.so
LoadModule unique_id_module              modules/mod_unique_id.so
LoadModule setenvif_module               modules/mod_setenvif.so
LoadModule proxy_module                  modules/mod_proxy.so
LoadModule proxy_connect_module          modules/mod_proxy_connect.so
LoadModule proxy_ftp_module              modules/mod_proxy_ftp.so
LoadModule proxy_http_module             modules/mod_proxy_http.so
LoadModule mime_module                   modules/mod_mime.so
LoadModule status_module                 modules/mod_status.so
LoadModule autoindex_module              modules/mod_autoindex.so
LoadModule asis_module                   modules/mod_asis.so
LoadModule info_module                   modules/mod_info.so
LoadModule cgi_module                    modules/mod_cgi.so
LoadModule cgid_module                   modules/mod_cgid.so
LoadModule vhost_alias_module            modules/mod_vhost_alias.so
LoadModule negotiation_module            modules/mod_negotiation.so
LoadModule dir_module                    modules/mod_dir.so
LoadModule imap_module                   modules/mod_imap.so
LoadModule actions_module                modules/mod_actions.so
LoadModule speling_module                modules/mod_speling.so
LoadModule userdir_module                modules/mod_userdir.so
LoadModule alias_module                  modules/mod_alias.so
LoadModule rewrite_module                modules/mod_rewrite.so

LoadModule file_cache_module             modules/mod_file_cache.so
LoadModule echo_module                   modules/mod_echo.so
LoadModule charset_lite_module           modules/mod_charset_lite.so
LoadModule cache_module                  modules/mod_cache.so
LoadModule disk_cache_module             modules/mod_disk_cache.so
LoadModule mem_cache_module              modules/mod_mem_cache.so
LoadModule ext_filter_module             modules/mod_ext_filter.so
LoadModule case_filter_module            modules/mod_case_filter.so
LoadModule case_filter_in_module         modules/mod_case_filter_in.so
LoadModule deflate_module                modules/mod_deflate.so
LoadModule logio_module                  modules/mod_logio.so
LoadModule php4_module /usr/lib/apache2-extramodules/libphp4.so
LoadModule      ssl_module      /usr/lib/apache2-extramodules/mod_ssl.so
Include conf/modules.d/*.conf
Include conf/commonapache2.conf

Listen 80

<IfModule mod_log_config.c>
CustomLog logs/access_log combined env=!VLOG
</IfModule>

Include conf/vhosts/vhosts.conf

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
MaxClients         150
MaxRequestsPerChild  0
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

<IfModule perchild.c>
NumServers           5
StartThreads         5
MinSpareThreads      5
MaxSpareThreads     10
MaxThreadsPerChild  20
MaxRequestsPerChild  0
</IfModule>

commonapache + vhosts next
Code:

User apache
Group apache

ServerAdmin hostmaster@example.com

DocumentRoot /var/www/localhost/htdocs

<Directory />
  Options -All -Multiviews
  AllowOverride None
  <IfModule mod_access.c>
    Order allow,deny
    Allow from all
  </IfModule>
</Directory>

<Directory /var/www/localhost/htdocs/example.com>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    <IfModule mod_access.c>
      Order allow,deny
      Allow from all
    </IfModule>
</Directory>

<Directory /var/www/localhost/htdocs/horde>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    <IfModule mod_access.c>
      Order allow,deny
      Allow from all
    </IfModule>
</Directory>




<Directory /home/*/html>
    AllowOverride All
    Options MultiViews -Indexes Includes FollowSymLinks
    <IfModule mod_access.c>
      Order allow,deny
      Allow from all
    </IfModule>
</Directory>

<Directory /var/www/localhost/icons>
    Options -Indexes MultiViews
    AllowOverride None
    <IfModule mod_access.c>
      Order allow,deny
      Allow from all
    </IfModule>
</Directory>

<Location /index.shtml>
    Options +Includes
</Location>

<IfModule mod_userdir.c>
    UserDir html
</IfModule>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.html.var index.php index.php3 index.shtml index.cgi index.pl index.htm Default.htm
default.htm
</IfModule>

AccessFileName .htaccess

<IfModule mod_access.c>
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
</IfModule>

UseCanonicalName off

<IfModule mod_mime.c>
    TypesConfig conf/mime.types
</IfModule>

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off
EnableMMAP on

<IfModule mod_log_config.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%v %h %l %u %t \"%r\" %>s %b %T" script
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

    <IfModule mod_logio.c>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

</IfModule>

ServerTokens Full
ServerSignature On

<IfModule mod_alias.c>
    Alias /icons/ /var/www/localhost/icons/
    ScriptAlias /cgi-bin/ /var/www/localhost/cgi-bin/
    ScriptAlias /protected-cgi-bin/ /var/www/localhost/protected-cgi-bin
    ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/public_html/cgi-bin/$2
        <IfModule mod_perl.c>
                Alias /perl/ /var/www/localhost/perl/
                Alias /cgi-perl/ /var/www/localhost/perl/
        </IfModule>
</IfModule>

<IfModule mod_autoindex.c>
    IndexOptions FancyIndexing VersionSort NameWidth=*
    AddIconByEncoding (CMP,/icons/compressed.png) x-compress x-gzip

    AddIconByType (TXT,/icons/text.png) text/*
    AddIconByType (IMG,/icons/image2.png) image/*
    AddIconByType (SND,/icons/sound2.png) audio/*
    AddIconByType (VID,/icons/movie.png) video/*

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip .bz2
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py .php .php3
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^

    DefaultIcon /icons/unknown.gif
    ReadmeName README.html
    HeaderName HEADER.html

</IfModule>

<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz

    AddLanguage en .en
    AddLanguage sv .se
    AddDefaultCharset ISO-8859-1

    <IfModule mod_negotiation.c>
        LanguagePriority en sv
    </IfModule>

    <IfModule mod_negotiation.c>
        ForceLanguagePriority Prefer Fallback
    </IfModule>

    AddCharset ISO-8859-1  .iso8859-1  .latin1
    AddCharset WINDOWS-1251 .cp-1251   .win-1251
    AddCharset UTF-8       .utf8
    AddCharset utf-8       .utf8

    AddType application/x-tar .tgz
    AddType image/x-icon .ico

    AddHandler cgi-script .cgi

    AddHandler type-map var

    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

    AddHandler imap-file map

</IfModule>

<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0

    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
    BrowserMatch "^WebDAVFS" redirect-carefully
</IfModule>


Code:

ServerName example.com
NameVirtualHost xxx.xxx.xxx.xxx:80


<VirtualHost xxx.xxx.xxx.xxx:80>
    ServerName example.com
    Serveralias www.example.com
    DocumentRoot /var/www/localhost/htdocs/example.com
    DirectoryIndex index.php index.html
    ErrorLog /var/log/apache2/example.com-error
    CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>


<VirtualHost xxx.xxx.xxx.xxx:80>
        ServerAdmin hostmaster@example.com
        ServerName webmail.example.com
        DocumentRoot /var/www/localhost/htdocs/webmail.example.com/horde
        DirectoryIndex index.php index.html
        ErrorLog /var/log/apache2/webmail.example.com-error
        CustomLog /var/log/apache2/webmail.example.com-access combined
        SSLCertificateFile /etc/apache2/conf/ssl/new.cert.cert
        SSLCertificateKeyFile /etc/apache2/conf/ssl/new.cert.key

       <Directory /var/www/localhost/htdocs/webmail.example.com/horde>
            Options Indexes FollowSymLinks MultiViews       
            Order allow,deny
            Allow from all
     </Directory>
</VirtualHost>

and the log says
[Tue May 10 23:27:25 2005] [error] [client 192.168.1.2] Directory index forbidden by rule: /var/www/localhost/htdocs/

Very grateful for help. Been at this now for weeks on and off....
_________________
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today


Last edited by soth on Mon May 16, 2005 7:03 am; edited 1 time in total
Back to top
View user's profile Send private message
soth
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 207

PostPosted: Thu May 12, 2005 12:19 pm    Post subject: Reply with quote

Weird. All https requests seems to be pointed to document root...
_________________
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
soth
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 207

PostPosted: Mon May 16, 2005 7:03 am    Post subject: Reply with quote

/etc/apache2/conf/modules.d/41_mod_ssl.default-vhost.conf

That's where my troubles resided.
All ssl requests had a default directory, which I have now amended.
Feel free to ask if you want to know more about this. I'll answer. =)
_________________
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
sandcrawler
Tux's lil' helper
Tux's lil' helper


Joined: 24 Mar 2003
Posts: 149
Location: SaintLouis, MO

PostPosted: Tue May 24, 2005 8:57 pm    Post subject: Reply with quote

I've beat my head on my desk all day trying to figure out what was causing this behavior. Thanks for pointing to that file..
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum