[GH-ISSUE #664] documentation of web server integration (apache2) unclear #622

Closed
opened 2026-02-27 11:12:43 +03:00 by kerem · 2 comments
Owner

Originally created by @controlcde on GitHub (Jan 5, 2015).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/664

The docs for apache2 integration shows:

<VirtualHost *:80>
  ServerName <your value>
  DocumentRoot <path to your site's dir>

  Alias /media/ <path to your site's dir>/media/
  <Directory <path to your site's dir>/media>
    Order deny,allow
    Allow from all
  </Directory>

  Alias /sitestatic/ <path to your site's dir>/sitestatic/
  <Directory <path to your site's dir>/sitestatic>
    Order deny,allow
    Allow from all
  </Directory>

  WSGIScriptAlias / <path to your site's dir>/wsgi.py
</VirtualHost>

I know that we´ve discused earlier the irritation of the directory structure but it is unclear what <path to your site's dir> means. For example: if I installed Modoboa into /srv/mailadmin the following directory structure will set up:

  • /srv/mailadmin
    • manage.py
    • sitestatic
    • media
    • mailadmin
      • wsgi.py

So in the documentation <path to your site's dir> are different in WSGIScriptAlias and Directory, Aliases. And I don´t know how DocumentRoot should set up.

Originally created by @controlcde on GitHub (Jan 5, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/664 The docs for apache2 integration shows: ``` ApacheConf <VirtualHost *:80> ServerName <your value> DocumentRoot <path to your site's dir> Alias /media/ <path to your site's dir>/media/ <Directory <path to your site's dir>/media> Order deny,allow Allow from all </Directory> Alias /sitestatic/ <path to your site's dir>/sitestatic/ <Directory <path to your site's dir>/sitestatic> Order deny,allow Allow from all </Directory> WSGIScriptAlias / <path to your site's dir>/wsgi.py </VirtualHost> ``` I know that we´ve discused earlier the irritation of the directory structure but it is unclear what `<path to your site's dir>` means. For example: if I installed Modoboa into _/srv/mailadmin_ the following directory structure will set up: - /srv/mailadmin - manage.py - sitestatic - media - mailadmin - wsgi.py So in the documentation `<path to your site's dir>` are different in _WSGIScriptAlias_ and _Directory_, _Aliases_. And I don´t know how _DocumentRoot_ should set up.
kerem 2026-02-27 11:12:43 +03:00
Author
Owner

@stepps commented on GitHub (Jul 29, 2015):

This is my apache2 config on cento6 with virtualenv:

<VirtualHost *:80>
  ServerName mail.example.com
    DocumentRoot /var/www/modoboamail/

    Alias /media/ /var/www/modoboamail/media/
    Alias /sitestatic/ /var/www/modoboamail/sitestatic/

    <Directory /var/www/modoboamail/>
            Allow from all
            #for apache-2.2 use old style AllowOrder &co.
    </Directory>

    WSGIDaemonProcess mail.evtkmodoboa.com.ar processes=2 threads=15 display-name=%{GROUP} python-path=/var/www/modoboamail:/srv/p27ius/lib/python2.7/site-packages
    WSGIProcessGroup mail.evtkmodoboa.com.ar
    WSGIScriptAlias / /var/www/modoboamail/modoboamail/wsgi.py

    <Directory /var/www/modoboamail/modoboamail>
    <Files wsgi.py>
            Allow from all
    </Files>
    </Directory>

</VirtualHost>

I also needed to add the 2 following lines to apache main conf file:

 WSGISocketPrefix /var/run/wsgi
 WSGIPythonHome /srv/p27ius/

I have left the full paths to virtuialenv and the modoboa installation, it is probably clearer this way

<!-- gh-comment-id:126044259 --> @stepps commented on GitHub (Jul 29, 2015): This is my apache2 config on cento6 with virtualenv: ``` <VirtualHost *:80> ServerName mail.example.com DocumentRoot /var/www/modoboamail/ Alias /media/ /var/www/modoboamail/media/ Alias /sitestatic/ /var/www/modoboamail/sitestatic/ <Directory /var/www/modoboamail/> Allow from all #for apache-2.2 use old style AllowOrder &co. </Directory> WSGIDaemonProcess mail.evtkmodoboa.com.ar processes=2 threads=15 display-name=%{GROUP} python-path=/var/www/modoboamail:/srv/p27ius/lib/python2.7/site-packages WSGIProcessGroup mail.evtkmodoboa.com.ar WSGIScriptAlias / /var/www/modoboamail/modoboamail/wsgi.py <Directory /var/www/modoboamail/modoboamail> <Files wsgi.py> Allow from all </Files> </Directory> </VirtualHost> ``` I also needed to add the 2 following lines to apache main conf file: ``` WSGISocketPrefix /var/run/wsgi WSGIPythonHome /srv/p27ius/ ``` I have left the full paths to virtuialenv and the modoboa installation, it is probably clearer this way
Author
Owner

@Triloworld commented on GitHub (Dec 4, 2019):

I found multiple unclear situation in docs.

First:

  • Free port 80 as it is used by letsencrypt authorisation.
    It won't show error in installer (thats a bug). Entering domain and checking log won't be easy.
    Look for:

systemctl status nginx.service

It will show that isn't working because of no file "failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen("

  • Letsencrypt - by default is over DNS , not over HTTP so IP must be proper. No proxy.

  • Locate proper env variable

As in doc: https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html
I prefer command as is show correct path:

pip -V

Be sure that there is proper setting for line : WSGIDaemonProcess

<!-- gh-comment-id:561688822 --> @Triloworld commented on GitHub (Dec 4, 2019): I found multiple unclear situation in docs. First: - Free port 80 as it is used by letsencrypt authorisation. It won't show error in installer (thats a bug). Entering domain and checking log won't be easy. Look for: ` systemctl status nginx.service` It will show that isn't working because of no file "failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(" - Letsencrypt - by default is over DNS , not over HTTP so IP must be proper. No proxy. - Locate proper env variable As in doc: https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html I prefer command as is show correct path: `pip -V ` Be sure that there is proper setting for line : WSGIDaemonProcess
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#622
No description provided.