VirtualHost Frage

Alles, was den Apache betrifft, kann hier besprochen werden.

VirtualHost Frage

Postby lorus11 » 16. April 2007 17:00

Hiho,

ich hab auf meinem Netzserver einen Apache laufen. Habe dazu das 0-config tool webserv verwendet.

Läuft soweit auch wunderbar.

Der Apache läuft ja auf Port 80. Eine andere Webanwendung habe ich auf einem anderen Port laufen und weitere sind außerdem geplant, wiederum für andere Ports.

Da ich bei meinem Router diese ganzen Ports nicht freigeben möchte, hab ich im Netz nach einer Lösung gesucht alles über einen freigegebenen Port zu regeln. Dabei bin ich auf folgendes gestoßen.

Code: Select all
<VirtualHost *:80>
    ServerAdmin lorus@arcor.de
    DocumentRoot "E:/WebServer/wwwroot/htdocs"
    ServerName server
    ServerAlias server
</VirtualHost>

<VirtualHost *:80>
        ServerName file.server
        RewriteEngine     On
        RewriteRule       ^(.*)$        https://192.168.0.9:15000$1  [P]
</VirtualHost>


gesetzt ist außerdem

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


Wenn ich die Subdomain file.server aufrufe soll also zu https://192.168.0.9:15000 forwarded werden. Dort läuft eine eigenständige Anwendung die für sich auch funktioniert.

Leider funktioniert das so nicht, deswegen wollt ich mal fragen ob das grundsätzlich überhaupt funktioniert, wie ich mir das vorstelle.

Danke schonmal für jede Hilfe :)

Grüße,

Lorus
Last edited by lorus11 on 03. March 2010 16:32, edited 1 time in total.
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36

Postby anderson_thomas » 17. April 2007 08:52

Bei mir geht das so:

<VirtualHost *:80>
ServerName ...

RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*)$ https://%{SERVER_NAME}:15000$1 [R=301,L]

<Directory />
Order Deny,Allow
Options FollowSymLinks
AllowOverride AuthConfig
Deny from all
</Directory>
</VirtualHost>

<VirtualHost *:15000> ...
anderson_thomas
 
Posts: 5
Joined: 17. April 2007 08:45

Postby lorus11 » 17. April 2007 13:23

Hiho anderson_thomas und danke für deine Hilfe :)

hab das jetzt für meinen Fall so abgewandelt:

Code: Select all
<VirtualHost *:80>
ServerName file.server

RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*)$ https://192.168.0.9:15000$1 [R=301,L]

<Directory />
Order Deny,Allow
Options FollowSymLinks
AllowOverride AuthConfig
Deny from all
</Directory>
</VirtualHost>


unter http://file.server ist aber leider nichts erreichbar im lokalen netz :(

muss vielleicht noch ein andere module geladen werden, als das rewrite module?
Last edited by lorus11 on 03. March 2010 16:32, edited 1 time in total.
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36

Postby anderson_thomas » 17. April 2007 14:16

Hier meine Liste aller geladenen/leider auch nicht geladenen Module:


LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule logio_module modules/mod_logio.so
LoadModule rewrite_module modules/mod_rewrite.so

Evtl. noch sehr wichtig für SSL (logischerweise :-))
LoadModule ssl_module modules/mod_ssl.so
anderson_thomas
 
Posts: 5
Joined: 17. April 2007 08:45

Postby anderson_thomas » 17. April 2007 14:20

So sieht meine Virtueller Host für den https://... Zugriff aus - den brauchst Du auch, wenn Du https//... sprich SSL sprechen willst, zumindest in meiner Config... :-)

<VirtualHost *:443>
ServerName ...
ServerAlias ...
ServerAdmin ...
DocumentRoot "C:/Programme/www/apache/htdocs"
ServerPath "/"

SSLEngine On
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile conf/...crt
SSLCertificateKeyFile conf/...key

<FilesMatch "\.(cgi)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/Programme/www/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

<Directory />
Order Deny,Allow
Options FollowSymLinks
AllowOverride AuthConfig
Deny from all
</Directory>
</VirtualHost>
anderson_thomas
 
Posts: 5
Joined: 17. April 2007 08:45

Postby lorus11 » 17. April 2007 14:28

das ssl läuft in einer Webanwendung, die für sich eigenständig und somit unabhängig vom apache ist. (läuft also auch ohne den Apache)

Der Apache soll ja nur die subdomain file.server auf die Adresse https://192.168.0.9:15000 weiterleiten :)

mehr will ich gar nicht :)

p.s. mit deinen ganzen includes tut sich leider auch noch nichts :-/
Last edited by lorus11 on 03. March 2010 16:33, edited 1 time in total.
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36

Postby Thovan » 19. April 2007 15:52

Funktioniert die Namens-Auflösung überhaupt bei Dir?
Also kann dem Servernamen file.server eine IP zugeordnet werden?
Thovan
 
Posts: 68
Joined: 15. May 2003 09:26
Location: Leipzig

Postby lorus11 » 19. April 2007 22:52

Thovan wrote:Funktioniert die Namens-Auflösung überhaupt bei Dir?
Also kann dem Servernamen file.server eine IP zugeordnet werden?


nein, da scheitert es leider auch schon :-/

was könnte ich da Falsch gemacht haben? 'server' wird aufgelöst
Last edited by lorus11 on 03. March 2010 16:33, edited 1 time in total.
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36

Namensauflösung

Postby Thovan » 20. April 2007 07:16

Na dann musst Deinem DNS-Server beibringen unter welcher IP er file.server "bewerben" darf.

An diesem Punkt müssten wir etwas mehr über Dein Netzwerk erfahren.

Edit:
Nur so als Frage: Soll file.server das sein, was ich denke?
Denn dann hätte es nix mit httpd (Apache) sondern eher mit smb (Samba) zu tun.

Also: Wie willst Du auf file.server überhaupt zugreifen?
Per Browser? Per FTP? Per WebDAV?
Thovan
 
Posts: 68
Joined: 15. May 2003 09:26
Location: Leipzig

Re: Namensauflösung

Postby lorus11 » 21. April 2007 10:10

Thovan wrote:Na dann musst Deinem DNS-Server beibringen unter welcher IP er file.server "bewerben" darf.

An diesem Punkt müssten wir etwas mehr über Dein Netzwerk erfahren.


nix besonderes :) Der Rechner auf dem der Apache läuft, ist ne stinknormale XP-Machine :)
Vernetzt sind die Rechner über einen NAT.
Als Hostnamen hat er "server", deswegen dacht ich das es relativ unkompliziert sei, die subdomain file.server zu erstellen

Edit:
Nur so als Frage: Soll file.server das sein, was ich denke?
Denn dann hätte es nix mit httpd (Apache) sondern eher mit smb (Samba) zu tun.


nein, kein samba :) ist eine Webanwendung, mit der man per Browser Dateien hochladen kann, aber die ist wie gesagt, total standalone

Also: Wie willst Du auf file.server überhaupt zugreifen?
Per Browser? Per FTP? Per WebDAV?


per browser :)
Last edited by lorus11 on 03. March 2010 16:33, edited 1 time in total.
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36

Postby lorus11 » 25. April 2007 14:05

was könnte das Problem sein? :)
lorus11
 
Posts: 6
Joined: 16. April 2007 16:36


Return to Apache

Who is online

Users browsing this forum: No registered users and 22 guests