Virtual Hosting problem with Apache 1.3

Virtual Hosting problem with Apache 1.3

Post by Ricky Ta » Tue, 18 Apr 2000 04:00:00


        I've a problem about virtual hosting using same IP for multiple
hostnames. I have setup the <Virtualhost> section exactly to the word
of the documentation, but everytime the web server is accessed, the
document in /usr/local/httpd/docs is served instead of those configurated
in <Virtualhost>. httpd -S shows the virtual hosts are correctly
configarated. The DNS is also correctly configurated for the hostnames.

        Please see the attached httpd.conf, thanks in advance for any help.


## httpd.conf -- Apache HTTP server configuration file

# Based upon the NCSA server configuration files originally by Rob McCool.
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:> for detailed information about
# the directives.
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are
# consult the online docs. You have been warned.  
# After this file is processed, the server will look for and process
# /usr/local/httpd/conf/srm.conf and then /usr/local/httpd/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default'
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32),
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".

### Section 1: Global Environment
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.

# ServerType is either inetd, or standalone.  Inetd mode is only supported
# Unix platforms.
ServerType standalone

# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at <URL:>);
# you will save yourself a lot of trouble.
# Do NOT add a slash at the end of the directory path.
ServerRoot "/usr/local/httpd"

# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename.
LockFile /var/lock/subsys/httpd/httpd.accept.lock

# PidFile: The file in which the server should record its process
# identification number when it starts.
PidFile /var/run/

# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know
# this file will be  created when you run Apache) then you *must* ensure
# no two invocations of Apache share the same scoreboard file.
ScoreBoardFile /var/log/httpd.apache_runtime_status

# In the standard configuration, the server will process this file,
# srm.conf, and access.conf in that order.  The latter two files are
# now distributed empty, as it is recommended that all directives
# be kept in a single file for simplicity.  The commented-out values
# below are the built-in defaults.  You can have the server ignore
# these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

# Timeout: The number of seconds before receives and sends time out.
Timeout 300

# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
KeepAlive On

# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
MaxKeepAliveRequests 100

# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
KeepAliveTimeout 15

# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
MinSpareServers 1
MaxSpareServers 1

# Number of servers to start initially --- should be a reasonable ballpark
# figure.
StartServers 1

# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
MaxClients 150

# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
MaxRequestsPerChild 0

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#Listen 3000

# BindAddress: You can support virtual hosts with this option. This
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#BindAddress *

<IfDefine PHP>
LoadModule php3_module /usr/lib/apache/
<IfDefine PERL>
LoadModule perl_module /usr/lib/apache/
<IfDefine DAV>
LoadModule dav_module         /usr/lib/apache/

# Dynamic Shared Object (DSO) Support
# To be able to use the functionality of a module which was built as a DSO
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `httpd -l' for the list of
# built-in (statically linked and thus always available) modules in your
# binary.
# Note: The order is which modules are loaded is important.  Don't change
# the order below without expert advice.
# Example:
# LoadModule foo_module libexec/
LoadModule mmap_static_module /usr/lib/apache/
LoadModule vhost_alias_module /usr/lib/apache/
LoadModule env_module         /usr/lib/apache/
LoadModule define_module      /usr/lib/apache/
LoadModule config_log_module  /usr/lib/apache/
LoadModule agent_log_module   /usr/lib/apache/
LoadModule referer_log_module /usr/lib/apache/
LoadModule mime_magic_module  /usr/lib/apache/
LoadModule mime_module        /usr/lib/apache/
LoadModule negotiation_module /usr/lib/apache/
LoadModule status_module      /usr/lib/apache/
LoadModule info_module        /usr/lib/apache/
LoadModule includes_module    /usr/lib/apache/
LoadModule autoindex_module   /usr/lib/apache/
LoadModule dir_module         /usr/lib/apache/
LoadModule cgi_module         /usr/lib/apache/
LoadModule asis_module        /usr/lib/apache/
LoadModule imap_module        /usr/lib/apache/
LoadModule action_module      /usr/lib/apache/
LoadModule speling_module     /usr/lib/apache/
LoadModule userdir_module     /usr/lib/apache/
LoadModule alias_module       /usr/lib/apache/
LoadModule rewrite_module     /usr/lib/apache/
LoadModule ...

read more »


Virtual Hosting problem with Apache 1.3

Post by Harle » Tue, 18 Apr 2000 04:00:00

could be the way you've configured the DNS.

If you used a simple alias as in:

host IN CNAME originalhost

it will result in the original domain.

On the other hand, setting up a new zone file in the /etc/named/hosts
directory with the same IP will probably work.

/s/ Harley H. Puthuff, Programmer

      (707) 522-5149


1. Apache 1.3 Virtual Hosting

I need some clarity on the new 1.3x virtual hosting scheme. I upgraded
from RedHat 5.1 Apache 1.2x by compiling and installing 1.3x source.

I have not had a problem getting the server to run, however, when using
the new virtual host syntax with the NameVirtual Host directive, the
default server namely now points to a virtual host directory
instead of the default home directory of /home/httpd/html as in 1.2.6

There is some documentation on this on the Apache web site, but it's not

Bottom Line:

Does using a Name Based virtual hosting scheme under 1.3x require that
all hosts, default or not, be defined with a <VirtualHost> tag.

Under 1.2.6 let's say I had and CNAMEs and AND only had a <VirtualHost> entry. Typing would take me to the default directory. Typing
would take me to the directory defined by the <VirtualHost> entry.
Typing would take me the same default as

What do I have to do to acheive the same results in 1.3.x

Can someone clarify this for me.


2. Analyze a core for an application

3. running 1.3 and 2.x apache on the same system...a virtual host setup question

4. Timout of root login sessions

5. Need help: virtual hosts RH 7.1 / Apache 1.3

6. Account from Linux Server missing in User Manager NT Workstation

7. Apache 1.3 / Virtual Hosts / Forbidden Error

8. How to change timezone setting after installation?

9. Virtual Hosting with Apache 1.3 for Windows NT

10. Apache 1.3 ignoring Virtual Hosts

11. Virtual Hosts in Apache 1.3 on RH 7.3

12. Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

13. Mixing Apache Name Based Virtual Hosts and SSL Virtual Host