Hello there,
does anybody know, how to configure apache2 / radiant to handle /admin
logins via SSL and only via SSL?
My apache2 config is the same as mentioned in the Agile Rails
programming book (2nd edition). A snippet of it is attached to this
mail. I am trying to force login the admin interface via ssl.
Therefore my server runs one instance on port 80 and one on port 443.
But I don't know how to handle this mongrel/proxy/balancer thing. It
is working in general, but I have to use the IP adress in my redirect
to the 443-server. With the domain name I get endless loops in my
redirects.
Futhermore I would redirect request to domain.com to www.domain.com
via permanent redirect. I tried different methods. But all those
redirects get in the way of each other.
Both servers have the same name, but use different ports. I also tried
to give them distinct names, but I got problems.
It would be nice if anyone would post his/her settings.
Best wishes,
rainer
-----8<---- Port 80 ----
<Proxy balancer://mongrel_cluster>
Order allow,deny
Allow from all
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
</Proxy>
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [EMAIL PROTECTED]
ServerName www.domain.com
DocumentRoot /var/www/domain.com
<Directory "/var/www/domain.com/current/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Redirect admin login
RewriteRule ^/admin/login https://123.123.123.123/admin/login
[redirect=permanent]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]
</VirtualHost>
-----8<---- Port 443 ----
<Proxy balancer://mongrel_cluster>
Order allow,deny
Allow from all
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
</Proxy>
NameVirtualHost *:443
<VirtualHost *:443>
ServerAdmin [EMAIL PROTECTED]
ServerName www.domain.com
# enable SSL
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
DocumentRoot /var/www/domain.com/current/public
<Directory "/var/www/domain.com/current/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>
RewriteEngine On
ErrorLog /var/log/apache2/error.log
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]
</VirtualHost>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant