Hi Graham, I checked, and nip.io was working with my other local sites, so I gave that a shot again and I finally got the /etc/httpd/conf.d/mod_wsgi.conf page configured to show the django site.
Thanks for your help and guiding me thru the process with mod_wsgi on fedora. Regards, Bob On Mon, Jun 21, 2021 at 1:26 PM Graham Dumpleton <[email protected]> wrote: > You can't use "localhost" for ServerName or ServerAlias either. > > If you have multiple sites you are trying to host yet don't have proper > distinct hostnames for each, then everything would need to be in one > VirtualHost. > > How many VirtualHost definitions do you have? > > BTW, one way around the issue is to use nip.io hostnames. > > Eg., > > <VirtualHost *:80> > ServerName myothersite.XXX.XXX.107.165.nip.io > WSGIScriptAlias / "/var/www/html/test_app/test_app/wsgi.py" > WSGIDaemonProcess test_app python-home=/opt/myenv > python-path=/var/www/html/test_app > WSGIProcessGroup test_app > ... > </VirtualHost> > > That way you can have multiple VirtualHost definitions and each is > accessed using different hostname, where each site is hosted at root of > site and not a sub URL, where the URL in this case would be: > > http://myothersite.XXX.XXX.107.165.nip.io > > This is a much better way of handling it. > > See the nip.io site to see how it works. Do be ware though that some > corporate networks may block it from working. > > Graham > > On 22 Jun 2021, at 6:08 am, Bob Bobsled <[email protected]> wrote: > > Hi Graham, > Thank you for your continued help. > > I'm still a bit stuck on the virtualhost configuration re: IP address. > Under /var/www/html I have several small websites being served, but only > one django using mod_wsgi. > We typically access them locally, behind a firewall using IP and website > name in the URL of the browser. Ex. XXX.XXX.107.165/MyOtherSite. > > In /etc/httpd/conf directory in the http.conf file I have > Listen 80 > > But regarding ServerName and ServerAlias, I have only > > $ hostname > localhost.localdomain > or > $ hostname -i > ::1 127.0.0.1 > > I'd rather avoid using localhost in the virtualhost config because the > django site is typically accessed by other client machines. > > Thus I would have thought in the /etc/httpd/conf.d configuration file: > <VirtualHost *:80> > (and omit ServerName, and ServerAlias) > > would have given it to me. > > So I also tried, just as a test: > <VirtualHost *:80> > ServerName localhost > ServerAlias localhost > > and tried to access the django app using URL > localhost:8000/test_app > or > 127.0.0.1:8000/test_app > > But still no joy > > My selinux is disabled > and > the ports have been added to firewalld > firewall -cmd --zone=public --permanent --add-port=80/tcp > firewall -cmd --zone=public --permanent --add-port=8000/tcp > > I can't imagine what's continuing to block the django app from apache. > > Regards, > Bob > > > On Fri, Jun 18, 2021 at 4:48 PM Graham Dumpleton < > [email protected]> wrote: > >> Neither ServerName or ServerAlias should be an IP address. If you don't >> have a proper hostname, ensure you are adding the configuration to the >> first/default VirtualHost. >> >> Your configuration if you want it mounted at sub URL path should then be: >> >> WSGIScriptAlias /test_app "/var/www/html/test_app/test_app/wsgi.py" >> >> WSGIDaemonProcess test_app python-home=/opt/myenv >> python-path=/var/www/html/test_app >> >> WSGIProcessGroup test_app >> >> >> You don't include host IP in WSGI mount point sub URL path. >> >> Your path for the WSGI script file wasn't quoted properly. >> >> You don't include site-packages in Python path but set home for Python >> virtual environment instead. >> >> For details on using virtual environments see: >> >> >> https://modwsgi.readthedocs.io/en/master/user-guides/virtual-environments.html >> >> Graham >> >> On 19 Jun 2021, at 10:35 am, Bob Bobsled <[email protected]> wrote: >> >> Hi Graham, >> Yes, not sure why fedora has two dirs for apache modules. one in >> /usr/lib64/httpd and the other in /etc/httpd/modules...both have same >> contents. >> >> My django app (test_app) is located in /var/www/html >> >> /var/www/html/test_app, and the project within test_app is just called >> test_app too. >> >> I can see it in the browser using the development server by activating >> the virtualenv, cd'ing to /var/www/html/test_app >> and running >> >python manage.py runserver >> or alternately >> >python manage.py runmodwsgi >> >> then go to the browser and enter >> localhost:8000 >> to see the django rocket >> or >> localhost:8000/admin >> to see the admin login page >> >> But when I try to run the test_app as production server by going to the >> browser and typing >> XXX.XXX.107.165/test_app (get 403 forbidden, you don't have >> permission...) >> or >> XXX.XXX.107.165/test_app/admin (get 404 URL not found on the server) >> >> >> Below is my mod_wsgi.conf file from /etc/httpd/conf.d. I couldn't find >> any other place for vhost, so I'm thinking it goes in the same file. >> >> Ownership and group of virtualenv is refstudent (me), with permissions >> 777 recursively >> Ownership and group of /var/www/html is root:root >> Ownership and group of test_app is apache:apache (recursively throughout) >> with permissions 777 throughout the app. >> >> ======================= >> #/etc/http/conf.d/mod_wsgi.conf >> >> WSGIPythonHome "/opt/myenv" >> >> <VirtualHost *:80> >> ServerName XXX.XXX.107.165 >> ServerAlias XXX.XXX.107.165 >> DocumentRoot /var/www/html >> >> WSGIScriptAlias /XXX.XXX.107.165/test_app >> "/var/www/html/test_app/test_app/wsgi.py> >> >> WSGIDaemonProcess test_app >> python-path=/var/www/html/test_app:/opt/myenv/lib/python3.9/site-packages:/opt/myenv/lib64/python3.9/site-packages >> >> WSGIProcessGroup test_app >> >> <directory /var/www/html/test_app> >> AllowOverride all >> Require all granted >> Options FollowSymlinks >> </directory> >> >> Alias /static/ /var/www/html/test_app/static/ >> >> <Directory /var/www/html/test_app/static> >> Require all granted >> </Directory> >> </VirtualHost> >> >> Alias /static /var/www/html/test_app/static >> >> <Directory /var/www/html/test_app/static> >> Require all granted >> </Directory> >> >> <Directory "/var/www/html/test_app/test_app/"> >> <Files wsgi.py> >> Require all granted >> </Files> >> >> </Directory> >> Alias /robots.txt /var/www/html/test_app/static/robots.txt >> Alias /favicon.ico /var/www/html/test_app/static/favicon.ico >> >> Alias /media/ /var/www/html/test_app/media/ >> Alias /static/ /var/www/html/test_app/static/ >> >> <Directory /var/www/html/test_app/static> >> Require all granted >> </Directory> >> >> <Directory /var/www/html/test_app/media> >> Require all granted >> </Directory> >> >> ============================= >> excerpt from settings.py in test_app >> >> ALLOWED_HOSTS = ["localhost", "127.0.0.1", "XXX.XXX.107.165"] >> >> # Application definition >> INSTALLED_APPS = [ >> 'django.contrib.admin', >> 'django.contrib.auth', >> 'django.contrib.contenttypes', >> 'django.contrib.sessions', >> 'django.contrib.messages', >> 'django.contrib.staticfiles', >> 'mod_wsgi.server', >> ] >> >> >> >> >> >> Regards, >> Bob >> >> >> >> >> >> On Thu, Jun 17, 2021 at 2:59 PM Graham Dumpleton < >> [email protected]> wrote: >> >>> >>> >>> On 18 Jun 2021, at 5:06 am, Bob Bobsled <[email protected]> wrote: >>> >>> Hi Graham, >>> >>> Thanks very much for your help and guidance. >>> >>> I no longer have any system installed package for mod_wsgi, and I did >>> add the 2-digit 10-mod_wsgi fallback LoadModule because I thought it was >>> needed for the Apache configuration. Since, as you wrote, that's the early >>> load of the module, then I commented out the LoadModule in >>> /etc/httpd/conf.d/mod_wsgi.conf, so now I should only have the one >>> LoadModule statement for Apache. >>> >>> If I'm understanding correctly then using root (su) to run >>> mod_wsgi-express install-module is what places the module not only in the >>> virtualenv but also in >>> /usr/lib64/httpd/modules >>> and also copies it to >>> /etc/httpd/modules >>> >>> >>> Not correct. >>> >>> Running: >>> >>> pip install mod_wsgi >>> >>> builds the mod_wsgi Apache .so module file and installs it in the >>> virtual environment (if one is used), or in system Python directory (if no >>> virtual environment). >>> >>> Running: >>> >>> sudo mod_wsgi-express install-module >>> >>> only copies the the mod_wsgi Apache .so module file to the single >>> directory where Apache modules are installed. >>> >>> If you have the installed .so file appearing in two different Apache >>> modules directories, then the directories are either symlinked, or one of >>> modules has got there in some other way. >>> >>> Note that instead of using install-module you could have run: >>> >>> mod_wsgi-express module-config >>> >>> which all it does is output config to include in the Apache >>> configuration file where modules are loaded. The config lines it outputs >>> will use the mod_wsgi Apache .so module file from the location in the >>> virtual environment rather than having it be copied to Apache module >>> directory. >>> >>> I'm trying to make sure the mod_wsgi is working properly because I have >>> some URL errors on the Django side, and I want to eliminate mod_wsgi from >>> the debug equation. >>> >>> >>> It would have been quicker just to post the Django app errors if Django >>> is running. There are common mistakes one can make as to how you setup >>> WSGIScriptAlias, how Django settings are setup, plus wrong assumptions your >>> application makes about web site mount point, working directory, directory >>> access when running under Apache and various other things. It is usually >>> evident from the Python errors and stack traces what problem is. >>> >>> So post the errors from the Apache error log and browser, plus the >>> mod_wsgi configuration from Apache. As far as I can see you haven't posted >>> yet your WSGIScriptAlias, WSGIDaemonProcess, WSGI??? configurations you are >>> including in the Apache configuration, so have no idea how you have >>> configured it. >>> >>> Also read: >>> >>> >>> https://modwsgi.readthedocs.io/en/master/user-guides/application-issues.html >>> >>> but post the above information first as can probably stop you going >>> around in circles if you explain the errors and actual problem at this >>> point rather than assuming it might be somewhere else. >>> >>> One major point though, since you are running: >>> >>> python manage.py runmodwsgi >>> >>> you don't even need to configure the system Apache, so not sure why you >>> are doing that. >>> >>> If you are trying to run mod_wsgi-express (or manage.py runmodwsgi) >>> locally, that is completely different from system Apache configuration, so >>> just show the errors you are getting. >>> >>> I know I chose the route of having Apache host the app using mod_wsgi, >>> but as a test that I have mod_wsgi and apache configured correctly I'm >>> trying the steps below (avoiding nip.io, for now). Does this, then >>> indicate I have it configured and talking to the app? Is so, I can forget >>> the mod_wsgi configuration bits and move on to debugging the Django side >>> before getting back to trying to run it as production server app. Or is >>> there a better way to verify mod_wsgi is configured properly and working >>> with Apache? >>> >>> > httpd -M >>> shows module is loaded >>> >>> then activate the virtualenv and cd to my app >>> /var/www/html/myapp >>> >>> elevate to root (su) and run >>> python manage.py collectstatic >>> >>> then de-elevate back to admin user and run >>> python manage.py runmodwsgi >>> >>> which shows server is running at localhost:8000/ >>> >>> then opened the browser and went to: >>> localhost:8000/myapp >>> >>> and see my URL errors on the Django side. >>> >>> Thank you, >>> Bob >>> >>> >>> >>> >>> >>> On Tue, Jun 15, 2021 at 7:00 PM Graham Dumpleton < >>> [email protected]> wrote: >>> >>>> Do you still have a system package for mod_wsgi installed? >>>> >>>> If that was uninstalled, likely the file 10-mod_wsgi.conf wouldn't >>>> exist unless you manually added it. >>>> >>>> Anyway, the LoadModule for wsgi_module should only be in one place, >>>> likely a file in /etc/http/conf.modules.d to ensure it is loaded early. If >>>> you don't have a system package for mod_wsgi you would need to create that >>>> file yourself. >>>> >>>> On 16 Jun 2021, at 11:07 am, Bob Bobsled <[email protected]> >>>> wrote: >>>> >>>> >>>> *And did you try using the config output by install-module instead?* >>>> (myenv) [refstudent@localhost bin]$ mod_wsgi-express install-module >>>> PermissionError: [Errno 13] Permission denied: >>>> '/usr/lib64/httpd/modules/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so' >>>> >>>> then (su) >>>> (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" >>>> WSGIPythonHome "/opt/myenv" >>>> >>>> *What do you get for: ls -las >>>> /usr/lib64/httpd/modules/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so >>>> <http://mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so/>* >>>> 1128 -rwxr-xr-x 1 root root 1153984 Jun 15 14:33 >>>> /usr/lib64/httpd/modules/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so >>>> >>>> ----- >>>> Seems like the LoadModule bit pointing to the virtualenv will work in >>>> my /etc/http/conf.modules.d dir in the 10-mod_wsgi.conf file: >>>> >>>> <IfModule !wsgi_module> >>>> #LoadModule wsgi_module modules/ >>>> mod_wsgi_py39.cpython-39-x86_64-linux-gnu.so XXX >>>> LoadModule wsgi_module "/usr/lib64/httpd/modules/ >>>> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so" >>>> </IfModule> >>>> >>>> But in my /etc/http/conf.d dir, in the mod_wsgi.conf file (the place >>>> for WSGIPythonHome, WSGIDaemonProcess, WSGIScriptAlias, and VirtualHosts >>>> etc.) I also have another >>>> LoadModule statement: >>>> LoadModule wsgi_module "/usr/lib64/httpd/modules/ >>>> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so" >>>> >>>> I would have thought once wsgi-express install-module put it in >>>> /etc/http/modules >>>> and the > httpd -M command shows the module (wsgi_module (shared)) >>>> loaded, that it would be good to go, but it seems like I need include call >>>> LoadModule from the wsgi.conf file again, and then have the fallback in >>>> 10-mod_wsgi.conf in case somehow it doesn't get loaded in the first place. >>>> >>>> I feel like I'm inching closer to getting it working. >>>> >>>> Regards, >>>> Bob >>>> >>>> >>>> On Mon, Jun 14, 2021 at 3:10 PM Graham Dumpleton < >>>> [email protected]> wrote: >>>> >>>>> And did you try using the config output by install-module instead? >>>>> >>>>> LoadModule wsgi_module "/usr/lib64/httpd/modules/ >>>>> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so" >>>>> WSGIPythonHome "/opt/myenv" >>>>> >>>>> >>>>> What do you get for: >>>>> >>>>> ls -las /usr/lib64/httpd/modules/ >>>>> mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so >>>>> >>>>> >>>>> Graham >>>>> >>>>> On 15 Jun 2021, at 10:36 am, Bob Bobsled <[email protected]> >>>>> wrote: >>>>> >>>>> Hi Graham, >>>>> re: f34, problem getting httpd to load the module via the >>>>> /etc/httpd/conf.modules.d directory which has a 10-mod_wsig.conf file >>>>> place >>>>> there which says: >>>>> >>>>> 5 <IfModule !wsgi_module> >>>>> 6 LoadModule wsgi_module modules/ >>>>> mod_wsgi_py39.cpython-39-x86_64-linux-gnu.so >>>>> 7 </IfModule> >>>>> >>>>> --What were the actual lines that the install-module command output? >>>>> >>>>> *(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" >>>>> WSGIPythonHome "/opt/myenv" >>>>> >>>>> --Also, what are the exact messages that Apache outputs in the error >>>>> log when failing to load it? >>>>> >>>>> *[root@localhost conf.modules.d]# service httpd restart* >>>>> Job for httpd.service failed because the control process exited with >>>>> error code. >>>>> See "systemctl status httpd.service" and "journalctl -xe" for details. >>>>> >>>>> *[root@localhost conf.modules.d]# systemctl status httpd.service* >>>>> httpd: Syntax error on line 59 of /etc/httpd/conf/httpd.conf: Syntax >>>>> error on line 6 of /etc/httpd/conf.modules.d/10-mod_wsgi.conf: Cannot load >>>>> modules/mod_wsgi_py39.cpython-39-x86_64-linux-gnu.so: cannot open >>>>> shared object file: No such file or directory >>>>> >>>>> Thanks, >>>>> Bob >>>>> >>>>> On Thu, Jun 10, 2021 at 12:28 PM Graham Dumpleton < >>>>> [email protected]> wrote: >>>>> >>>>>> What were the actual lines that the install-module command output? It >>>>>> would not have been written as that but should have used an absolute >>>>>> path I >>>>>> think, plus may have had a WSGIPythonHome directive as well if mod_wsgi >>>>>> were installed into a Python virtual environment. >>>>>> >>>>>> Also, what are the exact messages that Apache outputs in the error >>>>>> log when failing to load it? >>>>>> >>>>>> Graham >>>>>> >>>>>> On 11 Jun 2021, at 5:22 am, Bob Bobsled <[email protected]> >>>>>> wrote: >>>>>> >>>>>> Hi Graham, >>>>>> Unraveling the fedora httpd sub directories is actually not too bad. >>>>>> But the problem I'm having is getting httpd to load the module via the >>>>>> /etc/httpd/conf.modules.d directory which has a 10-mod_wsig.conf file >>>>>> place >>>>>> there which says: >>>>>> >>>>>> <IfModule !wsgi_module> >>>>>> LoadModule wsgi_module modules/ >>>>>> mod_wsgi_py39.cpython-39-x86_64-linux-gnu.so >>>>>> </IfModule> >>>>>> >>>>>> httpd keeps saying it cannot load the module, however it is there >>>>>> because mod_wsgi-express copied it there. >>>>>> >>>>>> I tried maybe finding a SONAME for the .so file, but there doesn't >>>>>> seem to be one, so I'm not sure what it's hung up on with the naming >>>>>> conventions. I also set permissions consistent with the other modules. >>>>>> >>>>>> Regards, >>>>>> Bob >>>>>> >>>>>> On Wed, Jun 9, 2021 at 11:43 AM Graham Dumpleton < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Not much I can do to help you with where you should put config when >>>>>>> using system Apache of a specific operating system. CentOS/RHEL, Fedora >>>>>>> and >>>>>>> Debian/Ubuntu all set different requirements on where to place things >>>>>>> and I >>>>>>> am not familiar with how each does it. Unless someone else on the list >>>>>>> can >>>>>>> help with how Fedora does it, best I can suggest is you look at the >>>>>>> Fedora >>>>>>> documentation which I would hope explains it. >>>>>>> >>>>>>> Graham >>>>>>> >>>>>>> On 10 Jun 2021, at 4:52 am, Bob Bobsled <[email protected]> >>>>>>> wrote: >>>>>>> >>>>>>> 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 >>>>>>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaO9e4Nm-zgVUHKrxYYkEGp5hSf1WVGmMs40dN89UMkfJA%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/A8B8D4CE-FECF-4AFB-8D7B-B2CE644BF7D4%40gmail.com >>>>>>> <https://groups.google.com/d/msgid/modwsgi/A8B8D4CE-FECF-4AFB-8D7B-B2CE644BF7D4%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/CALWZDaMC5aPhFv8s9yUJ7CGbZ0oxZmmPXJOSG0W3V%3DMmiKbRaQ%40mail.gmail.com >>>>>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaMC5aPhFv8s9yUJ7CGbZ0oxZmmPXJOSG0W3V%3DMmiKbRaQ%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/272FA905-4CC5-4397-9F5F-DCAF961A402E%40gmail.com >>>>>> <https://groups.google.com/d/msgid/modwsgi/272FA905-4CC5-4397-9F5F-DCAF961A402E%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/CALWZDaPPuadiPCE68EokWU1wWcKzsbEWs5Tn%3DWJ3_wshoE6%2BUQ%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaPPuadiPCE68EokWU1wWcKzsbEWs5Tn%3DWJ3_wshoE6%2BUQ%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/28F1B098-B816-4C58-9928-CFD2038656C4%40gmail.com >>>>> <https://groups.google.com/d/msgid/modwsgi/28F1B098-B816-4C58-9928-CFD2038656C4%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/CALWZDaMyiqd%3DABiU0KBfZo5NF7zWu52KufHXYXFvfX13qWm_2w%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaMyiqd%3DABiU0KBfZo5NF7zWu52KufHXYXFvfX13qWm_2w%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/6ED3B3FE-8614-4D23-9ACE-A2482191A44D%40gmail.com >>>> <https://groups.google.com/d/msgid/modwsgi/6ED3B3FE-8614-4D23-9ACE-A2482191A44D%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/CALWZDaNPmnGQGk%3Di9WWU2pihUy8KqBa6Pv8YbNQe-RxeqZoXXA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/modwsgi/CALWZDaNPmnGQGk%3Di9WWU2pihUy8KqBa6Pv8YbNQe-RxeqZoXXA%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/B624EDAD-7BF0-46D3-8E69-A657E4E21EDD%40gmail.com >>> <https://groups.google.com/d/msgid/modwsgi/B624EDAD-7BF0-46D3-8E69-A657E4E21EDD%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/CALWZDaMuBuTLKx-pJsFkBz80coJsOJvZzm_%3Dz1gJqPFnouS%3D_w%40mail.gmail.com >> <https://groups.google.com/d/msgid/modwsgi/CALWZDaMuBuTLKx-pJsFkBz80coJsOJvZzm_%3Dz1gJqPFnouS%3D_w%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/54CD5708-FEC0-47C9-8747-AE23D43E16A9%40gmail.com >> <https://groups.google.com/d/msgid/modwsgi/54CD5708-FEC0-47C9-8747-AE23D43E16A9%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/CALWZDaO3gUO3KOqxcqVw2JDg-y6ur6TwWw6%2BK%3D_P_TSyBEg_Xw%40mail.gmail.com > <https://groups.google.com/d/msgid/modwsgi/CALWZDaO3gUO3KOqxcqVw2JDg-y6ur6TwWw6%2BK%3D_P_TSyBEg_Xw%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/8418F27C-8896-48E1-BF7B-44941C217FD7%40gmail.com > <https://groups.google.com/d/msgid/modwsgi/8418F27C-8896-48E1-BF7B-44941C217FD7%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/CALWZDaO3nx%2BZPCCB8dYN%2BoUQ-%2BG9D7x_HoM6ieHXgdiJfKVAFA%40mail.gmail.com.
