Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

Post by Francois Rajchenbac » Mon, 11 Nov 1996 04:00:00



I have Apache 1.1.1 running on Linux 2.0.23.

I'd want non-IP Virtual Hosting in order to have different documents trees
for each address www.ese-metz.fr and www2.ese-metz.fr.

Firstly, I did not succeed in this. I only managed to have 2 ports
www.ese-metz.fr:80 and www.ese-metz.fr:81. Here are lines I changed in
httpd.conf :

        Listen 192.70.65.31:80
        Listen 192.70.65.31:81

        <VirtualHost www.ese-metz.fr:81>
        ...
        DocumentRoot /local/www/htdev
        ...
        </VirtualHost>

DocumentRoot for default host is /local/www/htdocs ( configured in srm.conf
).
ServerRoot is /local/www.

It was working til yesterday. I changed httpd.conf in order to change
ErrorDocument. Then I killed and restarted httpd. And now, though I still
have 2 different DocumentRoots, only one is responding ( htdocs ) for both
ports. I had the same problem when I wanted 2 different hostnames.

Can anybody tell me one's complete solution working for 2-port or
2-hostname Virtual Hosting ?

Many thanks.

*******************************************************
Francois Rajchenbach     Supelec ( 3rd year )
co-webmaster of http://www.ese-metz.fr

*******************************************************

 
 
 

Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

Post by Robert (\r » Mon, 11 Nov 1996 04:00:00



>I have Apache 1.1.1 running on Linux 2.0.23.

>I'd want non-IP Virtual Hosting in order to have different documents trees
>for each address www.ese-metz.fr and www2.ese-metz.fr.

The Apache docs explain this precisely, e.g.

http://gd.tuwien.ac.at/infosys/servers/http/apache/docs/1.1/host.html

Using non-IP Virtual Hosts

Using the new virtual hosts is quite easy, and superficially looks
like the old method. You simply add to one of the Apache configuration
files (most likely httpd.conf or srm.conf) code similar to the
following:

    <VirtualHost www.apache.org>
    ServerName www.apache.org
    DocumentRoot /usr/web/apache
    </VirtualHost>

Dont forget that your browser must send the host: header field.

\rho

 
 
 

Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

Post by Francois Rajchenbac » Mon, 11 Nov 1996 04:00:00


Quote:> The Apache docs explain this precisely, e.g.

> http://gd.tuwien.ac.at/infosys/servers/http/apache/docs/1.1/host.html

> Using non-IP Virtual Hosts

> Using the new virtual hosts is quite easy, and superficially looks
> like the old method. You simply add to one of the Apache configuration
> files (most likely httpd.conf or srm.conf) code similar to the
> following:

>     <VirtualHost www.apache.org>
>     ServerName www.apache.org
>     DocumentRoot /usr/web/apache
>     </VirtualHost>

> Dont forget that your browser must send the host: header field.

> \rho

I've read this document. And I think I correctly applied Apache's
instructions. Tell me if you find errors in what I wrote.
But it doesn't work. That's why I need a COMPLETE and EFFICIENT list of
instructions. Those given by Apache seem to be insufficient.

Thanks for tell me about your experience.

Rachou

*******************************************************
Francois Rajchenbach     Supelec ( 3rd year )
co-webmaster of http://www.ese-metz.fr

*******************************************************

 
 
 

Definitive conf for Apache 1.1.1 non-IP Virtual Hosting ?

Post by Bjorn Boru » Tue, 12 Nov 1996 04:00:00


I am sorry for the lengthly post, but I hope that I might be able to
help this guy so bear over with me.


|
| I've read this document. And I think I correctly applied Apache's
| instructions. Tell me if you find errors in what I wrote.
| But it doesn't work. That's why I need a COMPLETE and EFFICIENT list of
| instructions. Those given by Apache seem to be insufficient.
|
| Thanks for tell me about your experience.

your primary objective seemed to be using virtual hosting based on
separate IP-adresses and not using different port numbers on the same
IP-address, so I'll try to contribute to getting you closer to your
original idea since I think that using nonstandard ports is
confusing to the user.

here we go:

1. allocate two (or more) IP-adresses for your machine.  let's say you
   have 10.0.0.10 and 10.0.0.11 (just an example!).  register these
   IP-adresses in DNS so that you have names mapping to and from them.
   (still, you can test this without having DNS mapping)

2. make sure your Linux machine has aliasing (NET_ALIAS device)
   compiled in or that the module is loaded if you prefer having
   it as a loadable module.
   the following document is distributed with the Linux kernel
   in the file .../Documentation/networking/alias.txt:

:  NET_ALIAS device aliasing v0.4x
:  ===============================
:    The main step taken in versions 0.40+ is the implementation of a
:    device aliasing mechanism that creates *actual* devices.
:    This development includes NET_ALIAS (generic aliasing) plus IP_ALIAS
:    (specific IP) support.
:  
:  Features
:  --------
:  o  ACTUAL alias devices created & inserted in dev chain
:  o  AF_ independent: net_alias_type objects. Generic aliasing engine.
:  o  AF_INET optimized
:  o  hashed alias address lookup
:  o  net_alias_type objs registration/unreg., module-ables.
:  o  /proc/net/aliases & /proc/net/alias_types entries
:  
:  o IP alias implementation: static or runtime module.
:  
:  Usage (IP aliasing)
:  -------------------
:    A very first step to test if you are running a net_alias-ed kernel
:    is to check /proc/net/aliases & /proc/net/alias_types entries:
:       # cat /proc/net/alias*
:  
:    For IP aliasing you must have IP_ALIAS support included by
:    static linking ('y' to 2nd question above), or runtime module
:    insertion ('m' to 2nd q. above):
:       # insmod /usr/src/linux/modules/ip_alias.o (1.3.xx)
:       # insmod /usr/src/ip_alias/ip_alias.o      (1.2.xx) see above.
:  
:  o Alias creation.
:    Alias creation is done by 'magic' iface naming: eg. to create a
:    200.1.1.1 alias for eth0 ...
:    
:      # ifconfig eth0:0 200.1.1.1  etc,etc....
:                     ~~ -> request alias #0 creation (if it not exists) for eth0
:      and routing stuff also ...
:      # route add -host 200.1.1.1 dev eth0:0  (if same IP network as
:                                           main device)
:    
:      # route add -net 200.1.1.0 dev eth0:0   (if completely new network wanted
:                                           for eth0:0)
:  
:  o Alias deletion.
:    Also done by magic naming, eg:
:  
:      # ifconfig eth0:0-  0  (maybe any address)
:                     ~~~ -> will delete alias (note '-' after dev name)
:    alias device is closed before deletion, so all network stuff that
:    points to it (routes, arp entries, ...) will be released.
:                                  
:  Alias (re-)configuring
:    Aliases *are* devices, so you configure and refer to them as usual (ifconfig,
:    route, etc).
:    
:  o Procfs entries
:    2 entries are added to help fetching alias runtime configuration:
:    a) /proc/net/alias_types
:       Will show you alias_types registered (ie. address families that
:       can be aliased).
:       eg. for IP aliasing with 1 alias configured:
:  
:       # cat /proc/net/alias_types
:       type    name            n_attach
:       2       ip              1      
:      
:    b) /proc/net/aliases
:       Will show aliased devices info, eg (same as above):
:  
:       # cat /proc/net/aliases
:       device           family address                                
:       eth0:0           2      200.1.1.1
:  
:  Relationship with main device
:  -----------------------------
:    - On main device closing, all aliases will be closed and freed.
:    - Each new alias created is inserted in dev_chain just before next
:      main device (aliases get 'stacked' after main_dev), eg:
:        lo->eth0->eth0:0->eth0:2->eth1->0
:      If eth0 is unregistered, all it aliases will also be:
:        lo->eth1->0    
:  
:  Contact
:  -------
:  Please finger or e-mail me:

