LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache 2 -> Turbogears 2.0 wsgi -> SSL (http://www.linuxquestions.org/questions/linux-server-73/apache-2-turbogears-2-0-wsgi-ssl-773868/)

pkraus109 12-06-2009 07:15 PM

Apache 2 -> Turbogears 2.0 wsgi -> SSL
 
I have a web application I am going to be deploying soon. I am pretty new when it comes to apache and I am getting twisted around the axel on the configuration. I have it so that I am able to access my application both in ssl and normal (http, https). The problem is I want to force ssl for some pages and force non ssl on other portions of the site.

I figured the best way to do this would be through rewrite. I can get it to work in one direction. For intstance i can get the redirects to https to work but once on https the redirect back doesn't.

Apache 2 Config File ...
# redirect non-secure pages (/user, /register or /action) to https if requested by HTTP
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>

Alias /images /webapp/images
Alias /css /webapp/css
Alias /javascript /webapp/javascript

WSGIScriptAlias / /webapp/apache/config.wsgi
WSGIDaemonProcess webapp threads=10 processes=3
WSGIProcessGroup webapp

<Directory /webapp/apache>
Order deny,allow
Allow from all
</Directory>


All times are GMT -5. The time now is 05:47 AM.