1

Topic: /iredmail and /mail inoperable on my domain

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 12.04 LTS
- Related log if you're reporting an issue: N/A
====

Good evening.  I am a new iRedMail user, and I must say I am quite impressed.  I think I hosed myself up the other night and now can't figure out how to undo it.

I finally bit the bullet last week and took steps necessary to host my own domain.  That includes web and mail.  I was playing around with subdomains on my machine, trying to create one for myself.  After that, my /iredadmn and /mail links stopped working!  I have been looking at this off and on for about 36 hours now.  I can't see why it's broken, nor can I figure out how to fix it.

There's nothing of any use I can find in any log file...

Any help would be greatly appreciated!!

Thanks in advance!
Chris
http://www.familypages.net
mail.familypages.net

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: /iredmail and /mail inoperable on my domain

Please show us related error log in web browser and Apache log file, and show us what settings you changed.

3

Re: /iredmail and /mail inoperable on my domain

So I worked on this over the weekend, made some progress:

  1. /mail now works, but ONLY with the trailing slash (/mail/).

  2. /iredadmin still won't work, but now I get a 404 error when I try "/iredadmin" --> putting the trailing slash changes the error to 403... and if I specify to open "iredadmin.py" in the link, I get the text of the file - like the Python interpreter is not working properly.

I put everything in debug and tried to hit iredadmin.  Here's the only useful log info that popped up:

https://app.box.com/s/ahqpnjgncdgieb2b7sxv

Here's what I see on my screen when I specify to open iredadmin.py:

#!/usr/bin/env python # Author: Zhang Huangbin  import os import sys rootdir = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, rootdir) from libs import iredbase # Initialize webpy app. app = iredbase.app if __name__ != '__main__': # Run app under Apache + mod_wsgi. application = app.wsgifunc() else: # Starting webpy builtin http server. app.run()

Thanks again!!
Chris

4

Re: /iredmail and /mail inoperable on my domain

Please refer to file /etc/apache2/conf.d/iredadmin.conf to get iRedAdmin working. Please also show us your new Apache config file which configures iRedAdmin.

5

Re: /iredmail and /mail inoperable on my domain

iredadmin.conf:


WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin

AddType text/html .py

<Directory /usr/share/apache2/iredadmin/>
    Order allow,deny
    Allow from all
</Directory>

apache2.conf

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
# It is also possible to omit any default MIME type and let the
# client's browser guess an appropriate action instead. Typically the
# browser will decide based on the file's extension then. In cases
# where no good assumption can be made, letting the default MIME type
# unset is suggested  instead of forcing the browser to accept
# incorrect  metadata.
#
DefaultType None


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel debug

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/
# MySQL auth (libapache2-mod-auth-apache2).
# Global config of MySQL server, username, password.
Auth_MySQL_Info 127.0.0.1 vmail xxxx
Auth_MySQL_General_DB vmail
# MySQL auth (libapache2-mod-auth-apache2).
# Global config of MySQL server address, username, password.
Auth_MySQL_Info 127.0.0.1 vmail xxxx
Auth_MySQL_General_DB vmail

6

Re: /iredmail and /mail inoperable on my domain

Did you modify any Apache configurations? Show us please.

7

Re: /iredmail and /mail inoperable on my domain

Here is everything I did as contained in my history pertaining to creating the subdomain before iRedAdmin stopped working:

 1459  cd /etc/apache2/sites-available/
 1460  ls 
 1461  vi chris.familypages.net
 1462  a2ensite chris.familypages.net
 1463  a2enmod vhost_alias
 1464  service apache2 restart
 1465  mkdir /home/civey/www
 1466  chown civey:civey /home/civey/www/
 1467  ls -al /home/civey
 1468  chmod 777 /home/civey/www/
 1469  vi /etc/hosts
 1470  vi /home/civey/www/index.html
 1471  cp /etc/apache2/sites-available/default /etc/apache2/sites-available/chris.familypages.net
 1472  vi chris.familypages.net
 1473  ls
 1474  a2ensite chris.familypages.net
 1475  which a2ensite
 1476  ls /usr/sbin/a2*
 1477  /usr/sbin/a2dissite chris.familypages.net
 1478  service apache2 reload
 1479  a2ensite chris.familypages.net
 1480  service apache2 reload
 1481  vi /etc/hosts
 1482  cat chris.familypages.net
 1483  vi chris.familypages.net
 1484  a2ensite chris.familypages.net
 1485  a2dissite chris.familypages.net
 1486  service apache2 reload
 1487  a2ensite chris.familypages.net
 1488  service apache2 reload
 1489  vi /etc/apache2/httpd.conf
 1490  find / -name httpd.conf -ls
 1491  ls
 1492  a2dissite chris.familypages.net
 1493  service apache2 reload
 1494  rm chris.familypages.net
 1495  vi cfpn
 1496  mv cfpn chris
 1497  a2ensite chris
 1498  service apache2 relstart
 1499  service apache2 restart
 1500  vi /etc/apache2/apache2.conf
 1501  vi chris
 1502  service apache2 restart
 1503  man dig
 1504  history | grep dig
 1505  dig -t a chris.familypages.net

I have new info as well.  If I launch "python iredadmin.py", I can connect to it on localhost:8080, so the issue appears to be when coming from internet.  Also, I wrote a "hello world" python script and put it in the iredadmin directory.  When I launch to that .py file, I get the same results as with iredadmin.py - the code spits out, like there's no interpreter.

Thanks again!!

8

Re: /iredmail and /mail inoperable on my domain

chris_ivey wrote:

1471  cp /etc/apache2/sites-available/default /etc/apache2/sites-available/chris.familypages.net

Show us file /etc/apache2/sites-available/chris.familypages.net please.

9

Re: /iredmail and /mail inoperable on my domain

The original file you are asking about was subsequently deleted, but here is what took it's place:

root@OgreOdor://etc/apache2/sites-available# more chris
<VirtualHost *:8008>
DocumentRoot /home/civey/www/
ServerName chris.familypages.net
    <Directory /home/civey/www/>
        Options Indexes FollowSymLinks MultiViews +Includes
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Thanks again!!

10

Re: /iredmail and /mail inoperable on my domain

Sorry, i don't understand which config file causes this issue, please clearly explain your issue with related config files, error log.

11

Re: /iredmail and /mail inoperable on my domain

ZhangHuangbin - I'm going to "close" this post and start a new one as I'm getting confused myself!!  smile

Chris