View Full Version : Redirect question {SERVERNAME} for webmail
Herbert
7th January 2007, 15:01
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.
martinfst
7th January 2007, 16:15
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:
Herbert
7th January 2007, 19:42
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.
Clogboy
8th January 2007, 02:00
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.
martinfst
8th January 2007, 10:12
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 :(
till
8th January 2007, 11:02
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
Herbert
10th January 2007, 01:27
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
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.
martinfst
10th January 2007, 12:05
But a redirect is not good, i need i Rewrite Rule
The rewrite rule must working from http to https and nothing works.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.
martinfst
10th January 2007, 12:11
There's a thread in these forums somewhere, but it seems I'm unable to track that now.A good suggestion is http://www.howtoforge.com/forums/showthread.php?t=157
richjam000
11th January 2007, 02:13
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 ?
till
11th January 2007, 09:14
To fix squirrelmail, please try the configuration described here under fixing HTML links:
http://www.apachetutor.org/admin/reverseproxies
achaian
11th January 2007, 22:20
I am wanting to do something similar...I guess?
With this exception:
change: https://www.domain.tld:81/squirrelmail/
to : https://webmail.domain.tld
Am I in the right thread? If not I apologize to the author for mucking it up.
richjam000
12th January 2007, 04:23
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 ?
falko
12th January 2007, 17:39
I am wanting to do something similar...I guess?
With this exception:
change: https://www.domain.tld:81/squirrelmail/
to : https://webmail.domain.tld
Am I in the right thread? If not I apologize to the author for mucking it up.
No, you're wanting something slightly different. Take a look here: http://www.howtoforge.com/forums/showthread.php?t=5405&highlight=webmail
richjam000
13th January 2007, 01:17
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)
achaian
15th January 2007, 15:05
No, you're wanting something slightly different. Take a look here: http://www.howtoforge.com/forums/showthread.php?t=5405&highlight=webmail
Excellent. Thank you!!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.