ORMI Connect Exception with IP-Based Virtual Hosts
I currently am using OAS 10.1.2 and have a virtual host setup with the Oc4j mounted at the root of the domain.
i.e.
http://mydomain.com (Takes you straight to the application)
as apposed to
http://mydomain.com/myapplication (Which appears to be the default configuration)
When I setup my ormi url to the following ormi://mydomain.com:12500/ I get java.net.ConnectException: Connection refused. error.
If remove the Virtual Host configuration then specify the ormi url to be ormi://mydomain.com/myapplication I do no get the error.
Does anyone know how to setup ormi with oc4j applications mounted to the root of a domain.
Thanks
you need to define a virtual server for it..but inside that definition.. define a proxy.
Then the middle webserver, will actually handle the request to the intranet server, on behalf of the internet client..and then pass the traffic to the internet client.
this looks like a reasonable example..
http://www.linuxfocus.org/English/March … le147.html
namely, the section "Mapping Virtual Servers"
Similar Messages
-
Apache, name based virtual hosts and multiple servers.
Hi,
Ive been playing with Apache and name-based virtual hosts for a while now, but, ive been doing it with one single server... now i have the need to forward a name-based request to another server inside the intranet (wich doesnt have a public IP, but a private)...
Something like this:
internet -----> Webserver (name based vhosts) ----> intranet-webserver
Where "webserver" has several domains resolved via name based virtual hosting, and one of those needs to be redirected (or forwarded) to another server on the LAN.
Any ideas on how to do this? i tryed searching the web, but i dont know under which keywords, so i always end on single server virtual hosting help sites.
thanks in advance!you need to define a virtual server for it..but inside that definition.. define a proxy.
Then the middle webserver, will actually handle the request to the intranet server, on behalf of the internet client..and then pass the traffic to the internet client.
this looks like a reasonable example..
http://www.linuxfocus.org/English/March … le147.html
namely, the section "Mapping Virtual Servers" -
Using Name-based Virtual Hosts on Apache
Hi!
We have Novell SBS 6.5, a tree with 3 servers:
1. Border Manager sp1
2. GroupWise (NAT) sp1
3. WEB (NAT) sp6 - Apache 2, MySQL, PHP.
My site is at http://www.kalmanovitz.co.il.
I want to try to add a new sub domain and\ or a Domain using Name-based Virtual Hosts (2 or more domains on same IP number).
1. My BM server use SSL. Will it influence SSL? How?
2. What I need to change on my servers?
3. What my ISP need to update\change on his system?
4. Can i try to experience the changes without my ISP intervention?
Please help.
TIA
NanuNanu Kalmanovitz,
> 1. My BM server use SSL. Will it influence SSL? How?
Not protocol wise, but you will get asecurity warning that certificate
and host names do not match.
> 2. What I need to change on my servers?
Httpd.conf
> 3. What my ISP need to update\change on his system?
DNS, pointers to the domains
> 4. Can i try to experience the changes without my ISP intervention?
>
Yes. Add the names to the workstation's hosts-file
- Anders Gustafsson, Engineer, CNE6, ASE
NSC Volunteer Sysop
Pedago, The Aaland Islands (N60 E20)
Novell does not monitor these forums officially.
Enhancement requests for all Novell products may be made at
http://support.novell.com/enhancement
Using VA 5.51 build 315 on Windows 2000 build 2600 -
Set up Named Based Virtual Hosting on 10.4 Server
First, sorry for the stupid question. I've read through Apple's WebTechnologies_Adminv10.4/10.5 manuals and still don't feel like I have a clear answer to this question.
I am trying to set up named based Virtual Hosting on an Xserve running 10.4. I have read a lot of instructions on the web on setting up named based virtual hosting on Mac 10.4/5 Client computers by manually adjusting the host and httpd.conf files and I'm confused as to whether I need to do this in 10.4 Server as well. I have successfully set up virtual hosting on a client computer and it works but I can't get it to work on 10.4 server. I have set up two sites in Server Admin with two site folders in /library/webserver/documents but no luck. Do I need to do what I did in the files above on the server to get it to work or should it work by just creating seperate sites in Server Admin? What am I missing? Thanks in advance for any guidance.You can do this entirely in Server Admin - no need to edit the config files directly.
You just need to create each site in Server Admin -> (server) -> Web -> Sites
For each set you need to specify the hostname for the site in each site's Domain Name field.
As long as each site has a unique name (and that name maps to your server's IP address) that's all there is to it. -
Help with apache and virtual hosts
I hope someone can help me I had installed shared point for testing and learning it. I had setup alternative mapping and know I want to add sub domain to my Apache web server. So I have sub domain redirecting back to share point. Also mine website is being redirected to share point. How I can have sub domain redirected to share point and main website go to my drupal ? I had created virtual host for main website but I still get redirected to share point.
I have this and the problem is that main domain goes to share point.
<VirtualHost xxxx.us:80>
ServerName xxxx.us
ServerAlias www.xxxx.us
DocumentRoot "/srv/http"
ServerAdmin [email protected]
ErrorLog "/var/log/httpd/error_log"
CustomLog "/var/log/httpd/access_log" common
<Directory />
Options FollowSymLinks
AddHandler cgi-script .cgi .pl
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order deny,allow
Deny from all
</Directory>
</VirtualHost>
<VirtualHost sharepoint.xxxx.us:80>
ServerName sharepoint.xxxx.us
ServerAlias sharepoint.xxxx.us
DocumentRoot "/srv/http"
ServerAdmin [email protected]
ErrorLog "/var/log/httpd/error_log"
CustomLog "/var/log/httpd/access_log" common
RewriteEngine On
RewriteLog "/var/log/httpd/rewrite_log"
RewriteLogLevel 9
RewriteCond %{HTTP_HOST} !^(sharepoint\.)?hebe\.us$
RewriteRule ^(.*)$ http://hebe.us$1 [L,R=301]
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
ProxyPass / http://192.168.0.38/
ProxyPassReverse / http://192.168.0.38/
</VirtualHost>
Last edited by tritron4 (2013-06-19 17:01:08) -
Macbook can't be found with any internet connection except with wi-fi turned on
Just weard! - I can't find my macbook on find my iphone without wi-fi turned on.
Why can and is it normal my macbook only can be found on "find my iphone" when wifi is on while I still have another internet connection activated on my mac without wi-fi??
Is there something one can do to find my mac - if stolen - when it has any kind of internet connection with wi-fi turned off???FaceTime, Game Center, Messages: Troubleshooting sign in issues
-
ExistsNode exception with Schema based XMLType table
hi,
While running this query on structured table -->
SELECT OBJECT_VALUE
FROM Table_Structured
WHERE existsNode(OBJECT_VALUE, '/Entity/Fields[field2="stringvalue"]') = 1;
I get this exception -->
Error report:
SQL Error: ORA-00932: inconsistent datatypes: expected UDT got CHAR
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
There is no problem running this on unstructured XMLType tables
What the problem ?
Thanks in advance.To get an answer more meaningful than the one the error message gives you (and that's pretty clear as XML errors go), you're going to need to supply a bit more info. At least the relevant portion of the schema and the actual definition of the table. The database version never hurts either.
Chris -
Apache Virtual Hosts and Weblogic 5.1SP6
Running:
WebLogic Server 5.1.0 w/ Service Pack 6
Solaris 7
Hello, I've been reading through the newsgroups and saw alot of information on
setting up apache and weblogic to handle virtual hosts, but am still having problems
getting it to work.
I have 2 domains that will be served up by one instance of Apache using NameBased
virtual hosts and I would like to have our one instance of WebLogic 5.1SP6 handle
them as well.
Excerpt from my httpd.conf file:
NameVirtualHost 216.xx.x.xx:80
<VirtualHost vcstgws011:80>
ServerName vcstgws011.domain1.com
Port 80
DocumentRoot /opt/vci-10.8/webapps/www
DirectoryIndex index.jsp
<Directory "/opt/vci-10.8/webapps/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost vcstgws011:80>
ServerName www.domain2.com
Port 80
DocumentRoot /opt/vci-10.8/webapps/www/dsl
DirectoryIndex index.jsp
<Directory "/opt/vci-10.8/webapps/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Under my default server configuration I have the WebLogic stuff:
<IfDefine WL>
WebLogicCluster vcstgas011.domain1.com:7001
Debug on
DebugConfigInfo on
ConnectTimeoutSecs 60
HungServerRecoverSecs 300
Debug on
DebugConfigInfo on
<Files *.jsp>
SetHandler weblogic-handler
</Files>
<Location /weblogic>
SetHandler weblogic-handler
PathTrim /weblogic
</Location>
<Location /servlet>
SetHandler weblogic-handler
</Location>
<Location /Admin*>
SetHandler weblogic-handler
</Location>
<Location /j_security_check>
SetHandler weblogic-handler
</Location>
</IfDefine>
And here's an excerpt from my weblogic.properties file:
# HTTPD
weblogic.httpd.enable=true
# DocumentRoot configuration
weblogic.httpd.defaultWebApp=/opt/vci-10.8/webapps/www
weblogic.httpd.indexDirectories=true
Any help would be appreciated.
Thanks,
MarkAnyone have success with Name-Based virtual hosts using same instance of WebLogic?
"Mark Mangano" <[email protected]> wrote:
>
Running:
WebLogic Server 5.1.0 w/ Service Pack 6
Solaris 7
Hello, I've been reading through the newsgroups and saw alot of information
on
setting up apache and weblogic to handle virtual hosts, but am still
having problems
getting it to work.
I have 2 domains that will be served up by one instance of Apache using
NameBased
virtual hosts and I would like to have our one instance of WebLogic 5.1SP6
handle
them as well.
Excerpt from my httpd.conf file:
NameVirtualHost 216.xx.x.xx:80
<VirtualHost vcstgws011:80>
ServerName vcstgws011.domain1.com
Port 80
DocumentRoot /opt/vci-10.8/webapps/www
DirectoryIndex index.jsp
<Directory "/opt/vci-10.8/webapps/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost vcstgws011:80>
ServerName www.domain2.com
Port 80
DocumentRoot /opt/vci-10.8/webapps/www/dsl
DirectoryIndex index.jsp
<Directory "/opt/vci-10.8/webapps/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Under my default server configuration I have the WebLogic stuff:
<IfDefine WL>
WebLogicCluster vcstgas011.domain1.com:7001
Debug on
DebugConfigInfo on
ConnectTimeoutSecs 60
HungServerRecoverSecs 300
Debug on
DebugConfigInfo on
<Files *.jsp>
SetHandler weblogic-handler
</Files>
<Location /weblogic>
SetHandler weblogic-handler
PathTrim /weblogic
</Location>
<Location /servlet>
SetHandler weblogic-handler
</Location>
<Location /Admin*>
SetHandler weblogic-handler
</Location>
<Location /j_security_check>
SetHandler weblogic-handler
</Location>
</IfDefine>
And here's an excerpt from my weblogic.properties file:
# HTTPD
weblogic.httpd.enable=true
# DocumentRoot configuration
weblogic.httpd.defaultWebApp=/opt/vci-10.8/webapps/www
weblogic.httpd.indexDirectories=true
Any help would be appreciated.
Thanks,
Mark -
SSL virtual host with external hardware accelerator/LBR
Hi all,
We have an existing non-ssl site configured - http://abc.company1.com
We wish to add a new https site - https://xyz.company2.com - and terminate SSL at our hardware load balancer. But obviously keep our existing http site available.
However, we can't seem to get this to work. We added a new site to the Web Cache, registered it with sso, updated httpd.conf and iasconfig.xml with the new virtual host and ran ptlconfig.
Has anyone successfuly implemented a similar configuration?
Is it possible to have a mixture of http and https virtual hosts with SSL termination at the LBR?
Thanks in advance,
AndyYeah, in the app server admin guide for SSL configuration:
17.3.5 Enabling SSL in Virtual Hosts
You can use virtual hosts to deploy multiple Web sites on a single Oracle HTTP Server (for example, to make an application available over the HTTP protocol and the HTTPS protocol).
The Oracle Application Server Single Sign-On Administrator's Guide, section titled "Configuring mod_osso with Virtual Hosts" contains instructions on configuring an SSL virtual host to be protected by mod_osso. You cannot use name-based virtual hosting. You must use IP-based or port-based virtual hosting.
//This may be your problem - granted no symptoms were provided. -
Struggling with Apache Virtual Hosts
Hi Folks,
I'm having trouble getting Apache virtual hosts to function
on my work PC.
PHP works. The PHP info page loads fine. I just can't get any
virtual hosts
to function. Get "Cannot find server or DNS Error."
The identical configuration on my home machine works fine.
Some details
below.
Windows HOSTS file:
127.0.0.1 localhost
127.0.0.1 mvhms
Apache 2.0 virtual host settings in httpd.conf file:
# Use name-based virtual hosting.
NameVirtualHost *:80
# Edited by Phil 3/15/2007
<VirtualHost *:80>
DocumentRoot c:/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/htdocs/mvhms
ServerName mvhms
</VirtualHost>
Any help greatly appreciated. Thanks.
Phil
Work PC is on a LAN
Windows XP Pro
Apache 2.0.59
PHP 5.1.6
Reference: PHP for Dreamweaver 8Hi Bev,
I tried various local IP addresses with no luck.
However, I do think it may be a local LAN or HOSTS file
issue. If I remove
the proper references from my home HOSTS file, I get the
identical behavior
as my work machine.
Is there a Windows HOSTS file bypass or Group Policy setting
that our IT
department may have changed?
Phil
"bsoliman" <[email protected]> wrote in
message
news:etcioa$839$[email protected]..
> You're welcome, Phil.
>
> Hmmm, in that case then I'm stumped too. If the exact
same setup is
> working
> for you at home, then I have a sneaking suspicion that
it has something to
> do
> with being on a LAN. Unfortunately, that's just a gut
instinct and I
> couldn't
> tell you what the acutal problem might be. Hopefully
someone else will
> come
> along that can help you out.
>
> This is a total shot in the dark: Why not try changing
127.0.0.1 to your
> machine's IP address on the LAN? I'm obviously grabbing
at straws here,
> but I
> figure trying something (no matter how farfetched) is
better than sitting
> around feeling aggravated while waiting for help :-)
> -
Does Apache Virtual Hosting work with localhost?
I'm a newbie trying to learn how apache web server works. I've activated apache web server on my Mac PowerBook G4, and tweaked the config file to get PHP, SSI and CGI working.
If I type the url http://127.0.0.1/ I get the same page as http://localhost/
If localhost is the domain name for the address 127.0.0.1, can I assign other domain names to 127.0.0.1 using apache's virtual hosting?
Ti Powerbook G4 Mac OS X (10.4.4)localhost is defined as 127.0.0.1. You can use them interchangeably.
As for virtual hosts, sure. Apache doesn't care.
There are two ways of running virtual hosts.
Port-based virtual hosts use a port number other than the standard 80. They can be accessed via something like http://localhost:8000/
Name-based virtual hosts look at the hostname header in the request to work out which site to serve. You can run any number of sites on the same port number this way, but you need to be able to control DNS so that it points to your machine.
If you are just testing this locally you can edit /etc/hosts to add whatever hostnames you like;
127.0.0.1 localhost my.testsite.com me.mydomain.com
Now when you enter 'my.testsite.com' or 'my.mydomain.com' in your web browser, /etc/hosts will resolve this to 127.0.0.1 and you'll talk to your local apache server.
Note that the localhost entries don't have to be in your domain. You can use this to override any real hostname you like.
Of course, if you want remote users to access this site you'll need to setup something in the DNS, or edit their /etc/hosts files individually. -
SSL with virtual hosting in Weblogic Server 5.1(WLS5.1)
Hello,
I am tasked with implementing a virtual hosting situation that must
use SSL. It goes like this: https://www.aaa.com, https://www.bbb.com
and https://www.ccc.com all having separate IPs. These URLs must
forward the request to the same WebLogic Server instance. The problem
is each URL must have its own certificate while WLS 5.1 only uses one
certificate per instance.
I was thinking about using a proxy server such that all three Web
servers that would host the URLs would be sent to a proxy server which
would redirect to the WLS 5.1 instance.
My questions are, would this be feasible using WLS 5.1 as the Web
Server and again WLS as the App Server? How secure is this
arrangement? Is it preferable to use another vendor's software as the
WebServer(IPlanet, Apache)Hi Andy,
I think a good approach for you would be to use a proxy server --
browser -> proxy that supports virtual hosting -> WebLogic
Use a proxy which supports virtual hosting, and which can have a separate
certificate bound to each virtual host.
That way you can do SSL between the browser and the proxy, and you can
have the proxy do cleartext to WebLogic.
This situation gets around WebLogic's limitation of allowing only one
certificate per instance of the server.
You could also use 5.1 as the proxy in the following manner:
Run 3 instances of Weblogic, each as a proxy server, each bound to a
different IP address and DNS name, having its own certificate --
one instance for aaa.com, another for bbb.com, and a third for ccc.com
Then have each of these three instances of WebLogic proxy to your "app
server" instance of WebLogic on the backend.
Hope this makes sense.
Joe Jerry
Andy Walker wrote:
Hello,
I am tasked with implementing a virtual hosting situation that must
use SSL. It goes like this: https://www.aaa.com, https://www.bbb.com
and https://www.ccc.com all having separate IPs. These URLs must
forward the request to the same WebLogic Server instance. The problem
is each URL must have its own certificate while WLS 5.1 only uses one
certificate per instance.
I was thinking about using a proxy server such that all three Web
servers that would host the URLs would be sent to a proxy server which
would redirect to the WLS 5.1 instance.
My questions are, would this be feasible using WLS 5.1 as the Web
Server and again WLS as the App Server? How secure is this
arrangement? Is it preferable to use another vendor's software as the
WebServer(IPlanet, Apache) -
Using SSL with Apache Virtual Hosts
I am configuring Apache to use 3 virtual Host(Named base virtual Host).
I would like to run SSL on two of the 3 virtual host.
Do I need to gen a certificate for each virtual host or can I just use 1?William,
I thought I'd give my 2 cents on this...
Is there any particular reason as to why you are using named based virtual hosts?
Apache recommends using IP based virtual hosts over name based virtual hosts.
Go to http://httpd.apache.org/docs/dns-caveats.html and read the discussion on IP based virtual hosts and name based virtual hosts. The document describes the drawbacks to using the name-based approach.
Hope this helps!
-Manjeet -
Following the book in chapter 2 I think Ivé followed everything correctly, but have encluded all the things I've edited below.
I was using wamp with no problems but after trying to set up a virtual host and now using xampp im abit lost its probabsomething stupid but I can find the prob.
(This post is abit long and dragged out so I used some colour to try ease the reading..)
When I try to view a dynamic page in live view or in firefox I get the following error:
**when using:
<VirtualHost *:80>
DocumentRoot c:/xampp/htdocs
ServerName localhost
</VirtualHost>
result:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
thegoodlife
2009/10/13 12:47:48 PM
Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
*when using:
<VirtualHost *:80>
DocumentRoot c:/htdocs
ServerName localhost
</VirtualHost>
result:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
thegoodlife
2009/10/13 12:32:58 PM
Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
This is what I've done, blue indicating where I have or was meant to edit, red being the relivant context. (hope it helps )
1. Created a new folder called htdocs (C:\htdocs)
2. Changed the pathname to:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
DocumentRoot "C:/htdocs"
and
# This should be changed to whatever you set DocumentRoot to.
<Directory "C:/htdocs">
3. Created vhosts folder; with a sub-folder called thegoodlife (C:\vhosts)
4. entered new vhost:
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 dwcs4
127.0.0.1 thegoodlife
127.0.0.1 bin.errorprotector.com ## added by CiD
5.It says uncomment the command by removing the #, (Supplemental configuation.), but this is the origional file; already uncommented?
# Real-time info on requests and configuration
Include "conf/extra/httpd-info.conf"
# Virtual hosts
Include "conf/extra/httpd-vhosts.conf"
# Distributed authoring and versioning (WebDAV)
Include "conf/extra/httpd-dav.conf"
6.Set the permissions and changed the code as instructed, unsing (c:/xampp/htdocs) as advised.
# You may use the command line option '-S' to verify your virtual host
# configuration.
<Directory C:/vhosts>
Order Deny,Allow
Allow from all
</Directory>
# Use name-based virtual hosting.
##NameVirtualHost *:80
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
<VirtualHost *:80>
DocumentRoot c:/xampp/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/dwcs4
ServerName dwcs4
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/thegoodlife
ServerName thegoodlife
</VirtualHost>
Then creating the site definition:
local root forlder: C:\htdocs\thegoodlife\
testing server folder: C:\vhosts\thegoodlife\
URL prefix: http://thegoodlife/
hope i've covered all area's where I could have gone wrongJust one more thing - the description of what i did while first Kernel appeared:
Happened 2 days ago. Wasn't turning it off for like a day, only sleep mode by closing it. Worked fine all day, wasn't doing anything, except for checking mail 2-3 times and having windows 7 virtual machine opened but doing nothing, everything was going fine. Then closed it without turning off.
Opened 3-4 hours later, everything was working fine for 30 minutes of checking mail, then Kernel appeared. After that pretty much everything i did is described in part 1-5.
Note: all the time MBP was connected to internet via wifi, so updates to both MBP and virtual machine of all programs were possible.
I only shared downloads and desktop folders, so windows couldn't have access to system folder of Mac Os.
Hope this might help...Thanks again. -
Virtual Hosts in Apache HTTP Server
How to configure virtual hosts in Apache HTTP Server httpd.conf file.
If I want to access my server with some other name(alias), how can I do this ?
Suggestions in this matter would be highly helpful.
Thanks
Vidhyut AroraFollowing is a note explaining how to setup
Virtual hosts.
Hope this helps
Ranga
Note:70647.1
Subject: Apache Server Virtual Hosting
Last Revision Date: 07-JUN-2001
PURPOSE
This document discusses considerations for setting up virtual hosts on an
Apache machine, to include how to get the hostname working and how to
configure Apache.
SCOPE & APPLICATION
The information in this document is intended for those who manage multiple sites
using an Apache machine.
REFERENCES
First published in Apache Week issue 31 (6th September 1996)
Last update 20th September 1998
Using Virtual Hosts
Virtual Hosts let you run multiple independent Web sites on a single host with
a single Apache setup.
One of the most important facilities in Apache is its ability to run virtual
hosts. This is now the essential way to run multiple Web services - each with
different host names and URLs - that appear to be completely separate sites.
This is widely used by ISPs, hosting sites and content providers who need to
manage multiple sites but do not want to buy a new machine for each one.
Picking an IP address
There are two types of virtual hosts: IP-based and non-IP-based. The former is
where each virtual host has its own IP address. You must have a new IP address
for each virtual host you want to set up, either from your existing allocation
or by obtaining more from your service provider. When you have extra IP
addresses, you tell your machine to handle them. On some operating systems, you
can give a single ethernet interface multiple addresses (typically with an
fconfig alias command). On other systems, you must have a different
physical interface for each IP address (typically by buying extra ethernet
cards).
IP addresses are a resource that costs money and are increasingly difficult to
get, so modern browsers can now also use 'non-IP' virtual hosts. This
lets you use the same IP address for multiple host names. When the server
receives an incoming Web connection, it does not know the hostname that was used
in the URL. However, the new HTTP/1.1 specification adds a facility where the
browser must tell the server the hostname it is using, on the Host: header. If
an older browser connects to a non-IP virtual host, it does not send the Host:
header, so the server must respond with a list of possible virtual
hosts. Apache provides some help for configuring a site for both old and new
browsers.
Picking a Hostname and Updating the DNS
Having selected an IP address, the next stage is to update the DNS so that
browsers can convert the hostname into the right address. The DNS is the system
that every machine connected to the internet uses to find the IP address of host
names. If your hostname is not in the DNS, no one can connect to
your server (except by the unfriendly IP address).
If the virtual hostname you are going to use is under your existing domain,
you can just add the record into your own DNS server. If the virtual hostname
is in someone else's domain, you must get them to add it to their DNS
server files. In some cases, you want to use a domain not yet used on the
internet, in which case you must apply for the domain name from the
InterNIC and set up the primary and secondary DNS servers for it, before adding
the entry for your virtual host.
In any of these cases, the entry you need to add to the DNS is an address record
(an A record) pointing to the appropriate IP address. For example, say you want
the domain www.my-dom.com to access your host with IP address 10.1.2.3: you
must add the following line to the DNS zone file for my-dom.com:
www A 10.1.2.3
Now, users can enter http://www.my-dom.com/ as a URL in their browsers and get
to your Web server. However, it will return the same information as if the
machine's original hostname had been used. So, the final stage is to tell Apache
how to respond differently to the different addresses.
How Apache Handles Virtual Hosts
Configuring Apache for virtual hosts is a two-stage process. First, it needs
to be told which IP addresses (and ports) to listen to for incoming Web
connections. By default, Apache listens to port 80 on all IP addresses of the
local machine, and this is often sufficient. If you have a more complex
requirement, such as listening on various port numbers, or only to specific IP
addresses, then the BindAddress or Listen directives can be used.
Second, having accepted an incoming Web connection, the server must be
configured to handle the request differently, depending on what virtual host it
was addressed to. This usually involves configuring Apache to use a different
DocumentRoot.
Telling Apache Which Addresses to Listen To
If you are happy for Apache to listen to all local IP addresses on the port
specified by the Port directive, you can skip this section. However, there are
some cases where you want to use the directives explained here:
- If you have many IP addresses on the machine but only want to run a Web
server on some of them
- If one or more of your virtual hosts is on a different port
- If you want to run multiple copies of the Apache server serving different virtual
hosts
There are two ways of telling Apache what addresses and ports to listen to:
- Use the BindAddress directive to specify a single address or port
- Use the Listen directive to any number of specific addresses or ports
For example, if you run your main server on IP address 10.1.2.3 port 80, and a
virtual host on IP 10.1.2.4 port 8000, you would use:
Listen 10.1.2.3:80
Listen 10.1.2.4:8000
Listen and BindAddress are documented on the Apache site.
Configuring the Virtual Hosts
Having gotten Apache to listen to the appropriate IP addresses and ports, the
final stage is to configure the server to behave differently for requests on
each of the different addresses. This is done using <VirtualHost> sections in
the configuration files, normally in httpd.conf.
A typical (but minimal) virtual host configuration looks like this:
<VirtualHost 10.1.2.3>
DocumentRoot /www/vhost1
ServerName www.my-dom.com
</VirtualHost>
This should be placed in the httpd.conf file. You replace the text
10.1.2.3 with one of your virtual host IP addresses. If you want to specify a
port as well, follow the IP address with a colon and the port number
(example: 10.1.2.4:8000). If omitted, the port defaults to 80.
If no <VirtualHost> sections are given in the configuration files, Apache
treats requests from the different addresses and ports identically. In terms of
setting up virtual hosts, we call the default behavior the main server
configuration. Unless overridden by <VirtualHost> sections, the main server
behaviour is inherited by all the virtual hosts. When configuring virtual
hosts, you must decide what changes to make in each of the virtual
host configurations.
Any directives inside a <VirtualHost> section apply to just that virtual host.
The directives either override the configuration give in the main server, or
supplement it, depending on the directive. For example, the DocumentRoot
directive in a <VirtualHost> section overrides the main server's DocumentRoot,
while AddType supplements the main server's mime types.
Now, when a request arrives, Apache uses the IP address and port it arrived on
to find a matching virtual host configuration. If no virtual host matches the
address and port, it is handled by the main server configuration. If it does
match a virtual host address, Apache uses the configuration of that virtual
server to handle the request.
For the example above, the server configuration used is the same as the
main server, except that the DocumentRoot is /www/vhost1, and the
ServerName is www.my-dom.com. Directives commonly set in <VirtualHost>
sections are DocumentRoot, ServerName, ErrorLog and TransferLog. Directives
that deal with handling requests and resources are valid inside <VirtualHost>
sections. However, some directives are not valid inside <VirtualHost> sections,
including BindAddress, StartSevers, Listen, Group and User.
You can have as many <VirtualHost> sections as you want. You can
leave one or more of your virtual hosts being handled by the main server, or
have a <VirtualHost> for every available address and port, and leave the main
server with no requests to handle.
VirtualHost sections for non-IP Virtual Hosts
Non-IP virtual hosts are configured in a very similar way. The IP address that
the requests arrive on is given in the <VirtualHost> directive, and the
host name is put in the ServerName directive. The difference is that there
(usually) is more than one <VirtualHost> section handling the same IP address.
For Apache to know whether a request arriving on a particular IP
address is supposed to be a name-based requests, the NameVirtualHost directive
addresses for name-based requests. A virtual host can handle more than one
non-IP hostname by using the ServerAlias directive, in addition to the
ServerName.
null
Maybe you are looking for
-
ITunes Software Update Does Not Work
In iTunes v 10.5.3.3 I click on Help, Check For Updates. iTunes responds with "A new version of iTunes (10.6) is available. Would you like to download it now?". I click on "Download iTunes". The "Apple Software Update" Dialog Box appears but iTune
-
I have a client who has upgraded their Mac. EHT Admin still shows all the clients in the FUI, but they lost the passwords. They don't seem to be in the keychain. Any ideas for retrieving/migrating them?
-
WQL Help - Win32_NetworkAdapterConfiguration
Hi guys/girls, I can't seem to figure out how to filter out the NICs without default gateway set: More readable version: gwmi -Query 'SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE DefaultIPGateway IS NOT NULL' gwmi -Query 'SELECT IPAd
-
Reports ---- Form calling on Web (Pay Attention : Oracle Team)
Hi, we are trying to call form from Report in Drill Down Report we are working on Client/Server system. Please help . We can call form FROM Report on MS Windows platform by using App.Begin Routine but we are unable to do so on web. srw.set_hyperlink
-
Image shakes and picture has to much blue effect when burned on DVD
I edited a 40 minutes movie with Final Cut Express with lots of different transitions. The results are great in Final Cut on my computer screen but when I burned it on a DVD and watched it on a TV screen the image is jumpy on every transitions and wh