In my django application (let me call it partlysecureapp ) there is an index page that is visible to everyone. All other pages (accessible from links on the index page) must be logged in. I want to use an SSL application in apache2.
I already have an application (say mysecureapp ) deployed on apache with SSL, which has all the pages that require user login. I set the following configurations for this as follows.
My apache2 is located in /etc/apache2 , which has the following directory structure.
/etc/apache2/ |--conf.d---*charset,security,localized-error-pages* |---mods-available---... |---mods-enabled---... |---sites-available---default,default-ssl,ssl |---sites-enabled---shortcut to ssl |---apach2.conf |---httpd.conf |---ports.conf |---magic |---envvars
For secureapp I installed this in the sites-available/ssl file
<VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /home/dev/python/django/mysecureapp SSLEngine on SSLOptions +StrictRequire SSLCertificateFile /etc/ssl/certs/server.crt SSLCertificateKeyFile /etc/ssl/private/server.key ... WSGIScriptAlias /mysecureapp /home/dev/python/django/mysecureapp/mysecureapp.wsgi Alias /site_media/ /home/dev/python/django/mysecureapp/media/ </VirtualHost>
This works great.
To deploy my partlysecureapp ,
http://127.0.0.1:8080/partlysecureapp/ you must show the index page, accessible to all. but
../partlysecureapp/link1/ ../partlysecureapp/link2/ ../partlysecureapp/link3/
login is required and must be sent via ssl.
I think I need to add more WSGIScriptAlias for my partlysecureapp . Do I need to add another DocumentRoot for partlysecureapp ? How to tell apache to serve the index page from port 8080 and others via ssl port?
At the moment, /etc/apache2/httpd.conf empty. Only the sites-available/ssl file has a VirtualHost element.
damon
source share