|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a server linux/apache and I want to make links to 2 other servers Windows 2000/IIs depending on the application the user wants to see
I can't find good examples of vhot_alias and virtualdocumentroot o virtualdocumentrootip are this directives good for my problem ? |
|
#2
|
|||
|
|||
|
>> I want to make links
What do you mean by make links? Thost virtualdocumentroot directives are probably not what you want. You need to have at least 10 thousands vhosts in order to use it efficiently. Maybe you're looking for mod_proxy. |
|
#3
|
|||
|
|||
|
in my home page I have a list of applications
some of them are in the main server (linux) but others are in the W2000/IIS server and I want to use an HTML link to see these applications |
|
#4
|
|||
|
|||
|
Can people reach your win2k server directly?
|
|
#5
|
|||
|
|||
|
not from ouside of course that's why I am looking for a relative redirection
|
|
#6
|
|||
|
|||
|
Then you can use mod_proxy. You have two options:
1) Subdomain 2) directory mapping For (1), you need to have control to your DNS. You will need to create a subdomain (A record) like win2k.yourdomain.com pointing to the same IP as your Linux box. Whenever http://win2k.yourdomain.com/ is accessed, it's refer to your win2k box. mod_proxy on Linux will act as a proxy server for win2k so people can reach it indirectly. Here is an example: UseCanonicalName Off NameVirtualHost * <VirtualHost *> ServerName www.linuxbox.com DocumentRoot "/www/htdocs" </VirtualHost> <VirtualHost *> ServerName win2k.linuxbox.com RewriteEngine on RewriteCond %{HTTP_HOST} ^win2k\.linuxbox\.com$ [NC] RewriteRule ^/icons/(.+) - [PT,L] RewriteRule ^(.*) http://192.168.0.2$1 [P,L] CustomLog /var/log/apache/win2k_log </VirtualHost> This assumes you can reach your win2k box from Linux via http://192.168.0.2 within your LAN. If you need to use local domain name instead, make sure you can ping such domain name from Linux. If you are not using any <VirtualHost> dirctive at all, you can define those Rewrite* lines globally. You will need mod_rewrite and mod_proxy (libproxy.so) in order to implement it. 2) you still need mod_rewrite and mod_proxy. Here is the rewrite rule: <VirtualHost *> ServerName www.linuxbox.com DocumentRoot "/www/htdocs" RewriteEngine on RewriteRule ^/win2k(.*) http://192.168.0.2$1 [P,L] </VirtualHost> You will need to mkdir a win2k directory at /www/htdocs/win2k. You will need to add a trailing slash on all the hyperlinks if it's referring to a directory. For example: <a href="/win2k/appz/">My M$ Appz</a> |
|
#7
|
|||
|
|||
|
Thank you very much
It seems to be a good way (number 2) but there is a problem of rights. does the proxy need to be configured with rights ? when I try diretly from my browder the adresse 10.100.100.80/intralm it is oK but when I used the link /win2k/intralm this is the message Forbidden You don't have permission to access /win2k/intralm/ on this server. -------------------------------------------------------------------------------- Apache/1.3.12 Server at linuxweb Port 80 |
|
#8
|
|||
|
|||
|
>> the adresse 10.100.100.80/intralm it is oK
Is 10.100.100.80/intralm the documentroot for your win2k box and NOT 10.100.100.80 alone? If you access your win2k by typing http://10.100.100.80/intralm/ (please use trailing slash at all time, it's a good practice), then of course, the following line doesn't match: RewriteRule ^/win2k(.*) http://10.100.100.80$1 [P,L] You need to change it to: RewriteRule ^/win2k(.*) http://10.100.100.80/intralm$1 [P,L] BTW, you also can check your access_log (or equivalent name) on IIS, the IP should be your external IP, not your 10.100.100.xx internal IP. Last edited by freebsd : January 28th, 2002 at 09:04 AM. |
|
#9
|
|||
|
|||
|
I have more than 1 application on win2k server that's the reason why I input win2k/intralm/ or win2k/test/ ...
by the way : how can I stop the httpd , for the moment I have to reboot as soon as I have changed a word About the logs on the iis server : nothing the queries don't arrive it is stopped before (on the linux server) I still think it's a matter of rights about the proxy this is my httpd.conf <Ifmodule mod_proxy.c> ProxyRequests On <Directory proxu:*> |
|
#10
|
|||
|
|||
|
...I was saying
about the proxy this is my httpd.conf <Ifmodule mod_proxy.c> ProxyRequests On <Directory proxy:*> Order deny,allow Allow from all </Directory> </Ifmodule> |
|
#11
|
|||
|
|||
|
>> about the proxy this is my httpd.conf
You need to uncomment that entire <IfModule> block. ProxyRequests should be Off by default. Whatever Linux dist you are using and they have that On by default is bad. >> that's the reason why I input win2k/intralm/ or win2k/test/ That doesn't really matter so long as you know how to reach your win2k site. You just need to fix the RewriteRule line accordingly. Check the examples as shown at the bottom of this post. >> how can I stop the httpd Apache should be controlled by apachectl by default. If your Linux dist uses a customize start/stop script, check your /etc/rc.d/init.d directory and look for that script. Then run ./that_script_name stop and start it again. If it takes reload, of course you can run ./that_script_name reload. If you have more question with this, you need to start a new thread and ask it in Linux forum. Here is Apache forum and only Apache-related question will be answered. Here's the example: <VirtualHost *> ServerName www.linuxbox.com DocumentRoot "/www/htdocs" RewriteEngine on RewriteRule ^/google(.*) http://www.google.com$1 [P,L] </VirtualHost> When you go to http://www.linuxbox.com/google/, you will see google site's index page. Another example: <VirtualHost *> ServerName www.linuxbox.com DocumentRoot "/www/htdocs" RewriteEngine on RewriteRule ^/yahoo(.*) http://dir.yahoo.com/Recreation/Sports$1 [P,L] </VirtualHost> This example uses subdir or URI path (2 level deep as your base). When you go to http://www.linuxbox.com/yahoo/, you will see the exact content of that page. Last edited by freebsd : January 28th, 2002 at 09:48 AM. |
|
#12
|
|||
|
|||
|
Yahoo !!!
It works Thank a lot |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > mod vhost_alias |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|