They are separate WSGI applications and when iam trying to run them directly in browser i get:
[Fri Sep 07 11:44:07.438696 2018] [wsgi:error] [pid 19469] [remote 46.103.174.201:7359] [2018-09-07 11:44:07,438] ERROR in app: Exception on /clientele.py [GET] [Fri Sep 07 11:42:08.911817 2018] [wsgi:error] [pid 19469] [remote 46.103.174.201:7336] [2018-09-07 11:42:08,911] ERROR in app: Exception on /downloads.py [GET] while if i try to run them withe the flask development server they work as expected. Στις Παρ, 7 Σεπ 2018 στις 2:18 π.μ., ο/η Graham Dumpleton < [email protected]> έγραψε: > > > On 7 Sep 2018, at 12:56 am, Νίκος Βέργος <[email protected]> > wrote: > > I just noticed that although 'app.py' is loading the other 2 scripts > cannot laod the same way as this one although we now have 2 separated > process for each script. > > Error is: The server encountered an internal error and was unable to > complete your request. Either the server is overloaded or there is an error > in the application. > > > Are clientele.py and download.py separate WSGI applications, or just > modules to be used by app.py? > > If the latter, you only want: > > WSGIDaemonProcess app user=nikos group=nikos threads=5 > WSGIScriptAlias / /home/nikos/public_html/app.py process-group=app > application-group=%{GLOBAL} > > but change it to: > > WSGIDaemonProcess app user=nikos group=nikos threads=5 > WSGIScriptAlias / /home/nikos/public_html/app.py process-group=app > application-group=%{GLOBAL} python-path=/home/nikos/public_html > > so app.py can import them. That is what python-path option does, by > telling Python where the modules are to be imported. > > If that isn't issue, you need to look at the Apache error log to see what > the error is. > > Τη Πέμπτη, 6 Σεπτεμβρίου 2018 - 3:24:51 μ.μ. UTC+3, ο χρήστης Graham > Dumpleton έγραψε: >> >> >> >> On 6 Sep 2018, at 2:51 pm, Νίκος @ SuperHost <[email protected]> >> wrote: >> >> When i moved the contents form vhosts.conf to httpd.conf it worked right >> away!! 2 questions. >> >> 1. If i put the contents back to vhosts.conf and create a new subdomain >> like 'nikos.superhost.gr' then i could only access my webpage as ' >> http://nikos.superhost.gr' >> >> >> Correct. >> >> Becouse i want to access it only as 'http://superhost.gr' nto with >> subdomain in front >> >> >> So it must be part of the existing VirtualHost with that ServerName. >> > >> 2. I have 3 scripts inside 'public_html'. Is this the right way to >> configure to run them through mod_wsgi or there is a more general way so i >> dont have an each line for every script? >> >> WSGIDaemonProcess public_html user=nikos group=nikos processes=1 threads=5 >> WSGIScriptAlias / /home/nikos/public_html/app.py >> WSGIScriptAlias /clientele /home/nikos/public_html/clientele.py >> WSGIScriptAlias /downloads /home/nikos/public_html/downloads.py >> >> This will not work as written because the first one for '/' will match >> first with higher precedence that sub URLs, you need to reverse the order. >> >> It also may not work because you are setting WSGIApplicationGroup to >> fixed value. This means all will be run in same interpreter context and >> thus may interfere with each other. Better to use: >> >> <Directory /home/nikos/public_html> >> AllowOverride None >> Require all granted >> </Directory> >> >> WSGIDaemonProcess downloads user=nikos group=nikos threads=5 >> WSGIScriptAlias /downloads /home/nikos/public_html/downloads.py >> process-group=downloads application-group=%{GLOBAL} >> >> WSGIDaemonProcess clientele user=nikos group=nikos threads=5 >> WSGIScriptAlias /clientele /home/nikos/public_html/clientele.py >> process-group=clientele application-group=%{GLOBAL} >> >> WSGIDaemonProcess app user=nikos group=nikos threads=5 >> WSGIScriptAlias / /home/nikos/public_html/app.py process-group=app >> application-group=%{GLOBAL} >> >> This way each is own process. >> >> You don't need to set WSGIScriptReloading as that is enabled by default. >> >> The above is recommended over trying to run in same process group in >> different interpreter contexts (application group), as some Python packages >> will not work in sub interpreters. By using different daemon process >> groups, you can force main interpreter context (%{GLOBAL%}) and so ensure >> you don't have such issues. >> > <Directory /home/nikos/public_html> >> WSGIProcessGroup public_html >> WSGIApplicationGroup %{GLOBAL} >> WSGIScriptReloading On >> >> AllowOverride None >> Require all granted >> </Directory> >> >> >> Στις Πέμ, 6 Σεπ 2018 στις 2:38 π.μ., ο/η Graham Dumpleton < >> [email protected]> έγραψε: >> >> I don't see anything in this email to confirm that you have done things I >>> previously suggested you do. >>> >>> 1. No indication that you are successfully using Include directive to >>> include httpd-vhosts.conf into the main Apache configuration file. >>> >>> 2. No indication that you have correct LoadModule line in the main >>> Apache configuration. Running ``mod_wsgi-express install-module`` does not >>> modify the main Apache configuration file, it only shows what you need to >>> add. It should be added just after existing LoadModule lines in the main >>> Apache configuration file. >>> >>> 3. You are still using ServerName with value superhost.gr when I told >>> you that because you had an existing VirtualHost for post 80 with the same >>> ServerName, that the existing one would be used and not this one. You would >>> have to create a new sub domain for use with this if want a separate site >>> where the WSGI application runs at the root of the site. >>> >>> Since you are having so may issues with having the second VirtualHost, >>> to make it easier to understand and identify where you are missing things, >>> add the configuration inside of your existing VirtualHost in the main >>> Apache configuration file. That is, add: >>> >>> WSGIDaemonProcess public_html user=nikos group=nikos processes=1 >>> threads=5 >>> WSGIScriptAlias /mypythonapp /home/nikos/public_html/app.py >>> >>> <Directory /home/nikos/public_html> >>> WSGIProcessGroup public_html >>> WSGIApplicationGroup %{GLOBAL} >>> WSGIScriptReloading On >>> >>> AllowOverride None >>> Require all granted >>> </Directory> >>> >>> Note that I have changed the first argument of WSGIScriptAlias to >>> '/mypythonapp'. >>> >>> This means when you make a web request, you should use: >>> >>> http://superhost.gr/mypythonapp >>> >>> Note that I am travelling this week for work, so expect slow responses. >>> >>> Graham >>> >>> On 6 Sep 2018, at 1:24 am, Νίκος Βέργος <[email protected]> wrote: >>> >>> ================= >>> httpd-vhosts.conf >>> ================= >>> >>> <VirtualHost *:80> >>> ServerName superhost.gr >>> >>> ServerAdmin [email protected] >>> >>> >>> WSGIDaemonProcess public_html user=nikos group=nikos processes=1 >>> threads=5 >>> WSGIScriptAlias / /home/nikos/public_html/app.py >>> >>> <Directory /home/nikos/public_html> >>> WSGIProcessGroup public_html >>> WSGIApplicationGroup %{GLOBAL} >>> WSGIScriptReloading On >>> >>> AllowOverride None >>> Require all granted >>> </Directory> >>> >>> #ErrorLog /home/nikos/public_html/logs/error.log >>> </VirtualHost> >>> >>> >>> [root@superhost BACKUP]# chmod -R 755 /home/nikos/ >>> chmod: changing permissions of ‘/home/nikos/fcgi-bin/php7.3.fcgi’: >>> Operation not permitted >>> >>> [root@superhost BACKUP]# ls -ld /home/nikos/ >>> drwxr-xr-x 13 nikos nikos 4096 Sep 5 15:31 /home/nikos/ >>> >>> [root@superhost BACKUP]# chmod -R 755 /home/nikos/ >>> chmod: changing permissions of ‘/home/nikos/fcgi-bin/php7.3.fcgi’: >>> Operation not permitted >>> [root@superhost BACKUP]# ls -ld /home/nikos/ >>> drwxr-xr-x 13 nikos nikos 4096 Sep 5 15:31 /home/nikos/ >>> >>> >>> I Removed both mod_wsgi and python36u-mod_wsgi as well. I installed yum >>> install httpd-devel to get rid of the 'apsx' issue. Here is the results of >>> the express install. >>> >>> [root@superhost public_html]# >>> mod_wsgi-express install-module >>> LoadModule wsgi_module "/usr/lib64/httpd/modules/ >>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so" >>> WSGIPythonHome "/usr" >>> >>> Do you make anyhting out of it as to why still cannot load my wsgi file? >>> I'm still getting the forbidden error.... :-( >>> >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> >>> >>> Visit this group at https://groups.google.com/group/modwsgi. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "modwsgi" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/modwsgi/4sM5QIitIyI/unsubscribe. >>> >> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To post to this group, send email to [email protected]. >> >> >>> Visit this group at https://groups.google.com/group/modwsgi. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> >> >> Visit this group at https://groups.google.com/group/modwsgi. >> For more options, visit https://groups.google.com/d/optout. >> >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "modwsgi" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/modwsgi/4sM5QIitIyI/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
