Installing Mailman3 under a Python Virtual environment running on RHEL9
Hi, So tried, without much success, to get Postorius working on my Mailman3 server and every internet trick& tip I tried did not work so decided to take a new approach as recommended at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/P...
Used this reference: https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-depen... which I know is more for Debian/Ubuntu systems but I was hoping that 90%+ would also work with Red Hat. Fell at the first hurdle with no packages available called "python3-dev" or "python3-venv"
Is there anyone that has managed to install a running version of Mailman3 that has a working GUI whether it is on bare metal or Python virtual environment and if so, could they kindly let me know how they did it?? The closest I've come is a running command line version of Mailman3 which is fine for me of course but not for anyone else as they like access via web browser.
Thanks in advance,
Andy Macheta
Hi Should have probably mentioned by Pip and Python versions just in case: Python 3.9.18 pip 24.0
and the actual error message I'm getting when trying to go down the Python Virtual env route:
dnf install python3-dev No match for argument: python3-dev Error: Unable to find a match: python3-dev
dnf install python3-venv No match for argument: python3-venv Error: Unable to find a match: python3-venv
Which tells me that those packages are not in the Red Hat repos that I have currently configured:
dnf repolist epo id repo name epel Extra Packages for Enterprise Linux 9 - x86_64 epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 test-codeready-builder-for-rhel-9-x86_64-rpms test-codeready-builder-for-rhel-9-x86_64-rpms test-epel9-everything test-epel9-everything test-fluentbit test-fluentbit test-rhel-9-for-x86_64-appstream-rpms test-rhel-9-for-x86_64-appstream-rpms test-rhel-9-for-x86_64-baseos-rpms test-rhel-9-for-x86_64-baseos-rpms
Andy
On Tue, May 21, 2024 at 3:11 PM Andy Macheta <andy.macheta@gmail.com> wrote:
Hi Should have probably mentioned by Pip and Python versions just in case: Python 3.9.18 pip 24.0
and the actual error message I'm getting when trying to go down the Python Virtual env route:
dnf install python3-dev No match for argument: python3-dev Error: Unable to find a match: python3-dev
dnf install python3-venv No match for argument: python3-venv Error: Unable to find a match: python3-venv
Which tells me that those packages are not in the Red Hat repos that I have currently configured:
dnf repolist epo id repo name epel Extra Packages for Enterprise Linux 9 - x86_64 epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 test-codeready-builder-for-rhel-9-x86_64-rpms test-codeready-builder-for-rhel-9-x86_64-rpms test-epel9-everything test-epel9-everything test-fluentbit test-fluentbit test-rhel-9-for-x86_64-appstream-rpms test-rhel-9-for-x86_64-appstream-rpms test-rhel-9-for-x86_64-baseos-rpms test-rhel-9-for-x86_64-baseos-rpms
Andy
See my previous response. I have mentioned that we can chat on WhatsApp via +254732000004.
In the meantime, I suppose dnf allows you to search the same way yum does - as mentioned in the other email.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On Tue, May 21, 2024 at 2:44 PM Andy Macheta <andy.macheta@gmail.com> wrote:
Hi, So tried, without much success, to get Postorius working on my Mailman3 server and every internet trick& tip I tried did not work so decided to take a new approach as recommended at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/P...
Used this reference: https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-depen... which I know is more for Debian/Ubuntu systems but I was hoping that 90%+ would also work with Red Hat. Fell at the first hurdle with no packages available called "python3-dev" or "python3-venv"
The virtualenv method should work for all OSes, not just Debian/Ubuntu. I use it on FreeBSD too.
I have never touched RHEL, but Google-foo tells me that you need to do: yum install -y python3-devel
Alternatively, search for the package in yum , use the following command: yum search python3 | grep devel
You could also search for the venv one by: yum search python3 | grep env
Whatever else you'd need to install on the base OS, just use the above search method and install it. Feel free to post questions here if you aren't sure on what to install. The documentation - https://docs.mailman3.org/en/latest/install/virtualenv.html - requires you to install the following in the base OS: them too :)
- python3-dev python3-venv sassc lynx
- A database server - could be PostgreSQL or MySQL. You can search for
- An MTA - could be Postfix or Exim. Your choice.
- A webserver - could be Apache or Nginx
The challenge you're likely to face is probably to do with how to start the MM3 core and MM3 web services, but you can figure that out, no? Alternatively, just dump RHEL and use any Debian-based OS :)
Is there anyone that has managed to install a running version of Mailman3
that has a working GUI whether it is on bare metal or Python virtual environment and if so, could they kindly let me know how they did it?? The closest I've come is a running command line version of Mailman3 which is fine for me of course but not for anyone else as they like access via web browser.
Let's see if you can get this running in the next 3hrs. Do you use WhatsApp? Let's chat on +254732000004
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Thanks for tips; will certainly take a look and try.
"Alternatively, just dump RHEL and use any Debian-based OS" Hehe - I wish this was an option....but it unfortunately isn't :-(
Cheers
Andy
Hi Odhiambo, Well; looks like I'm much further on thanks to your tips - thanks!!
So now I can get my local web browser pointing at http://localhost:8000/mailman3/lists/ and I can see my test list. But, the webpage does not seem right, i.e. the text has loaded but not the images and wondering if anyone has any tips on how to resolve.
I've checked ownership/group ownership of the /opt/mailman/web/ directory and sub-directories and all is owned by mailman:mailman which I ?think it should be. Not sure what else to check/do as definitely not a web developer.
Thanks, Andy
On 5/22/24 11:16 AM, Andy Macheta wrote:
Hi Odhiambo, Well; looks like I'm much further on thanks to your tips - thanks!!
So now I can get my local web browser pointing at http://localhost:8000/mailman3/lists/ and I can see my test list. But, the webpage does not seem right, i.e. the text has loaded but not the images and wondering if anyone has any tips on how to resolve.
Did you do the 4 steps beginning at https://docs.mailman3.org/en/latest/install/virtualenv.html#run-database-mig...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi Mark,
Thanks; yes those 4 steps were performed. It looks like all the web pages are displaying is just text; so there's no background (apart from white) and no icons or graphics....almost like CCS is not being recognized perhaps.
Cheers Andy
On 5/22/24 11:31 AM, Andy Macheta wrote:
Hi Mark,
Thanks; yes those 4 steps were performed. It looks like all the web pages are displaying is just text; so there's no background (apart from white) and no icons or graphics....almost like CCS is not being recognized perhaps.
If pages are not styled and you have run the collectstatic and compress jobs, the most likely cause is your web server not finding the static/ directory. See https://docs.mailman3.org/en/latest/install/virtualenv.html#apache-configura... and check your Apache logs for 404s
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 2024/05/22 18:25, Mark Sapiro wrote:
On 5/22/24 11:31 AM, Andy Macheta wrote:
Hi Mark,
Thanks; yes those 4 steps were performed. It looks like all the web pages are displaying is just text; so there's no background (apart from white) and no icons or graphics....almost like CCS is not being recognized perhaps.
If pages are not styled and you have run the collectstatic and compress jobs, the most likely cause is your web server not finding the static/ directory. See https://docs.mailman3.org/en/latest/install/virtualenv.html#apache-configura... and check your Apache logs for 404s
I had the same issue with the reverse proxy. Here's my final working Debian apache2 virtualhost file:
jeff@maya:~$ cat /etc/apache2/sites-enabled/holeinthewall.conf <VirtualHost *:80> ServerName lists.holeinthewall.org.za ServerAlias mail.holeinthewall.org.za
# Redirect all HTTP traffic to HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}$1 [R=301,L] </VirtualHost>
<VirtualHost *:443> ServerAdmin webmaster@holeinthewall.org.za ServerName lists.holeinthewall.org.za
# Enable SSL/TLS SSLCertificateFile /etc/letsencrypt/live/holeinthewall.org.za/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/holeinthewall.org.za/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf
# Enable SSL proxying SSLProxyEngine On SSLProxyVerify None SSLProxyCheckPeerCN Off SSLProxyCheckPeerName Off SSLProxyCheckPeerExpire Off
# Preserve the Host header ProxyPreserveHost On
# Correct the domain in the Set-Cookie header from 127.0.0.1 to lists.holeinthewall.org.za ProxyPassReverseCookieDomain 127.0.0.1 lists.holeinthewall.org.za
# Serve static content directly from the filesystem DocumentRoot /opt/mailman/web/static Alias /static "/opt/mailman/web/static" <Directory "/opt/mailman/web/static"> Require all granted </Directory>
# Proxy configuration <Proxy *> Require all granted </Proxy>
# Ensure X-Forwarded-Proto is set correctly RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
# ProxyPass configuration for specific paths ProxyPass /static ! ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/ ProxyPass "/mailman3" "http://127.0.0.1:8000/mailman3" ProxyPass "/archives" "http://127.0.0.1:8000/archives" ProxyPass "/accounts" "http://127.0.0.1:8000/accounts" ProxyPass "/admin" "http://127.0.0.1:8000/admin" ProxyPass "/user-profile" "http://127.0.0.1:8000/user-profile"
# Logging ErrorLog /var/log/apache2/holeinthewall_error.log CustomLog /var/log/apache2/holeinthewall_access.log combined </VirtualHost>
HTH
--
Kind regards,
Jeff Brown
WildCoast WebWorx m: +27 74 101 5170 <tel:+27%2074%20101%205170> v: +27 87 550 1210 <tel:+27%2087%20550%201210> a: Hole in the Wall, South Africa w: www.wildcoast.com <http://www.wildcoast.com/> e: webmaster@wildcoast.com
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: homcljipmaiefjea.png
Replaced multipart/alternative part with first alternative.
On Wed, May 22, 2024 at 6:17 PM Andy Macheta <andy.macheta@gmail.com> wrote:
Hi Odhiambo, Well; looks like I'm much further on thanks to your tips - thanks!!
So now I can get my local web browser pointing at http://localhost:8000/mailman3/lists/ and I can see my test list. But, the webpage does not seem right, i.e. the text has loaded but not the images and wondering if anyone has any tips on how to resolve.
I've checked ownership/group ownership of the /opt/mailman/web/ directory and sub-directories and all is owned by mailman:mailman which I ?think it should be. Not sure what else to check/do as definitely not a web developer.
The web pages have already been developed for you :-)
What webserver are you using? Hopefully you can check the general log or you could log requests/errors specifically for your virtualhost and check those.
Also try: venv> mailman-web clear_cache
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
I thought the same and came to the conclusion that it might be the web server that is the issue. Webserver logs show nothing. Using RHEL9 default webserver which is Apache (Apache/2.4.57 (Red Hat Enterprise Linux)
Just cleared the cache but still the same:
(venv) [mailman@andy-test6:test:~]$ mailman-web clear_cache /opt/mailman/venv/lib64/python3.9/site-packages/networkx/utils/backends.py:135: RuntimeWarning: networkx backend defined more than once: nx-loopback backends.update(_get_backends("networkx.backends")) Cache "default" has been cleared! (venv) [mailman@andy-test6:test:~]$
On Wed, May 22, 2024 at 6:36 PM Andy Macheta <andy.macheta@gmail.com> wrote:
I thought the same and came to the conclusion that it might be the web server that is the issue. Webserver logs show nothing. Using RHEL9 default webserver which is Apache (Apache/2.4.57 (Red Hat Enterprise Linux)
Is it possible you can edit your vhost to write logs only for the MM3 vhost and increase the logging level? Something like this:
CustomLog /var/log/apache2/mm3-lists-access.log combined
ErrorLog /var/log/apache2/mm3-lists-error.log
LogLevel info
This can help us see some info on the webserver side.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
Just an update for you all as finally manage to get things working. Decided to start again from scratch with a new VM and going down the Python Virtual Env route as suggested by Odhiambo. It all works now as expected so it was either a typo by me in the original setup or the original VM was not as clean as I thought :-)
Thanks to Odhiambo, Mark and Jeff for all their input....defo would have not sorted without this of course!!!
Many thanks Andy Macheta
participants (4)
-
Andy Macheta
-
Mark Sapiro
-
Odhiambo Washington
-
Wild Coast