?--ispconfig = port 81, webmail = port 80--?

Discussion in 'General' started by gjcomputer, Jul 7, 2006.

  1. gjcomputer

    gjcomputer ISPConfig Developer ISPConfig Developer

    how can this be setup, i want to run squirell mail on ispconfig (pkg) but i want to let ispconfig be default (81) but squirellmail to port 80 so i can get on from work (proxy blocks 81)
     
  2. fobicodam

    fobicodam ISPConfig Developer ISPConfig Developer

    I believe you must create an alias for your domain to the squirrel directory in the /etc/httpd/httpd.conf

    I tried to do it but i cant better luck to you !
     
  3. Hans

    Hans Moderator ISPConfig Developer

    Redirect

    Maybe this is what you want:

    Create a site or co-domain.
    For instance: webmail.yourhostingcompany.tld
    Within this web, remove the default index.html webpage created by ISPConfig.

    Put a file there called index.php wich redirects to http:www.yourhostingcompany.tld:81/squirrelmail

    The contents of index.php :

    <?php
    header("Location: https://www.example.com:81/squirrelmail"); /* Redirect browser */

    /* Make sure that code below does not get executed when we redirect. */
    exit;
    ?>

    When your customers visit webmail.yourhostingcompany.tld (port 80) they will be redirected to http:www.yourhostingcompany.tld:81/squirrelmail.

    Probably it is also possible to create a forwarder to www.yourhostingcompany.tld:81/squirrelmail within ISPConfig for the domain you want.
     
  4. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    I did a test just now for the sake of....... just testing ;)

    This I added to my /etc/httpd/conf/httpd.conf
    PHP:
    Alias /squirrelmail "/home/admispconfig/ispconfig/web/squirrelmail"
    <Directory "/home/admispconfig/ispconfig/web/squirrelmail">
            
    AddType application/x-httpd-php .php .php3 .php4 .php5
            
    <Files *.php>
                
    SetOutputFilter PHP
                SetInputFilter PHP
            
    </Files>
            <
    Files *.php3>
                
    SetOutputFilter PHP
                SetInputFilter PHP
            
    </Files>
            <
    Files *.php4>
                
    SetOutputFilter PHP
                SetInputFilter PHP
            
    </Files>
            <
    Files *.php5>
                
    SetOutputFilter PHP
                SetInputFilter PHP
            
    </Files>
            
    php_admin_flag safe_mode On
            php_admin_value open_basedir 
    "/home/admispconfig/ispconfig/web/squirrelmail/"
            
    php_admin_value file_uploads 1
            php_admin_value upload_tmp_dir 
    "/home/admispconfig/ispconfig/web/squirrelmail"
            
    php_admin_value session.save_path "/home/admispconfig/ispconfig/web/squirrelmail/sess"
    </Directory>
    #NOTE: the above paths don't wrap!! Make sure they are on the same line as the php_admin_value lines..
    I extracted squirrelmail into /home/admispconfig/ispconfig/web/squirrelmail (renamed it to a common name) and also created a subfolder called "sess" with a 'chmod 777 squirrelmail/sess' to set permissions for http sessions.

    restarted my httpd server and I can now browse it via http://www.{domain}.com/squirrelmail

    of course you need to configure it before it works by cd'ing to squirrelmail and then running ./configure
     
    Last edited: Jul 8, 2006
  5. falko

    falko Super Moderator ISPConfig Developer

    If port 81 is blocked, then you must create a new web site in ISPConfig and install a copy of Squirrelmail there. A redirection to ISPConfig's Squirrelmail (on port 81!) doesn't work in this case.
     
  6. gjcomputer

    gjcomputer ISPConfig Developer ISPConfig Developer

    then is there a way to make everything on port 80? i mean i have a domain dedicated to ispconfig that will go to ispconfig on port 80, as well as webmail then being on port 80, on installation i selected http (not https)
     
  7. gjcomputer

    gjcomputer ISPConfig Developer ISPConfig Developer

    or could i use port 443? i know my work allows 443, and i wont ever use ssl for anything else
     
  8. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    You could do that as long as you remember that SSL can't be used for your client sites unless you have multiple IPs allocated to the ISPC machine

    vi /ispconfig/httpd/conf/httpd.conf"

    look for "Port 181" and change it to "Port 443"

    then run

    /root/ispconfig/httpd/bin/apachectl restart


    that should do it.
     
  9. falko

    falko Super Moderator ISPConfig Developer

  10. farao

    farao New Member

    Hi guys,

    I'm not sure what happened, but a while ago I installed Roundcubemail through the package, which works like a charm on port 81. I then followed the alias-workaround in apache2.conf (modified the directory to point to roundcube), which worked yesterday, and as of today, it doesn't...

    I can access my webmail through www.[domain].tld:81/roundcubemail, but when I use www.[domain].tld/webmail, the login screen appears, and after login it displays the correct URL in the address bar, but the screen itself displays the login screen again. I pasted the url shown.
    http://www.[domain].tld/webmail/?_auth=SOME_VERY_LONG_STRING_OF_NUMBERS&_task=mail

    Can anybody shed some light on this? It happens both in Firefox and IE...

    Thanks
     
  11. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    It may depend on the configuration of roundcubemail itself. I don't use it so I don't know how it works but there might be a config which is hard configured to use port :81/roundcubemail or something and possibly break the Alias version.
    Others here might be able to help, sorry i couldn't help much.
     
  12. farao

    farao New Member

    Well, there's nothing in the Roundcube config that points to a specific port 81... and it DID work the first day I tried it. I'll just keep on fiddling, maybe strip all but the alias redirection, and let the default php-settings for Apache take over.
    Thanks.
     
  13. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    hmm not sure without checking the code out. But as long as you remember that port 81 is served by a different instance of apache compared to port 80 so sessions aren't seen between the 2 instances. Hence if the alias site DID infact call the :81 site it won't know about the user being logged in.

    Can you show us how you setup the httpd.conf setup? PM me if you wish and I could check it for you.
     
  14. farao

    farao New Member

    Here's the relevant part of apache2.conf. I put a # in front of the lines I don't need. For some reason, the URL shown after entering is and pass is correct, but the display is not. I just can't get my head around why it DID work on day one...

    Please not that the directory-lines don't wrap, in my config they ARE on one line.

    Code:
    Alias /webmail "/home/admispconfig/ispconfig/web/roundcubemail"
    <Directory "/home/admispconfig/ispconfig/web/roundcubemail">
            AddType application/x-httpd-php .php
            <Files *.php>
                SetOutputFilter PHP
                SetInputFilter PHP
            </Files>
    #        php_admin_flag safe_mode On
    #        php_admin_value open_basedir "/home/admispconfig/ispconfig/web/roundcubemail/"
    #        php_admin_value file_uploads 1
    #        php_admin_value upload_tmp_dir "/home/admispconfig/ispconfig/web/roundcubemail/temp"
    #        php_admin_value session.save_path "/home/admispconfig/ispconfig/web/roundcubemail/temp"
    </Directory>
    Edit:
    I realise that session data is not passed between apache2 (port 80) and apache (port 81), but if I call roundcube from apache2, that should initiate the session on the port 80-webserver, or am I mistaken?
    Edit2:
    I also tried adding the directives to an ISPConfig-web, but that produced the same result: I get the login-screen, and it just recycles...
     
    Last edited: Sep 15, 2006
  15. falko

    falko Super Moderator ISPConfig Developer

    Any errors in the error log in /root/ispconfig/httpd/logs?
     
  16. farao

    farao New Member

    Nope, nothing in the logs that looks even remotely out of the ordinary... just a few planned reboots.

    error.log from apache 1.3:
    Code:
    [Tue Sep 12 14:17:21 2006] [notice] caught SIGTERM, shutting down
    [Tue Sep 12 14:18:35 2006] [notice] Apache/1.3.37 (Unix) PHP/5.1.4 mod_ssl/2.8.28 OpenSSL/0.9.8b configured -- resuming normal operations
    [Tue Sep 12 14:18:35 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
    [Fri Sep 15 16:10:26 2006] [notice] caught SIGTERM, shutting down
    [Fri Sep 15 16:11:41 2006] [notice] Apache/1.3.37 (Unix) PHP/5.1.4 mod_ssl/2.8.28 OpenSSL/0.9.8b configured -- resuming normal operations
    [Fri Sep 15 16:11:42 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
    But here's something interesting (error.log from apache2):
    Code:
    [Fri Sep 15 19:42:32 2006] [notice] caught SIGTERM, shutting down
    [Fri Sep 15 19:42:33 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
    [Fri Sep 15 19:42:33 2006] [notice] Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a configured -- resuming normal operations
    [Fri Sep 15 19:42:37 2006] [error] an unknown filter was not added: PHP
    [Fri Sep 15 19:42:37 2006] [error] an unknown filter was not added: PHP
    [Fri Sep 15 19:42:57 2006] [error] an unknown filter was not added: PHP
    [Fri Sep 15 19:42:57 2006] [error] an unknown filter was not added: PHP
    [Fri Sep 15 19:42:57 2006] [error] an unknown filter was not added: PHP
    [Fri Sep 15 19:42:57 2006] [error] an unknown filter was not added: PHP
     
  17. falko

    falko Super Moderator ISPConfig Developer

    Have a look here: http://www.howtoforge.com/forums/showthread.php?t=4770&highlight=$go_info["server"]["apache2_php"]
     
  18. farao

    farao New Member

    Hi Falko,

    Ouch, I didn't look for that error in the forums, my bad. But... it doesn't help. Maybe I should leave roundcube to just being pretty for now, and install Squirrelmail on the side to give my users a working webmail on port 80...

    Thanks.
     
  19. falko

    falko Super Moderator ISPConfig Developer

    Roundcube is still in alpha/beta stage, so I wouldn't use it.
     
  20. farao

    farao New Member

    I know, but i like the interface a lot. Squirrelmail gave me the same problem after installing the ISPC package.
    I eventually got roundcube to work by flagging the php safe mode to off for the roundcube-directory. Don't know about Squirrelmail.
    I admit, not safe, but working. How just two letters can cause so much sleep deprivation...

    Edit: AAAARRGGHHH, jumped too soon. As it turns out: if i log in using the port 81 site, and then change url to the port 80 site, it gives me the login screen again, but somehow finds the session and lets me see my mail. If I log in straight to port 80, it won't budge.
     
    Last edited: Sep 19, 2006

Share This Page