On Thu, Dec 22, 2022 at 8:02 PM Mark Sapiro <mark@msapiro.net> wrote:
On 12/22/22 03:49, Odhiambo Washington wrote:
My challenge now is to get Apache+mod_uwsgi to serve my pages,
I assume that's a typo. I.e, mod_wsgi, not mod_uwsgi.
That's right :)
but I am hitting the error below which has gotten me stuck. Thanking you in advance for your advice on how to overcome this.
...> [Thu Dec 22 14:21:23.041064 2022] [wsgi:error] [pid 4288] [remote
197.232.81.246:15107] ModuleNotFoundError: No module named 'settings'
Django can't import your settings.py. Is the directory that contains it in your Python path and does that directory contain (an empty) __init__.py?
Here is the VHOST... <CUT> vhost ---8< [00:53 mm ]$ less /usr/local/etc/apache24/Includes/mailman3-uwsgi.cf # mm3-lists.kictanet.or.ke
<VirtualHost *:80> ServerName mm3-lists.kictanet.or.ke ServerAdmin odhiambo@gmail.com Redirect permanent / https://mm3-lists.kictanet.or.ke
</VirtualHost>
# This goes in a global section.
WSGIDaemonProcess mailman-web display-name=mailman-web maximum-requests=1000 umask=0002 user=mailman group=mailman python-path=/opt/mailman/mm/venv/lib/python3.9/site-packages:/opt/mailman/mm/venv/lib/python3.9 python-home=/opt/mailman/mm/venv home=/opt/mailman/mm/var WSGIRestrictSignal Off
<VirtualHost *:443> ServerName mm3-lists.kictanet.or.ke ServerAdmin odhiambo@gmail.com
SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/cert.pem" SSLCertificateKeyFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/privkey.pem" SSLCertificateChainFile "/usr/local/etc/letsencrypt/live/ mm3-lists.kictanet.or.ke/chain.pem"
CustomLog /var/log/mm3-lists-access.log combined ErrorLog /var/log/mm3-lists-error.log LogLevel info
Alias /favicon.ico /opt/mailman/mm/static/hyperkitty/img/favicon.ico
# (I'm not sure that WSGIRestrictSignal Off is required, but it was in the # provided example so I kept it. I also made changes to WSGIDaemonProcess # based on my own mod_wsgi experience elsewhere.)
# This goes in the VirtualHost block for the domain.
# Mailman 3 stuff
Alias /static "/opt/mailman/mm/static"
<Directory "/opt/mailman/mm/static">
Require all granted
</Directory>
WSGIScriptAlias /mailman3 /opt/mailman/mm/wsgi.py
<Directory "/opt/mailman/mm/">
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
WSGIProcessGroup mailman-web
</Directory>
</VirtualHost> </CUT>
And here is the path - or maybe there is something I am missing in the VHOST?
[00:53 ~ ]$ cd /opt/mailman/mm/ [00:53 mm ]$ ls -al total 116 drwxr-xr-x 9 mailman mailman 512 Dec 22 13:54 . drwxr-xr-x 6 mailman mailman 512 Dec 21 07:54 .. -rw-r--r-- 1 mailman mailman 0 Sep 29 2021 __init__.py drwxr-xr-x 2 mailman mailman 512 Dec 22 14:18 __pycache__ -rw-r--r-- 1 mailman mailman 15574 Dec 20 18:16 _settings.py drwxr-xr-x 3 mailman mailman 512 Dec 20 19:47 bin drwxr-xr-x 5 mailman mailman 512 Dec 8 10:32 etc drwxr-xr-x 2 mailman mailman 1536 Dec 21 11:54 fulltext_index -rw-r--r-- 1 mailman mailman 317 Dec 21 16:53 gunicorn.conf lrwxr-xr-x 1 mailman mailman 13 Dec 21 16:55 gunicorn.conf.py -> gunicorn.conf -rw-r--r-- 1 mailman mailman 0 Dec 5 18:10 init.py lrwxr-xr-x 1 mailman mailman 24 Dec 5 17:38 logs -> /opt/mailman/mm/var/logs -rw-r--r-- 1 mailman mailman 592 Oct 2 2021 mailman-crontab -rw-r--r-- 1 mailman mailman 409 Dec 20 16:32 mailman-hyperkitty.cfg -rw-r--r-- 1 mailman mailman 1330 Dec 20 16:24 mailman.cfg -rw-r--r-- 1 mailman mailman 183 Dec 2 15:17 main.py -rwxr-xr-x 1 mailman mailman 243 Sep 29 2021 manage.py -rw-r--r-- 1 mailman mailman 510 Dec 11 14:11 modify-db.sql -rw-r--r-- 1 mailman mailman 15844 Dec 22 14:18 settings.py -rw-r--r-- 1 mailman mailman 6622 Dec 22 11:27 settings_local.py drwxr-xr-x 10 mailman mailman 512 Dec 5 17:38 static -rw-r--r-- 1 mailman mailman 1453 Dec 20 16:32 urls.py -rw-r--r-- 1 mailman mailman 1266 Dec 22 13:55 uwsgi.ini drwxr-xr-x 12 mailman mailman 512 Dec 22 14:21 var drwxr-xr-x 7 mailman mailman 512 Dec 6 15:35 venv -rw-r--r-- 1 mailman mailman 1173 Sep 29 2021 wsgi.py
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)