404 webmail but phpmyadmin OK

Discussion in 'Server Operation' started by stefanos, May 17, 2009.

  1. stefanos

    stefanos Member

    Hi,

    I have a problem that I cannot fix (well I don't know where to start to look).

    Could someone have a look for me and point me in the direction that I need to work on.

    ERROR http://may.gr/webmail

    If I use the IP address for may.gr
    OK http://93.12.253.208/webmail

    If I use the FQDN of the server {same IP as above}
    OK http://web01.cet.com/webmail

    It appears to me that if I create a site in ISPConfig I loose the webmail for that domain.

    If I were to take a wild guess I would say that if the domain resolves to the default server then it works, if on the other hand you create a site phpmyadmin still works but the webmail stops and you get a 404.

    What am I doing wrong? Or what is happening?

    Kind Regards
    Stephen

    >> It's not a fix but it's better than nothing: I created a cname for web01 as mail.cet.com and you could use a rev proxy to get the webmail login...i.e. http://mail.cet.com/ as the webmail login page. But I still think domain.tld/webmail is the best!!!
     
    Last edited: May 27, 2009
  2. falko

    falko Super Moderator Howtoforge Staff

    Did you install webmail in the correct web site?
     
  3. stefanos

    stefanos Member

    Hi Falco,

    I installed it according to the perfect server 'Debian Lenny'


    A direct copy/past job.

    It works for the default server but not for any sites I create. What/where/how is webmail set in the apache config files as I cannot find it.

    I did from /etc
    a find . -type f | xargs grep -i webmail
    and did not find anything except for squirrelmail's apache.conf
    as follows:

    Alias /squirrelmail /usr/share/squirrelmail

    <Directory /usr/share/squirrelmail>
    Options Indexes FollowSymLinks
    <IfModule mod_php4.c>
    php_flag register_globals off
    </IfModule>
    <IfModule mod_php5.c>
    php_flag register_globals off
    </IfModule>
    <IfModule mod_dir.c>
    DirectoryIndex index.php
    </IfModule>

    # access to configtest is limited by default to prevent information leak
    <Files configtest.php>
    order deny,allow
    deny from all
    allow from 127.0.0.1
    </Files>
    </Directory>

    Stephen
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you post a vhost configuration of one of the sites where SquirrelMail isn't working?

    Are you using ISPConfig 2 or 3?
     
  5. stefanos

    stefanos Member

    Hi Falco,

    I am on ISPConfig 3.0.1.1

    The vhosts file is as follows:

    [09:14:45 root]$ cat may.gr.vhost
    <Directory /var/www/may.gr>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost *:80>
    DocumentRoot /var/www/may.gr/web

    ServerName may.gr
    ServerAlias www.may.gr
    ServerAdmin [email protected]

    ErrorLog /var/log/ispconfig/httpd/may.gr/error.log

    <Directory /var/www/may.gr/web>
    Options FollowSymLinks
    AllowOverride Indexes AuthConfig Limit
    Order allow,deny
    Allow from all
    <Files ~ '.php[s3-6]{0,1}$'>
    Order allow,deny
    Deny from all
    Allow from none
    </Files>
    </Directory>
    <Directory /var/www/clients/client1/web2/web>
    Options FollowSymLinks
    AllowOverride Indexes AuthConfig Limit
    Order allow,deny
    Allow from all
    <Files ~ '.php[s3-6]{0,1}$'>
    Order allow,deny
    Deny from all
    Allow from none
    </Files>
    </Directory>

    # cgi enabled
    <Directory /var/www/clients/client1/web2/cgi-bin>
    Order allow,deny
    Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /var/www/clients/client1/web2/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl


    </VirtualHost>



    I looked at this and there was nothing but I did find in the conf.d a symlink for phpmyadmin that works on all sites

    lrwxrwxrwx 1 root root 28 2009-05-12 20:27 phpmyadmin.conf -> ../../phpmyadmin/apache.conf

    In the /etc/squirrelmail/ I see a apache.conf but it did not work when i linked to it so I removed it again.

    Any ideas.

    Thanks
    Stephen
     
    Last edited: May 27, 2009
  6. falko

    falko Super Moderator Howtoforge Staff

    What's in the phpmyadmin/apache.conf file?
     
  7. stefanos

    stefanos Member

    Hi Falko,

    [15:29:07 root]$ cat conf.d/phpmyadmin.conf
    # phpMyAdmin default Apache configuration

    Alias /phpmyadmin /usr/share/phpmyadmin

    <Directory /usr/share/phpmyadmin>
    Options Indexes FollowSymLinks
    DirectoryIndex index.php

    # Authorize for setup
    # <Files setup.php>
    # # For Apache 1.3 and 2.0
    # <IfModule mod_auth.c>
    # AuthType Basic
    # AuthName "phpMyAdmin Setup"
    # AuthUserFile /etc/phpmyadmin/htpasswd.setup
    # </IfModule>
    # # For Apache 2.2
    # <IfModule mod_authn_file.c>
    # AuthType Basic
    # AuthName "phpMyAdmin Setup"
    # AuthUserFile /etc/phpmyadmin/htpasswd.setup
    # </IfModule>
    # Require valid-user
    # </Files>
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php

    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .
    </IfModule>
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php

    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .
    </IfModule>
    </Directory>

    where would the alias be set for the webmail?
    I have a Debian Lenny perfect server btw.

    Thanks
    Stephen
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Can you replace
    Code:
    <IfModule mod_php4.c>
    php_flag register_globals off
    </IfModule>
    <IfModule mod_php5.c>
    php_flag register_globals off
    </IfModule>
    with
    Code:
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .
    </IfModule>
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path .
    </IfModule>
    in the SquirrelMail configuration and restart Apache?
     
  9. stefanos

    stefanos Member

    Hi Falko,

    It's working but not as I expected at all
    ERROR http://may.gr/webmail
    If I use the IP
    OK http://93.12.253.208/webmail
    OK http://may.gr/squirrelmail

    What interests me is with the IP you need to use /webmail but with the domain you need to use /squirrelmail

    I also needed to add a symlink from the /etc/apache2/conf.d/ to ../../squirrelmail/apache.conf for it to work.

    I followed the debian lenny tutorial step by step and I can also see a symlink in /var/www as webmail -> /usr/share/squirrelmail/

    Did something go wrong during the install?

    Thanks
    Stephen
     
    Last edited: May 27, 2009
  10. falko

    falko Super Moderator Howtoforge Staff

    You can add
    Code:
    Alias /webmail /usr/share/squirrelmail
    to SquirrelMail's apache.conf.
     
  11. stefanos

    stefanos Member

    Hi Falko,

    On my BDay I wish to say thanks with all my heart for all your hard work it means a lot for me and I am sure to many other people out here on the NET.

    Thanks
    Stephen
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Thanks a lot! I hope you had a nice party? :)
     

Share This Page