Skip to content
Advertisement

Ubuntu Modoboa from NGINX to APACHE2: HttpS 403 forbidden while HTTP is correctly accessible. (mod_WSGI)

Resources:

  • LINUX UBUNTU 20.04
  • Apache/2.4.41 (Ubuntu) Server Port 443
  • Certbot verified HTTPS.
  • Latest version of Modoboa installed by the tutorial of mod_wsgi (sudo apt-get install libapache2-mod-wsgi-py3)
  • in HTTP the sites loads of Modoboa and is accessible (so this means python3 installation all good everything working fine in Apache2).

Problem:

Things I tried to solve the problem so far: In /srv, I have executed $ sudo chmod -R 777 modoboa.

But this error is still there, as in it is only through HTTP accessible but not through HTTPS URL. Does anyone know why? Since I cannot login in HTTP because of security reasons, I need to use HTTPS for the mail server.

The conf file is like this: 😀

<VirtualHost *:80>
  ServerName mail.domain.nl
  ServerAlias www.mail.domain.nl
  DocumentRoot /srv/modoboa/instance/

  Alias /media/ /srv/modoboa/instance/media/
  <Directory /srv/modoboa/instance/media>
    Order deny,allow
    Allow from all
    Require all granted
  </Directory>

  Alias /sitestatic/ /srv/modoboa/instance/sitestatic/
  <Directory /srv/modoboa/instance/sitestatic>
    Order deny,allow
    Allow from all
    Require all granted
  </Directory>

  WSGIScriptAlias / /srv/modoboa/instance/instance/wsgi.py

  <Directory "/srv/modoboa/instance">
   Order allow,deny
   Allow from all
   Require all granted
  </Directory>

   WSGIDaemonProcess mail.domain.nl python-path=/srv/modoboa/instance/:/srv/modoboa/env/lib/python3.8/site-packages
   WSGIProcessGroup mail.domain.nl

  # Pass Authorization header to enable API usage:
  WSGIPassAuthorization On
</VirtualHost>

Oh and domain.nl is a placeholder for publishing this document, in reality it has the domain which I use the webserver on :D.


Some emotional background story :D:D:D:D:D: I am new to Linux, I have always been a fanboy of Windows because I didn’t understand Linux (you know hate the unknown). Since few months at my Student Association, there is one guy a diehard Linux fan and he pushed us to use Linux for our website. Since then I found it actually very comfortable, since it was also way more cheaper than Windows server I decided to use it. I have multiple WordPress websites hosted at APACHE2 in UBUNTU 20.04, I would also like to have my own mail server and MODOBOA is verrrry beautiful upon installing, everything worked fine in NGINX but I tried to host it on APACHE2 (since I turned off apache2 while it was installing to see that it works in NGINX), after executing that sudo command to install mod_wsgi the site is accessible at HTTP but not in HTTPS.

Advertisement

Answer

Seems like you only have a vhost listening on port 80. You need to create another vhost and have it listen on 443 which is HTTPS.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement