You could get away with a trailing slash for a sub URL for mount point, where target is exact path for a WSGI script file, where the requested URL is exactly the mount point and with no trailing path info.
Thus you can have: WSGIScriptAlias /suburl/ /some/directory/file.wsgi but this will only work for the URL /suburl/. If you use /suburl/path then it will fail with a 404 in the browser and error: Target WSGI script not found or unable to stat: /some/directory/file.wsgipath in the Apache error log. You end up with this as Apache removes the mount point from the URL and puts that on the end of the target path, because it strips the '/' at end of mount point, when joining the path it gets mucked up. If you really need a trailing slash on the mount point, then you could technically use: WSGIScriptAlias /suburl/ /some/directory/file.wsgi/ In short the rule is that for a sub URL, if there is a trailing slash on one, there must be on the other. You cannot have it on one and not the other. Mount point at top of site, ie.. '/', is treated in a special way by mod_wsgi to avoid this requirement. If mod_wsgi hadn't treated it specially, you would need to use: WSGIScriptAlias / /some/directory/file.wsgi/ in much the same way you have to with ScriptAlias. I personally found that looked really silly and it gave lots of problems in FASTCGI solutions where people left it off, so I made the special allowance to make trailing slash on target WSGI script file optional for mount point of '/'. Graham On 20 October 2012 15:30, Jason Garber <[email protected]> wrote: > Hey Graham, > > I've typically mounted with trailing slash with no issues. > > Can you point out why it would sometimes work, or maybe a deeper > understanding of how WSGIScriptAlias actually works in apache. If you have > time, or a link. > > Thanks - this is something i'd like to have a better handle on. > > J > > On Oct 19, 2012 10:35 PM, "Graham Dumpleton" <[email protected]> > wrote: >> >> On 19 October 2012 06:41, Jason Garber <[email protected]> wrote: >> > 93 WSGIScriptAlias /api/callcenter/ >> > /home/jason/DevLevel.2/TCM/Web/MemberSite/api/callcenter/index.wsgi >> > 94 WSGIScriptAlias /mobile >> > /home/jason/DevLevel.2/TCM/Web/MemberSite/mobile/index.wsgi >> > >> > When requesting /mobile/login... >> > >> > If it is "/mobile/", then I receive the following message in my apache >> > error >> > log: >> > [Thu Oct 18 15:31:14 2012] [error] [client 192.168.50.229] Target WSGI >> > script not found or unable to stat: >> > /home/jason/DevLevel.2/TCM/Web/MemberSite/mobile/index.wsgilogin >> > >> > If it is "/mobile", then everything works fine. >> > >> > The strange part here is at the end of the error message, we have >> > "index.wsgilogin". If I change the request to "/mobile/foobarbaz", then >> > the >> > error ends with "index.wsgifoobarbaz" >> > >> > Is this a bug, or a feature? >> >> I would not expect any problem with /mobile/login. >> >> I actually would expect the problem you are describing with >> /api/callcenter/login however. >> >> When using WSGIScriptAlias and the target is a file, you should never >> use a trailing slash on the mount point. >> >> The only time a trailing slash should be use on mount point is if >> mounting at root of site, ie., '/', or the target is actually a >> directory and not a file. In this latter case, the target directory >> path should also have a trailing slash. >> >> You sure you were playing with trailing slash on the /mobile one? >> >> Graham >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
