Thank you Graham for your response. Always helpful.
>From my virtualenv I can run mod_wsgi-express start-server, and see malt
whiskey at localhost:8000.
My goal would be to just have the mod run when apache starts, so the box
can stay running, and folks can access the Django website when they need to
(although it's only for local access, and we're behind a firewall and only
using http).
So I'm thinking the manually configured apache approach is what I need to
do. I tried elevating to root and running mod_wsgi-express install-module:
(myenv) [root@localhost bin]# ./mod_wsgi-express install-module
LoadModule wsgi_module "/usr/lib64/httpd/modules/
mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so"
On fedora34, that copes the library to:
/etc/httpd/modules
In fedora34 I have httpd directories (all under root ownership):
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.modules.d
/etc/httpd/logs
/etc/httpd/modules
/etc/httpd/run
/etc/httpd/state
I'm confused about where to place the config file(s) which contains the
httpd directives such as LoadModule wsgi_module, WSGIPythonHome,
WSGIDaemonProcess, etc. as well as directory permissions and any virtual
host setup.
On fedora34:
/etc/httpd/conf/ contains the general httpd.conf file
/etc/httpd/conf.d is for individual app config files? ex. mod_dnssd.conf,
php.conf etc.
"The directory is used in addition to the directory
/etc/httpd/conf.modules.d/, which contains
configuration files necessary to load modules."
/etc/httpd/conf.modules.d is for two-digit, numbered .conf files, ex.
10-mod_dnssd.conf, etc.
"This directory contains configuration fragments necessary only to
load modules.
Administrators should use the directory "/etc/httpd/conf.d" to modify
the configuration of httpd, or any modules."
vhosts seems to be in a weird place on Fedora (also under root ownership):
/usr/share/doc/httpd/httpd-vhosts.conf
Regards,
Bob
On Tue, Jun 8, 2021 at 12:47 PM Graham Dumpleton <[email protected]>
wrote:
> If the intent is to use mod_wsgi-express to host the application, you
> don't need to install the module into the system wide Apache using
> "install-module".
>
> One you have run pip install, run:
>
> mod_wsgi-express start-server
>
> and verify it starts. Then use mod_wsgi-start start-server with your
> application as explained in:
>
> http://blog.dscpl.com.au/2015/04/introducing-modwsgi-express.html
> http://blog.dscpl.com.au/2015/04/integrating-modwsgi-express-as-django.html
> http://blog.dscpl.com.au/2015/05/using-modwsgi-express-as-development.html
>
> https://www.youtube.com/watch?v=CPz0s1CQsTE&t=7s
>
> If you really want to go the way of manually configuring the system Apache
> for mod_wsgi instead, the "install-module" command will only work if done
> as root, so you need to use "sudo" to run it.
>
> Graham
>
> On 9 Jun 2021, at 5:20 am, Bob Bobsled <[email protected]> wrote:
>
> Hi Graham,
>
> OK. I did that. (I was hoping to avoid virtualenv, since django is the
> only main python app I'm using on that fedora box, but glad to set one up
> if that helps).
> I do have a conflict with the django port for another web app, however. A
> couple years ago you helped me thru a django setup on a windows box using
> wamp,
> where you suggested nip.io for the conflict problem. That seemed to work
> okay, but I haven't been able to get it worked out on the fedora box yet
> because
> still struggling with mod_wsgi part.
>
> From the activated virtualenv the mod_wsgi-express install-module command
> is still giving me a permission error on /usr/lib64...
>
> On fedora I have one user, refstudent who is admin. My /opt directory and
> contents are all under the refstudent user and group and chmod 777
> permission
> on /opt and all contents. /home is under root, but /home/refstudent is
> under refstudent user and group with 777 permission on all contents.
> Everything else on the box is under root. My django website is in
> /var/www/html/mysite.
>
>
> (myenv) [refstudent@localhost myenv]$ mod_wsgi-express install-module
> Traceback (most recent call last):
> File "/opt/myenv/bin/mod_wsgi-express", line 33, in <module>
> sys.exit(load_entry_point('mod-wsgi==4.8.0', 'console_scripts',
> 'mod_wsgi-express')())
> File
> "/opt/myenv/lib64/python3.9/site-packages/mod_wsgi/server/__init__.py",
> line 3830, in main
> cmd_install_module(args)
> File
> "/opt/myenv/lib64/python3.9/site-packages/mod_wsgi/server/__init__.py",
> line 3766, in cmd_install_module
> shutil.copyfile(where(), target)
> File "/usr/lib64/python3.9/shutil.py", line 264, in copyfile
> with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
> PermissionError: [Errno 13] Permission denied: '/usr/lib64/httpd/modules/
> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so'
>
> Regards,
> Bob
>
> On Mon, Jun 7, 2021 at 3:01 PM Graham Dumpleton <
> [email protected]> wrote:
>
>> You seem to have multiple installs conflicting with each other. Would
>> suggest ensuring you uninstall all the mod_wsgi versions installed in
>> different ways.
>>
>> Once that is done, create a Python virtual environment instead, activate
>> it and pip install mod_wsgi into that. Don't install into system Python or
>> per user Python.
>>
>> When have cleaned up and removed existing installs and tried the virtual
>> environment method come back and indicate what problem you have at that
>> point.
>>
>> Graham
>>
>> On 8 Jun 2021, at 10:57 am, Bob Bobsled <[email protected]> wrote:
>>
>> Hello Graham,
>>
>> I have tried unsuccessfully to get mod-wsgi working for Django, and httpd
>> on fedora34.
>>
>> I tried the CMMI method first, downloading/configuring/make/install, but
>> the instructions give out at the point of knowing what to do after getting
>> the module into etc/httpd/modules. I'm stuck figuring out how to continue
>> with where to place a .config file and how to fiddle with vhosts etc.
>>
>> So I moved on to dnf install python3-mod_wsgi, but that seems to be an
>> older version and doesn't have the niceties of mod_wsgi-express.
>>
>> Then I tried, as root, pip3 install mod_wsgi, but that seems to bugger
>> the permissions.
>>
>> Fourth try was as user pip3 install --user mod_wsgi but it seems to put
>> everything in odd places.
>> For ex. mod_wsgi-express winds up in .local/bin, instead of usr/bin,
>> but nevertheless when I run it from .loca/bin with the install-module
>> directive I get permission denied on /usr/lib64/modules/
>> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so
>>
>> I'd be really grateful for some advice on the best way to get it working
>> in fedora34. I'm glad to try anyway you might suggest.
>>
>> Regards,
>> Bob
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/modwsgi/CALWZDaN7J95EeTVJdty1wobGZ44X_q2utuJv%3DnmXEzVgqNhZQQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaN7J95EeTVJdty1wobGZ44X_q2utuJv%3DnmXEzVgqNhZQQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/modwsgi/FD746244-F6E1-444D-9835-298914C02712%40gmail.com
>> <https://groups.google.com/d/msgid/modwsgi/FD746244-F6E1-444D-9835-298914C02712%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/CALWZDaND20Qb0pdYnQn2B%3DrLH-%3Dwy70H8qpkaF11xn3_jza5yA%40mail.gmail.com
> <https://groups.google.com/d/msgid/modwsgi/CALWZDaND20Qb0pdYnQn2B%3DrLH-%3Dwy70H8qpkaF11xn3_jza5yA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/F763222A-02BA-456E-8DE1-C09878A3CC00%40gmail.com
> <https://groups.google.com/d/msgid/modwsgi/F763222A-02BA-456E-8DE1-C09878A3CC00%40gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/modwsgi/CALWZDaO9e4Nm-zgVUHKrxYYkEGp5hSf1WVGmMs40dN89UMkfJA%40mail.gmail.com.