port virtualhosts?

Apache, Lighttpd, nginx, Cherokee
Post Reply
linuxnewbie
Posts: 150
Joined: 2003-01-24 16:00
 

port virtualhosts?

Post by linuxnewbie »

gehen bei virtualhosts auch port weiterleitungen?

wenn ich zb

http://www.blabla.de aufrufe das die virtualhost einstellung das dann automatisch nach

http://www.blabla.de:2000 weiterleitet ohne das das dann oben in der adressleiste steht?
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: port virtualhosts?

Post by dodolin »

Ja, geht. mod_rewrite und die Doku dazu ist dein Freund...
Oder soll ich es dir vorkauen? Mache ich auch gerne, aber vielleicht willst du es ja selbst herausfinden und was lernen?
linuxnewbie
Posts: 150
Joined: 2003-01-24 16:00
 

Re: port virtualhosts?

Post by linuxnewbie »

au ja vorkauen bitte bitte :D


und mit erbsen mischen damits schmeckt ;)

und vielleicht etwas kechup dazu
floschi
Userprojekt
Userprojekt
Posts: 3247
Joined: 2002-07-18 08:13
Location: München
Contact:
 

Re: port virtualhosts?

Post by floschi »

oder auch mod_proxy ;)
dodolin
Posts: 3840
Joined: 2003-01-21 01:59
Location: Sinsheim/Karlsruhe
Contact:
 

Re: port virtualhosts?

Post by dodolin »

Alla guud, wenn's sein muss... :evil:

Code: Select all

<VirtualHost *>
    ServerName www.blabla.de
    RewriteEngine on
    RewriteRule ^/(.*) http://www.blabla.de:2000/$1
</VirtualHost>
Dazu muss man in der allgemeinen Server Konfig noch folgendes haben:

Code: Select all

dodo@masterboy:~$ grep mod_rewrite /etc/apache/httpd.conf
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
Oki, mod_proxy habe ich vergessen, ist aber IMHO umständlicher, da man dann auch noch mod_proxy laden muss und vor allem: falls man Statistiken macht, sind die für'n Arsch, weil dann sämtliche Requests vom eigenen Server kommen. Wenn man mod_proxy verwenden will, fügt man an die "RewriteRule" oben einfach noch "[P]" an...
flo
Posts: 2223
Joined: 2002-07-28 13:02
Location: Berlin
 

Re: port virtualhosts?

Post by flo »

Hi,

mod_rewrite hab ich nicht ganz kapiert, um ehrlich zu sein, hier die Lösung für mod_proxy:

Code: Select all

<VirtualHost *:8080>
ServerName server.deinedomain.de

<IfModule mod_proxy.c>
ProxyRequests On
ProxyPass / http://192.168.5.31:2000/
</IfModule>

DocumentRoot /usr/local/httpd/proxy/
ServerAdmin info@deinedomain.de
ErrorLog /var/log/httpd/proxy_err_log
TransferLog /var/log/httpd/proxy_access_log
</VirtualHost>
Grüße,

flo.
Post Reply