Not exactly.
At first for testing purposes I have changed two lines in routes.py to
routers = dict (
BASE = dict(
default_application = 'welcome',
domains = {
'<my-ip>:80' : 'myapp/mycontroller',
'<my-ip>:443' : 'myapp/mycontroller',
}
},
}
I.e. the same controller/function for http and https
There is an answer for
http://xxx.xxx.xxx.xxx/myapp/mycontroller/index and for
https://xxx.xxx.xxx.xxx/myapp/mycontroller/index
But the http-request is changed to https and the function
https://xxx.xxx.xxx.xxx/myapp/mycontroller/index
is always called. I have checked it also with request.is_https
With
I get an error message:
The requested URL... t was not found on this server.
I have added the following lines to apache2.conf. These lines are copied from "Setting up a production deployment in Ubuntu" (page 12). I have only changed line 1 and 2 to get rid of a warning of apache:
# NameVirtualHost *:80
# NameVirtualHost *:443
<VirtualHost *:80>
WSGIDaemonProcess web2py user=www-data group=www-data
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
<Directory /home/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(.*) /home/www-data/web2py/applications/$1/static/$2
<Directory /home/www-data/web2py/applications/*/static/>
Options -Indexes
Order Allow,Deny
Allow from all
</Directory>
<Location /admin>
Deny from all
</Location>
<LocationMatch ^/([^/]+)/appadmin>
Deny from all
</LocationMatch>
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/self_signed.cert
SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
<Directory /home/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(.*) /home/www-data/web2py/applications/$1/static/$2
<Directory /home/www-data/web2py/applications/*/static/>
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Order Allow,Deny
Allow from all
</Directory>
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
</VirtualHost>