Redirect question {SERVERNAME} for webmail

Discussion in 'Installation/Configuration' started by Herbert, Jan 7, 2007.

  1. Herbert

    Herbert New Member

    In /root/ispconfig/isp/conf/vhost.conf.master i put this:
    Redirect /webmail "https://{SERVERNAME}:81/webmail"

    The problem is i get in my vhost.conf
    Redirect /webmail "https://domainname.tld:80:81/webmail"

    How can i get: Redirect /webmail "https://domainname.tld:81/webmail"

    I don't know all the vrariables from ISPConfig, i try everything but no result.
     
  2. martinfst

    martinfst Member Moderator

    You're editing the wrong configuration file. You should redirect your main web server to the ISPConfig server. I'm working on something similar, but still struggling with the rewrite rules, as I have a more complex setup. I require several different rewite rules, and currently they interfere.

    But if someone has a good suggestion ......:rolleyes:
     
    Last edited: Jan 7, 2007
  3. Herbert

    Herbert New Member

    Ok, but i need it also for more than 50 differend domains, a redirect to the webmail for one domain is verry simple.
    Every virtualhost must have a own rewrite rule or redirect.
     
  4. Clogboy

    Clogboy New Member

    Why don't you put:

    Redirect /webmail "https://domainname.tld:81/webmail"

    in /etc/apache2/apache2.conf? That way one entry will work for all domains.
     
  5. martinfst

    martinfst Member Moderator

    Redirect is, as is says, a redirect. It's not a proxy. It means, you need to be able to access port 81 on your client, which may well be blocked in a large corporate network..
    Sometimes Internet access is restricted on such corporate networks and you want to access your webmail over a regular port 80, which is normally not closed down. Hence the reason to use rewrite/proxy and no redirect. This post still does not answer the OP :(
     
    Last edited: Jan 8, 2007
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    To the original post from Herbert:

    There is no such variable without the part appended. If you need this variable, you will have to create your own and add it to the make_vhost function in the file /root/ispconfig/scripts/lib/config.lib.php
     
  7. Herbert

    Herbert New Member

    Ok thanks, i have done..

    // Variablen zuweisen
    $mod->tpl->assign( array( SERVERNAME => $servername.$web_port,
    IP => $web["web_ip"].$web_port,
    SERVERNAME1 => $servername,
    DOCUMENTROOT => $document_root,
    SERVERALIAS => $serveralias,

    I get with {SERVERNAME1} the domainname without :81
    In the file vhost.conf.master i put:
    Redirect /webmail "https://{SERVERNAME1}:81/webmail"
    Its works..
    But a redirect is not good, i need i Rewrite Rule
    The rewrite rule must working from http to https and nothing works.
     
  8. martinfst

    martinfst Member Moderator

    To rewrite http to https appears to be a bad idea. I have the same route investigated yesterday, but it has lead me nowhere. Also https --> https rewrite seems to be a bad idea according to several hits I got in Google. It may lead to middleman attacks. So I have decided to run ISPConfig on a dedicated IP and modify it to run on port 80. That will also run Squirrelmail/phpMyAdmin on port 80. But remember it is SSL over port 80 :).
    ISPConfig will use the other IP addresses on my server. There's a thread in these forums somewhere, but it seems I'm unable to track that now.
     
  9. martinfst

    martinfst Member Moderator

  10. richjam000

    richjam000 New Member

    I've had some success using http proxy stuff.

    ie: say this is my URL for ispconfig: https://www.fred.com:81
    I then setup a new SSL vhost ( https://www.bill.com) containing this:
    SSLProxyEngine On
    ProxyPreserveHost On
    ProxyPass /ispconfig https://www.fred.com:81/
    ProxyPassReverse /ispconfig https://www.fred.com:81/
    ProxyPass /design https://www.fred.com:81/design/
    ProxyPassReverse /design https://www.fred.com:81/design/
    ProxyPass /squirrelmail https://www.fred.com:81/squirrelmail/
    ProxyPassReverse /squirrelmail https://www.fred.com:81/squirrelmail/

    Not really sure what Im doing ! - just copying something I did when setting
    up ntop.

    With the above set-up ispconfig seems to work just fine - ie: over port 80,
    proxied to port 81. - via https://www.bill.com/ispconfig/

    However the squirrelmail doesnt quite work - once I've logged in to
    squirrelmail ( via https://www.bill.com/squirrelmail. ), I see my mail OK but
    the URL , annoyingly , changes to :
    https://www.bill.net:81/squirrelmail//src/webmail.php
    ie: seems to go back to port 81.

    Bit stuck now - maybe someone can take this forward ?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

  12. achaian

    achaian New Member

  13. richjam000

    richjam000 New Member

    OK - had a look at : http://www.apachetutor.org/admin/reverseproxies

    Had initial problems with "ProxyHTMLURLMap" as my Centos 4.4 apache 2.0.52 install did not have mod_proxy_html
    fixed this with
    yum install httpd-devel.i386 ( to get apxs )
    cd /usr/local/src
    wget http://apache.mirror.positive-internet.com/httpd/httpd-2.0.59.tar.gz
    untar it
    cd httpd-2.0.59/modules/proxy
    wget http://apache.webthing.com/mod_proxy_html/mod_proxy_html.c
    apxs -c -I/usr/include/libxml2 -i mod_proxy_html.c

    add this to /etc/httpd/conf/httpd.conf
    LoadFile /usr/lib/libxml2.so
    LoadModule proxy_http_module modules/mod_proxy_http.so

    AAAAH- so then I could start thing about this again:
    http://www.apachetutor.org/admin/reverseproxies

    Put this into my vhost virtual hosts ( say https:ww.fred.com) as a test:
    SSLProxyEngine On
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule headers_module modules/mod_headers.so
    LoadFile /usr/lib/libxml2.so
    LoadModule proxy_html_module modules/mod_proxy_html.so
    ProxyRequests off
    ProxyPass /webmail/ https://ispconfig.mysite.com:81/
    ProxyHTMLURLMap https:///ispconfig.mysite.com:81 /webmail

    <Location /webmail/>
    ProxyPassReverse /
    SetOutputFilter proxy-html
    ProxyHTMLURLMap / /webmail/
    ProxyHTMLURLMap /webmail /webmail
    RequestHeader unset Accept-Encoding
    </Location>

    Soo... then I tried
    https://www.fred/com
    and I I got a login screen,
    but when I logged ( yes I know this is the ispconfig screen - just a proxy test) I just got a blank page.

    Shame - but getting there.

    Not sure if it's relevant but my error_log shows:
    "usable charset information: using old HTTP default LATIN1"

    Maybe somone can spot something I've missed ?
     
  14. falko

    falko Super Moderator Howtoforge Staff

  15. richjam000

    richjam000 New Member

    I would say , "yes" we are after the same thing.

    People want to get to webmail on port 80 or 443, not 81 because:
    i) they dont want to open extra port on their webserver.
    ii) a lot of companys will block people connecting for port 81 frorm thier company web-browsers.
    I think this thread and these 2 should be linked in some way:
    http://www.howtoforge.com/forums/showthread.php?t=9726
    http://www.howtoforge.com/forums/showthread.php?t=5405&highlight=webmail

    I recon the proxy approach could lead to the solution, but Im a bit stuck at the moment ( please see my previous entry in this thread).
    I may have another go over the weekend, but Im begining to think it would be easier to do a manual webmail install on my own webserver rather than the ispconfig one.

    Note the proxy approach did allow me to connect to the ispconfig main admin page over https(port 443), proxied to the ispconfig webserve on port 81 ( see my previous posts)
     
  16. achaian

    achaian New Member

Share This Page