On 14 March 2013 10:42, Mauro Brambilla <bbl...@yahoo.com> wrote: > Dear Graham, > > you hit my nistake: I add into browser the WSGIScritpAlias mounting point > and several scripts can be called from html page. > Honestly I did not understand how such WSGIScriptAlias directive work with > URL/path; is the rule copy WSGIScriptAlias mounting poit into browser URL > before script file name? >
The mounting point needs to be the first part of the path in the URL entered into the browser, but when using WSGIScriptAlias, the script file name has got nothing to do with the URL. What is after the mount point is dictated by what the WSGI application expects. If using Django for example, it would be determined by the routing rules specified in the urls.py file. > Following are note issues but mere notes of points that are note clear to > me but are not disturbing: trailing or not into WSGIScriptsDirective the > scripts are always found and worked out; scripts work whichever is their > extension .wsgi or .py or even .xyz; browser shows path from site root to > script file, now it is not important for my purpose but can this path be > hidden? > For the WSGI script file, they extension is technically nor important. For mod_wsgi it is recommended that .wsgi be used, because it emphasises that it isn't quite the same as a normal Python module although you can more or less put in it whatever you can put in a Python module. Avoiding .py is also recommended because some Apache distributions ship with a config which maps .py file CGI scripts and in some cases that can cause conflicts which makes mod_wsgi not work if a .py extension was used for the WSGI script file. Graham > > Finally I can start python server script with mod_wsgi using bottle as you > suggested in a former post, any suggestion about IDE? > > Thank you again!!! > Mauro > > Il giorno martedì 12 marzo 2013 23:43:05 UTC+1, Graham Dumpleton ha > scritto: >> >> And what happens in your browser if you use '/myapp' as the URL? >> >> Neither of what you are using will work as you have: >> >> WSGIScriptAlias /myapp /home/mypc/www/site1/myapp/**script1.wsgi >> >> which therefore requires URL to start with '/myapp' which what follows >> being what the WSGI application needs. Should be a case where >> 'script1.wsgi' would ever be used in the URL. >> >> Graham >> >> >> On 11 March 2013 23:17, Mauro Brambilla <bbl...@yahoo.com> wrote: >> >>> I tried putting either >>> >>> <a href="script1.wsgi"> This is a link to script1.wsgi </a> into page >>> index2.html >>> >>> or >>> >>> site1/script1.wsgi into address box of firefox >>> >>> >>> Il giorno martedì 12 marzo 2013 05:45:00 UTC+1, Graham Dumpleton ha >>> scritto: >>> >>>> What URL are you putting in the browser to try and access your WSGI >>>> application? >>>> >>>> Graham >>>> >>>> >>>> On 11 March 2013 19:00, Mauro Brambilla <bbl...@yahoo.com> wrote: >>>> >>>>> Dear Graham, >>>>> >>>>> Thank you for your kind and quick reply. >>>>> >>>>> I restarted with a clean ubuntu 12.04 and then I installed Apache 2.2, >>>>> now the configuration is >>>>> >>>>> Ubuntu 12.04 >>>>> Apache 2.2.24 >>>>> python2.7, >>>>> mod_wsgi 3.4 >>>>> I changed the "Require all granted" with the apache2.2 syntax and the >>>>> script is executed. >>>>> but the problem is always the same: if in WSGIScriptAlias directive >>>>> the URL is "/", the script is always executed and it prevails over the >>>>> DocumentRoot directive, as expected, in whichever directory of the file >>>>> systema the script is placed (of course <Directory> and path are >>>>> consistent >>>>> with script1.wsgi location). If in WSGIScriptAlias directive the URL is >>>>> anything else than "/", the DocumentRoot is always used, in fact in the >>>>> error log the script path is the the path of DocumentRoot directive. >>>>> >>>>> For example if the wsgi scritpt1.wsgi is in the directory >>>>> /home/mypc/www/site1/myapp the WSGIScriptAlias /myapp/ >>>>> /home/mypc/www/site1/myapp/ is ignored, I'm expected to find in the error >>>>> log at least this path, even a wrong path, but not the DocumentRoot path >>>>> ... >>>>> >>>>> >>>>> Where else can I look for solving this problem? >>>>> >>>>> Thyank you again for your support >>>>> >>>>> >>>>> Il giorno venerdì 1 marzo 2013 08:09:56 UTC+1, Graham Dumpleton ha >>>>> scritto: >>>>> >>>>>> Can you use Apache 2.2 instead? >>>>>> >>>>>> This is now the second report, although for a complete different sort >>>>>> of problem, which suggests some sort of data corruption happening in >>>>>> Apache >>>>>> 2.4. >>>>>> >>>>>> Graham >>>>>> >>>>>> >>>>>> On 1 March 2013 06:03, Mauro Brambilla <bbl...@yahoo.com> wrote: >>>>>> >>>>>>> dear Graham, >>>>>>> I would like to enter intothe python server script with mod_wsgi but >>>>>>> I'm facing a fence that is stopping my steps. >>>>>>> >>>>>>> I'm not capable to use WSGIScriptAlias. >>>>>>> I use >>>>>>> Ubuntu 12.04 >>>>>>> Apache 2.4. >>>>>>> mod_wsgi 3.4 >>>>>>> They run because they aswer but I cannot master file directories. >>>>>>> >>>>>>> my virtual host configuration is the following: >>>>>>> >>>>>>> <VirtualHost 127.1.1.3:80> >>>>>>> >>>>>>> ServerName site1 >>>>>>> ServerAlias site1 >>>>>>> ServerAdmin webmaster@site1 >>>>>>> >>>>>>> DocumentRoot "/home/mypc/www/site1/htdocs" >>>>>>> >>>>>>> <Directory "/home/mypc/www/site1/htdocs"> >>>>>>> Options Indexes FollowSymLinks >>>>>>> AllowOverride None >>>>>>> Require all granted >>>>>>> DirectoryIndex index2.html >>>>>>> </Directory> >>>>>>> >>>>>>> WSGIDaemonProcess site1 processes=2 threads=15 >>>>>>> display-name=%{GROUP} >>>>>>> WSGIProcessGroup site1 >>>>>>> WSGIScriptAlias /myapp /home/mypc/www/site1/myapp/**scr**** >>>>>>> ipt1.wsgi >>>>>>> <Directory "/home/mypc/www/site1/myapp"> >>>>>>> AllowOverride None >>>>>>> Require all granted >>>>>>> </Directory> >>>>>>> LogLevel debug >>>>>>> ErrorLog "/home/mypc/www/site1/logs/**err****or_log" >>>>>>> CustomLog "/home/mypc/www/site1/logs/**acc****ess_log" combined >>>>>>> </VirtualHost> >>>>>>> >>>>>>> The wsgi scritp is in the directory /home/mypc/www/site1/myapp >>>>>>> >>>>>>> If I mount the scrippt in the root, i.e. >>>>>>> WSGIScriptAlias / /home/mypc/www/site1/myapp/**scr****ipt1.wsgi >>>>>>> it works as expected: scritp1.wsgi is always served, as explained in >>>>>>> the mod_wsgi documentation, and page index2.html cannot be served. >>>>>>> >>>>>>> I wish start site1 with index2.html as default page and therefore I >>>>>>> try to mount the script (I wish to place other scripts in this >>>>>>> directory) >>>>>>> in myapp directory with the following iinsturction >>>>>>> >>>>>>> WSGIScriptAlias /myapp /home/mypc/www/site1/myapp/**scr****ipt1.wsgi >>>>>>> or >>>>>>> WSGIScriptAlias /myapp/ /home/mypc/www/site1/myapp/ >>>>>>> or >>>>>>> WSGIScriptAlias /myapp /home/mypc/www/site1/myapp >>>>>>> but >>>>>>> there is no way to serve the script; error log file shows that when >>>>>>> I call script1 the searching path is "/home/mypc/www/site1/htdocs/** >>>>>>> s****cript1.wsgi" i.e DocumentRoot directory. >>>>>>> >>>>>>> It think that I respect your examples in configuration instruction >>>>>>> but it seems that if scripts is not mounted in the server root the >>>>>>> directive WSGIScritpAlias is ignored and DocumentRoot always prevails. >>>>>>> >>>>>>> Where I'm wrong? >>>>>>> >>>>>>> Thank you for your help! >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "modwsgi" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to modwsgi+u...@**googlegroups.com. >>>>>>> To post to this group, send email to mod...@googlegroups.com. >>>>>>> >>>>>>> Visit this group at http://groups.google.com/**group**** >>>>>>> /modwsgi?hl=en <http://groups.google.com/group/modwsgi?hl=en>. >>>>>>> For more options, visit https://groups.google.com/**grou**** >>>>>>> ps/opt_out <https://groups.google.com/groups/opt_out>. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "modwsgi" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to modwsgi+u...@**googlegroups.com. >>>>> To post to this group, send email to mod...@googlegroups.com. >>>>> Visit this group at >>>>> http://groups.google.com/**group**/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en> >>>>> . >>>>> For more options, visit >>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out> >>>>> . >>>>> >>>>> >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "modwsgi" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to modwsgi+u...@**googlegroups.com. >>> To post to this group, send email to mod...@googlegroups.com. >>> Visit this group at >>> http://groups.google.com/**group/modwsgi?hl=en<http://groups.google.com/group/modwsgi?hl=en> >>> . >>> For more options, visit >>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>> . >>> >>> >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to modwsgi+unsubscr...@googlegroups.com. > To post to this group, send email to modwsgi@googlegroups.com. > Visit this group at http://groups.google.com/group/modwsgi?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+unsubscr...@googlegroups.com. To post to this group, send email to modwsgi@googlegroups.com. Visit this group at http://groups.google.com/group/modwsgi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.