3. strip down your httpd.conf and separate the configuration
   parameters into common and per-virtual host parts.  the
   http.conf on one of my test-servers looks like this:

  # Test-server for module development.
  # NB: internal network, use outside server for public stuff.
  #
  #
  # basic directives that you are unlikely to change
  #
  ServerType standalone
  Port 8005
  User borud
  Group foobar
  ServerRoot /home/borud/httpd
  PidFile logs/httpd.pid
  ScoreBoardFile logs/apache_status
  HostnameLookups off

  Timeout 400
  KeepAlive 5
  KeepAliveTimeout 15
  MinSpareServers 5
  MaxSpareServers 10
  StartServers 10
  MaxClients 255
  MaxRequestsPerChild 50

  # www.foobar.no (behind firewall)
  #
  <VirtualHost 10.0.0.5>

  DocumentRoot /home/borud/httpd/home
  ServerName www.foobar.no
  ErrorLog logs/error_log
  TransferLog logs/access_log
  ScriptAlias /cgi-bin/ /home/borud/httpd/cgi-bin/
  </VirtualHost>

  # milquetoast.foobar.no (behind firewall)
  #
  <VirtualHost 10.0.0.4>

  DocumentRoot /home/borud/httpd/milky-home
  ServerName milquetoast.foobar.no
  ErrorLog logs/milky-error_log
  TransferLog logs/milky-access_log
  ScriptAlias /cgi-bin/ /home/borud/httpd/cgi-bin/
  </VirtualHost>

this has always worked for me and I have set up this hundreds of times
without any problems.  maybe there's something I'm missing here?

did this help anyone?

-Bj?rn
--

 <URL:http://www.pvv.unit.no/~borud/>  | as damage and routes around it."
 UNIX person, one of "them"            |         - John Gilmore

 
 
 

1. Apache- Non-IP Virtual Hosts

Greetings,

I have a question about VirtualHost'ing options on Apache 1.1.3.  I have
had success using the <VirtualHost> option without a dedicated IP (yes,
I know the pros and cons) for non-critical domain hosting.

This has worked well for for www.domain.com however, I would like the
domain to be accessible via either domain.com and www.domain.com. I have
read the relevant document at apache.org, and it states that I should
use the ServerAlias command within the VirtualHost tags.

I have tried the following:

<VirtualHost domain.com>
ServerAlias domain.com *.domain.com
...other stuff...
</VirtualHost>

<VirtualHost www.domain.com>
ServerAlias domain.com *.domain.com
...other stuff...
</VirtualHost>

The DNS records contain A records for both domain.com and www, both of
which point to the servers IP.

The above both yield the correct results when trying www.domain.com, but
return the servers main page when trying just domain.com.

Any ideas?

Thanks,

S. William Schulz

2. script to clean up file names? (remove special characters)

3. Newbie question: Apache 1.1x or 1.2x for non-ip virtual host

4. Ultra DMA and FAT32 patch

5. maximum non-ip virtual hosts with apache?

6. v90 internal modem

7. Non-IP Virtual Host with Apache

8. GNU/Linux mini network server

9. Apache non-IP Virtual Host and AOL

10. Apache server config for non IP based virtual host

11. ApacheSSL 1.2b8/0.6.6 Non-IP Virtual Hosts

12. non-IP virtual hosting

13. non-ip based virtual hosting