Hi Graham, thank-you for your reply.
1) wsgi.load
cat /etc/apache2/mods-available/wsgi.load
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
rajeev@cubi-ubuntu:~$ ldd /usr/lib/apache2/modules/mod_wsgi.so
linux-vdso.so.1 => (0x00007fffdf7af000)
libpython3.6m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
(0x00007f494f3a6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f494f189000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f494edbf000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f494eb96000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f494e97c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f494e778000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f494e575000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f494e26c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f494fca7000)
2) wsgi.conf
cat /etc/apache2/mods-available/wsgi.conf
<IfModule mod_wsgi.c>
#WSGIRestrictEmbedded on
WSGIPythonHome "/usr"
#This config file is provided to give an overview of the directives,
#which are only allowed in the 'server config' context.
#For a detailed description of all avaiable directives please read
#http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives
#WSGISocketPrefix: Configure directory to use for daemon sockets.
#
#Apache's DEFAULT_REL_RUNTIMEDIR should be the proper place for WSGI's
#Socket. In case you want to mess with the permissions of the directory,
#you need to define WSGISocketPrefix to an alternative directory.
#See http://code.google.com/p/modwsgi/wiki/ConfigurationIssues for more
#information
#WSGISocketPrefix /var/run/apache2/wsgi
#WSGIPythonOptimize: Enables basic Python optimisation features.
#
#Sets the level of Python compiler optimisations. The default is '0'
#which means no optimisations are applied.
#Setting the optimisation level to '1' or above will have the effect
#of enabling basic Python optimisations and changes the filename
#extension for compiled (bytecode) files from .pyc to .pyo.
#When the optimisation level is set to '2', doc strings will not be
#generated and retained. This will result in a smaller memory footprint,
#but may cause some Python packages which interrogate doc strings in some
#way to fail.
#WSGIPythonOptimize 0
#WSGIPythonPath: Additional directories to search for Python modules,
# overriding the PYTHONPATH environment variable.
#
#Used to specify additional directories to search for Python modules.
#If multiple directories are specified they should be separated by a ':'.
#WSGIPythonPath directory|directory-1:directory-2:...
#WSGIPythonEggs: Directory to use for Python eggs cache.
#
#Used to specify the directory to be used as the Python eggs cache
#directory for all sub interpreters created within embedded mode.
#This directive achieves the same affect as having set the
#PYTHON_EGG_CACHE environment variable.
#Note that the directory specified must exist and be writable by the user
#that the Apache child processes run as. The directive only applies to
#mod_wsgi embedded mode. To set the Python eggs cache directory for
#mod_wsgi daemon processes, use the 'python-eggs' option to the
#WSGIDaemonProcess directive instead.
#WSGIPythonEggs directory
#WSGIRestrictEmbedded: Enable restrictions on use of embedded mode.
#
#The WSGIRestrictEmbedded directive determines whether mod_wsgi embedded
#mode is enabled or not. If set to 'On' and the restriction on embedded
#mode is therefore enabled, any attempt to make a request against a
#WSGI application which hasn't been properly configured so as to be
#delegated to a daemon mode process will fail with a HTTP internal server
#error response.
#WSGIRestrictEmbedded On|Off
#WSGIRestrictStdin: Enable restrictions on use of STDIN.
#WSGIRestrictStdout: Enable restrictions on use of STDOUT.
#WSGIRestrictSignal: Enable restrictions on use of signal().
#
#Well behaved WSGI applications neither should try to read/write from/to
#STDIN/STDOUT, nor should they try to register signal handlers. If your
#application needs an exception from this rule, you can disable the
#restrictions here.
#WSGIRestrictStdin On
#WSGIRestrictStdout On
#WSGIRestrictSignal On
#WSGIAcceptMutex: Specify type of accept mutex used by daemon processes.
#
#The WSGIAcceptMutex directive sets the method that mod_wsgi will use to
#serialize multiple daemon processes in a process group accepting requests
#on a socket connection from the Apache child processes. If this directive
#is not defined then the same type of mutex mechanism as used by Apache for
#the main Apache child processes when accepting connections from a client
#will be used. If set the method types are the same as for the Apache
#AcceptMutex directive.
#WSGIAcceptMutex default
#WSGIImportScript: Specify a script file to be loaded on process start.
#
#The WSGIImportScript directive can be used to specify a script file to be
#loaded when a process starts. Options must be provided to indicate the
#name of the process group and the application group into which the script
#will be loaded.
#WSGIImportScript process-group=name application-group=name
#WSGILazyInitialization: Enable/disable lazy initialisation of Python.
#
#The WSGILazyInitialization directives sets whether or not the Python
#interpreter is preinitialised within the Apache parent process or whether
#lazy initialisation is performed, and the Python interpreter only
#initialised in the Apache server processes or mod_wsgi daemon processes
#after they have forked from the Apache parent process.
#WSGILazyInitialization On|Off
</IfModule>
3) FlaskApp.conf
cat /etc/apache2/sites-available/FlaskApp.conf
<VirtualHost *:83>
ServerName flaskapp.com
ServerAdmin [email protected]
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
<Directory /var/www/FlaskApp/FlaskApp/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I change change anything you advise and re-run/test….
—Rajeev
On Jun 23, 2018, at 3:00 PM, Graham Dumpleton <[email protected]>
wrote:
Would need to see the VirtualHost definition including what is in it.
Also, was that VirtualHost in its own file in the sites-available directory and
was it enabled so that it is linked into the sites-enabled directory and would
be found.
Graham
> On 24 Jun 2018, at 7:55 am, 'Rajeev Jain' via modwsgi
> <[email protected] <mailto:[email protected]>> wrote:
>
> background: my system is Ubuntu16.04 LTS running on a home network behind a
> firewall. Apache2 server is installed and successfully hosting 3 virtual
> hosts using ports 80, 81, 82. These 3 sites are working 100% fine. My
> objective is to setup a 4th virtual host using mod_wsgi for serving a
> python3.6 based Flask Application.
>
> After many trials and tribulations the 4th virtual host is now partially
> working...the site is successfully served when using the curl command but the
> site is not accessible when using a browser.
>
> Here is the tutorial I used:
> https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps
>
> <https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps>
>
>
> Here are my test results:
>
> Using curl:
> curl http://192.168.1.14:83 <http://192.168.1.14:83/>
> Hello, this is running from flasK!
>
>
> Using a browser:
>
> <PastedGraphic-1.png>
>
>
>
> I just rebooted my server and now the 4th virtual host is not even working
> with curl. Are there any out who have this desired configuration working?
>
> I relatively confident the python3.6 and the mod_wsgi modules are correctly
> installed and some configuration settings are not correct.
>
> Any guidance or trouble-shooting steps would be greatly appreciated. I’m
> happy to provide any kind of details required to get this working.
>
> TIA,
> —Rajeev
>
>
>
> --
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout
> <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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/modwsgi
<https://groups.google.com/group/modwsgi>.
For more options, visit https://groups.google.com/d/optout
<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.