Alias / /home/web2py/applications/
## setup WSGI
WSGIScriptAlias / /home/web2py/wsgihandler.py
WSGIDaemonProcess web2py user=www-data group=www-data
home=/home/web2py/ 12 processes=10 maximum-requests=500
But this installs web2py at the root of the server. You can of course do:
WSGIScriptAlias /web2py /home/web2py/wsgihandlder.py
But then all your URL() calls on longer work, since they become
http://server/controller/function.
Anyone struggled with this before?
Mark
Thanks Yarko.
It still has the troublesome line:
WSGIScriptAlias / /home/[YOUR ACCOUNT]/webapps/apachewsgi/web2py/wsgihandler.py
Which essentially tells apache to handle anything coming at the root
of the server through the wsgihandler.py
I did figure out a hack if anyone comes up against this problem:
RewriteEngine on
RewriteRule ^/[NAMEOFAPP](.*)$ /web2py/[NAMEOFAPP]$1 [PT,L]
WSGIScriptAlias /web2py /opt/web2py/wsgihandler.py
This essentially allows you to place web2py outside of root.
Mod_Rewrite then rewrites the URLs to fix what would be broken URLs so
when URL() function writes:
it becomes:
http://server/web2py/nameofapp
The PT (pass-through) directive ensures the users does not see the rewriten URL.
Thanks,
Mark
I am trying to set up web2py alongside a php-site behind apache and
came across this thread. I have tried to modify the configuration
file created by Massimo's Ubuntu setup script using the above hint of
a RewriteRule but it works only partially:
I get the index page without the layout and css and no subsequent pages.
I would appreciate some help to get this working.
In the log I get:
[Sat Feb 13 21:34:30 2010] [error] [client 196.36.153.134] File does
not exist: /var/www/sadec
[Sat Feb 13 21:34:42 2010] [error] [client 196.36.153.134] File does
not exist: /var/www/sadec, referer:
http://kbase.sun.ac.za/web2py/sadec
The web2py stuff is in /home/www-data/web2py.
My configuration:
NameVirtualHost *:443
WSGIDaemonProcess web2py user=www-data group=www-data
WSGIProcessGroup web2py
RewriteEngine on
RewriteRule ^/[NAMEOFAPP](.*)$ /web2py/[NAMEOFAPP]$1 [PT,L]
WSGIScriptAlias /web2py /home/www-data/web2py/wsgihandler.py
<VirtualHost *:80>
<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/>
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 /web2py /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/>
Order Allow,Deny
Allow from all
</Directory>
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
</VirtualHost>
Regards
Johann
I wanted to have web2py in a subdirectory off of my main page;
http://www.rppowell.com/web2py/
Here is what I put in my .htaccess:
RewriteEngine On
RewriteRule ^dispatch\.fcgi/ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]
(this is similar to the WSGIScriptAlias configuration)
I had to then fix the URLs generated by web2py to put in the '/
web2py/' directory.
I rename routes.example.py (in web2py directory) to routes.py and
edit:
routes_out=(('/(?P<a>.*)','/web2py/\g<a>'),)
-rppowell
I got errors with that setup but when I tried changing the following
it worked with no Apache errors:
VirtualHost *:80>
WSGIDaemonProcess web2py user=www-data group=www-data display-name=%
{GROUP}
To be this:
VirtualHost *:80>
WSGIDaemonProcess web2py user=www-data group=www-data
lets Apache run with no error...
On Feb 13, 2:47 pm, Johann Spies <johann.sp...@gmail.com> wrote:
On Feb 15, 9:31 am, Christopher Steel <chris.st...@gmail.com> wrote:
> This is a "reprint" from web2pyslice located here ->http://www.web2pyslices.com/main/slices/take_slice/29and a comment I
In our new documentation scheme would this become a comment in the now
online book?
C
On Feb 15, 11:10 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I am changing this in trunk. I run into the same problem. The new
> script also prompts you for the admin password.
>
> On Feb 15, 9:31 am, Christopher Steel <chris.st...@gmail.com> wrote:
>
> > This is a "reprint" from web2pyslice located here ->http://www.web2pyslices.com/main/slices/take_slice/29anda comment I
On Feb 16, 6:42 am, Christopher Steel <chris.st...@gmail.com> wrote:
> Thanks,
>
> In our new documentation scheme would this become a comment in the now
> online book?
>
> C
>
> On Feb 15, 11:10 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > I am changing this in trunk. I run into the same problem. The new
> > script also prompts you for the admin password.
>
> > On Feb 15, 9:31 am, Christopher Steel <chris.st...@gmail.com> wrote:
>
> > > This is a "reprint" from web2pyslice located here ->http://www.web2pyslices.com/main/slices/take_slice/29andacomment I