Virtual Hosts with Apache and dynamic dns won't work??

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 09:24:02



I'm trying to get Apache working so that I can host two web sites
(mysite.dyndns.org and myothersite.dyndns.org) using one IP address but am
having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
and sits behind a linksys router that is assigned a dynamic IP from my ISP
(however it rarely changes so I just manually change it at dyndns...don't
use an IP
client yet).  Either both sites point to the same page, or neither page
loads.  My httpd.conf file is below.  Can anyone help me?

##
## 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:http://www.apache.org/docs/> 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 unsure
# consult the online docs. You have been warned.
#
# After this file is processed, the server will look for and process
# /etc/apache/srm.conf and then /etc/apache/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
a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default'
server,
#     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), the
# 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
on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept, unless they are specified
# with an absolute path.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot /etc/apache

#
# 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/apache.lock

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

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

#
# 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 /etc/apache/srm.conf
#AccessConfig /etc/apache/access.conf

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

#
# 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 5
MaxSpareServers 10

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

#
# 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 100

#
# 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
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This
directive
# 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 *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO
you
# 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 `apache -l' for the list of
already
# built-in (statically linked and thus always available) modules in your
apache
# binary.
#
# Please keep this LoadModule: line here, it is needed for installation.
# LoadModule vhost_alias_module /usr/lib/apache/1.3/mod_vhost_alias.so
# LoadModule env_module /usr/lib/apache/1.3/mod_env.so
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
# LoadModule info_module /usr/lib/apache/1.3/mod_info.so
# LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
# LoadModule asis_module /usr/lib/apache/1.3/mod_asis.so
# LoadModule imap_module /usr/lib/apache/1.3/mod_imap.so
# LoadModule action_module /usr/lib/apache/1.3/mod_actions.so
# LoadModule speling_module /usr/lib/apache/1.3/mod_speling.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
# LoadModule anon_auth_module /usr/lib/apache/1.3/mod_auth_anon.so
# LoadModule dbm_auth_module /usr/lib/apache/1.3/mod_auth_dbm.so
# LoadModule db_auth_module /usr/lib/apache/1.3/mod_auth_db.so
# LoadModule proxy_module /usr/lib/apache/1.3/libproxy.so
# LoadModule digest_module /usr/lib/apache/1.3/mod_digest.so
# LoadModule cern_meta_module /usr/lib/apache/1.3/mod_cern_meta.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
# LoadModule headers_module ...

read more »

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Mathias Koerbe » Fri, 10 Jan 2003 09:43:10



> I'm trying to get Apache working so that I can host two web sites
> (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but am
> having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> and sits behind a linksys router that is assigned a dynamic IP from my ISP
> (however it rarely changes so I just manually change it at dyndns...don't
> use an IP
> client yet).  Either both sites point to the same page, or neither page
> loads.  My httpd.conf file is below.  Can anyone help me?

> [...snip...]
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container. #
> <VirtualHost 'IP address assigned to my router'>
>     ServerName mysite.dyndns.org
>     DocumentRoot /var/www/mysite

>     var/log/apache/mysite-error.log CustomLog
>     var/log/apache/mysite-access.log common
> </VirtualHost>

> <VirtualHost 'IP address assigned to my router'>
>     ServerName myothersite.dyndns.org
>     DocumentRoot /var/www/myothersite

>     /var/log/apache/myothersite-error.log CustomLog
>     /var/log/apache/myothersite-access.log common
> </VirtualHost>

I'd fix the newline problems and try again. The directives
ErrorLog, CustomLog etc need to start on a new line. The filenames
should be after the directives.

Post again if that does not help.

- Show quoted text -

Quote:

> #<VirtualHost _default_:*>
> #</VirtualHost>


 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 10:26:57


ErrorLog and CustomLog do start on their own line...they appear to have
moved over when it was copied over.

Dave



> > I'm trying to get Apache working so that I can host two web sites
> > (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but
am
> > having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> > and sits behind a linksys router that is assigned a dynamic IP from my
ISP
> > (however it rarely changes so I just manually change it at
dyndns...don't
> > use an IP
> > client yet).  Either both sites point to the same page, or neither page
> > loads.  My httpd.conf file is below.  Can anyone help me?

> > [...snip...]

> > # VirtualHost example:
> > # Almost any Apache directive may go into a VirtualHost container. #
> > <VirtualHost 'IP address assigned to my router'>
> >     ServerName mysite.dyndns.org
> >     DocumentRoot /var/www/mysite

> >     var/log/apache/mysite-error.log CustomLog
> >     var/log/apache/mysite-access.log common
> > </VirtualHost>

> > <VirtualHost 'IP address assigned to my router'>
> >     ServerName myothersite.dyndns.org
> >     DocumentRoot /var/www/myothersite

> >     /var/log/apache/myothersite-error.log CustomLog
> >     /var/log/apache/myothersite-access.log common
> > </VirtualHost>

> I'd fix the newline problems and try again. The directives
> ErrorLog, CustomLog etc need to start on a new line. The filenames
> should be after the directives.

> Post again if that does not help.

> > #<VirtualHost _default_:*>
> > #</VirtualHost>

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by David Efflan » Fri, 10 Jan 2003 10:37:27



> I'm trying to get Apache working so that I can host two web sites
> (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but am
> having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> and sits behind a linksys router that is assigned a dynamic IP from my ISP
> (however it rarely changes so I just manually change it at dyndns...don't
> use an IP
> client yet).  Either both sites point to the same page, or neither page
> loads.  My httpd.conf file is below.  Can anyone help me?
> # ServerName: allows you to set a host name which is sent back to clients
> for
> # your server if it's different than the one the program would get (i.e.,
> use
> # "www" instead of the host's real name).
> #
> # Note: You cannot just invent host names and hope they work. The name you
> # define here must be a valid DNS name for your host. If you don't
> understand
> # this, ask your network administrator.
> # If your host doesn't have a registered DNS name, enter its IP address
> here.
> # You will have to access it by its address (e.g., http://123.45.67.89/)
> # anyway, and this will make redirections work in a sensible way.
> #
> ServerName mysite.dyndns.org

I found that multiple name based virtual hosts work best when the
ServerName is not any external (internet) virtual host (use a bogus
private name that points to your local ethernet IP in /etc/hosts).  But
also see following:

Quote:> # UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
> # Apache needs to construct a self-referencing URL (a URL that refers back
> # to the server the response is coming from) it will use ServerName and
> # Port to form a "canonical" name.  With this setting off, Apache will
> # use the hostname:port that the client supplied, when possible.  This
> # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
> #
> UseCanonicalName On

Set UseCanonicalName Off so any automatic redirects go to the proper vhost
(see docs for UseCanonicalName).

Quote:> ### Section 3: Virtual Hosts
> #
> # VirtualHost: If you want to maintain multiple domains/hostnames on your
> # machine you can setup VirtualHost containers for them.
> # Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
> # for further details before you try to setup virtual hosts.
> # You may use the command line option '-S' to verify your virtual host
> # configuration.

> #
> # If you want to use name-based virtual hosts you need to define at
> # least one IP address (and port number) for them.
> #
> #NameVirtualHost
> NameVirtualHost 'IP address assigned to my router'

Your computer will never see requests to that IP since it is the WAN side
of your router, not local to your computer.  Instead use a wildcard (*):

NameVirtualHost *

Quote:> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> #
><VirtualHost 'IP address assigned to my router'>

Likewise try <VirtualHost *> for both of these since your apache never
sees a request to your router WAN IP.

- Show quoted text -

>     ServerName mysite.dyndns.org
>     DocumentRoot /var/www/mysite

>     ErrorLog var/log/apache/mysite-error.log
>     CustomLog var/log/apache/mysite-access.log common
></VirtualHost>

><VirtualHost 'IP address assigned to my router'>
>     ServerName myothersite.dyndns.org
>     DocumentRoot /var/www/myothersite

>     ErrorLog /var/log/apache/myothersite-error.log
>     CustomLog /var/log/apache/myothersite-access.log common
></VirtualHost>

> #<VirtualHost _default_:*>
> #</VirtualHost>

This makes no sense because I believe that the first vhost is the default.

--
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by 2Host.com - Rober » Fri, 10 Jan 2003 11:32:03



> I'm trying to get Apache working so that I can host two web sites
> (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but am
> having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> and sits behind a linksys router that is assigned a dynamic IP from my ISP
> (however it rarely changes so I just manually change it at dyndns...don't
> use an IP
> client yet).  Either both sites point to the same page, or neither page
> loads.  My httpd.conf file is below.  Can anyone help me?

<snip>

I didn't bother to look through the relevant parts of the configuration,
because there's other things you need to rule our first.

What port do you run the web server on? Are you sure your provider
doesn't block access to that port (a lot block port 80 so you can't run
a web server on it).

Can you ping the IP from a remote source?

Are you able to get one web site working and accessible via remote
sources, and it's just the two that you have trouble with?
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 11:44:54


I made the following changes:

ServerName 'Computer name as defined in /etc/hosts'
UseCanonicalName Off

NameVirtualHost *

<VirtualHost *>
    ServerName myothersite.dyndns.org
    DocumentRoot /var/www/myothersite

    ErrorLog var/log/apache/myothersite-error.log
    CustomLog var/log/apache/myothersite-access.log common
</VirtualHost>

I commented out the other <VirtualHost>.

However, both sites still point to mysite.dyndns.org and display the
index.html file in /var/www/mysite.  If I run /etc/init.d/apache -S to check
the vhosts, I get:

*:80                is a NameVirtualHost
                      default server myothersite.dyndns.org
(/etc/apache/httpd.conf:1009)
                      port 80 namevhost myothersite.dyndns.org
(/etc/apache/httpd.conf:1009)

I'm assuming this means the virtual host is configured correctly?!?!

Finally, in /var/log/apache/error.log, I get:

[error] (2)No such file or directory: mod_mimi_magic: can't read magic file
/etc/apache/share/magic

What is this supposed to mean??  Thanks in advance.

Dave



> > I'm trying to get Apache working so that I can host two web sites
> > (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but
am
> > having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> > and sits behind a linksys router that is assigned a dynamic IP from my
ISP
> > (however it rarely changes so I just manually change it at
dyndns...don't
> > use an IP
> > client yet).  Either both sites point to the same page, or neither page
> > loads.  My httpd.conf file is below.  Can anyone help me?

> > # ServerName: allows you to set a host name which is sent back to
clients
> > for
> > # your server if it's different than the one the program would get
(i.e.,
> > use
> > # "www" instead of the host's real name).
> > #
> > # Note: You cannot just invent host names and hope they work. The name
you
> > # define here must be a valid DNS name for your host. If you don't
> > understand
> > # this, ask your network administrator.
> > # If your host doesn't have a registered DNS name, enter its IP address
> > here.
> > # You will have to access it by its address (e.g., http://123.45.67.89/)
> > # anyway, and this will make redirections work in a sensible way.
> > #
> > ServerName mysite.dyndns.org

> I found that multiple name based virtual hosts work best when the
> ServerName is not any external (internet) virtual host (use a bogus
> private name that points to your local ethernet IP in /etc/hosts).  But
> also see following:

> > # UseCanonicalName:  (new for 1.3)  With this setting turned on,
whenever
> > # Apache needs to construct a self-referencing URL (a URL that refers
back
> > # to the server the response is coming from) it will use ServerName and
> > # Port to form a "canonical" name.  With this setting off, Apache will
> > # use the hostname:port that the client supplied, when possible.  This
> > # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
> > #
> > UseCanonicalName On

> Set UseCanonicalName Off so any automatic redirects go to the proper vhost
> (see docs for UseCanonicalName).

> > ### Section 3: Virtual Hosts
> > #
> > # VirtualHost: If you want to maintain multiple domains/hostnames on
your
> > # machine you can setup VirtualHost containers for them.
> > # Please see the documentation at

<URL:http://www.apache.org/docs/vhosts/>

- Show quoted text -

> > # for further details before you try to setup virtual hosts.
> > # You may use the command line option '-S' to verify your virtual host
> > # configuration.

> > #
> > # If you want to use name-based virtual hosts you need to define at
> > # least one IP address (and port number) for them.
> > #
> > #NameVirtualHost
> > NameVirtualHost 'IP address assigned to my router'

> Your computer will never see requests to that IP since it is the WAN side
> of your router, not local to your computer.  Instead use a wildcard (*):

> NameVirtualHost *

> > # VirtualHost example:
> > # Almost any Apache directive may go into a VirtualHost container.
> > #
> ><VirtualHost 'IP address assigned to my router'>

> Likewise try <VirtualHost *> for both of these since your apache never
> sees a request to your router WAN IP.

> >     ServerName mysite.dyndns.org
> >     DocumentRoot /var/www/mysite

> >     ErrorLog var/log/apache/mysite-error.log
> >     CustomLog var/log/apache/mysite-access.log common
> ></VirtualHost>

> ><VirtualHost 'IP address assigned to my router'>
> >     ServerName myothersite.dyndns.org
> >     DocumentRoot /var/www/myothersite

> >     ErrorLog /var/log/apache/myothersite-error.log
> >     CustomLog /var/log/apache/myothersite-access.log common
> ></VirtualHost>

> > #<VirtualHost _default_:*>
> > #</VirtualHost>

> This makes no sense because I believe that the first vhost is the default.

> --
> David Efflandt - All spam ignored  http://www.de-srv.com/
> http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
> http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 11:47:54


One other thing...should I be able to view both of these sites from within
my LAN?  Or do I have to be accessing them from outside (I can't see why I
would have to do this...and then how do I test my sites?)?

Dave



> > I'm trying to get Apache working so that I can host two web sites
> > (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but
am
> > having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> > and sits behind a linksys router that is assigned a dynamic IP from my
ISP
> > (however it rarely changes so I just manually change it at
dyndns...don't
> > use an IP
> > client yet).  Either both sites point to the same page, or neither page
> > loads.  My httpd.conf file is below.  Can anyone help me?

> > # ServerName: allows you to set a host name which is sent back to
clients
> > for
> > # your server if it's different than the one the program would get
(i.e.,
> > use
> > # "www" instead of the host's real name).
> > #
> > # Note: You cannot just invent host names and hope they work. The name
you
> > # define here must be a valid DNS name for your host. If you don't
> > understand
> > # this, ask your network administrator.
> > # If your host doesn't have a registered DNS name, enter its IP address
> > here.
> > # You will have to access it by its address (e.g., http://123.45.67.89/)
> > # anyway, and this will make redirections work in a sensible way.
> > #
> > ServerName mysite.dyndns.org

> I found that multiple name based virtual hosts work best when the
> ServerName is not any external (internet) virtual host (use a bogus
> private name that points to your local ethernet IP in /etc/hosts).  But
> also see following:

> > # UseCanonicalName:  (new for 1.3)  With this setting turned on,
whenever
> > # Apache needs to construct a self-referencing URL (a URL that refers
back
> > # to the server the response is coming from) it will use ServerName and
> > # Port to form a "canonical" name.  With this setting off, Apache will
> > # use the hostname:port that the client supplied, when possible.  This
> > # also affects SERVER_NAME and SERVER_PORT in CGI scripts.
> > #
> > UseCanonicalName On

> Set UseCanonicalName Off so any automatic redirects go to the proper vhost
> (see docs for UseCanonicalName).

> > ### Section 3: Virtual Hosts
> > #
> > # VirtualHost: If you want to maintain multiple domains/hostnames on
your
> > # machine you can setup VirtualHost containers for them.
> > # Please see the documentation at

<URL:http://www.apache.org/docs/vhosts/>

- Show quoted text -

> > # for further details before you try to setup virtual hosts.
> > # You may use the command line option '-S' to verify your virtual host
> > # configuration.

> > #
> > # If you want to use name-based virtual hosts you need to define at
> > # least one IP address (and port number) for them.
> > #
> > #NameVirtualHost
> > NameVirtualHost 'IP address assigned to my router'

> Your computer will never see requests to that IP since it is the WAN side
> of your router, not local to your computer.  Instead use a wildcard (*):

> NameVirtualHost *

> > # VirtualHost example:
> > # Almost any Apache directive may go into a VirtualHost container.
> > #
> ><VirtualHost 'IP address assigned to my router'>

> Likewise try <VirtualHost *> for both of these since your apache never
> sees a request to your router WAN IP.

> >     ServerName mysite.dyndns.org
> >     DocumentRoot /var/www/mysite

> >     ErrorLog var/log/apache/mysite-error.log
> >     CustomLog var/log/apache/mysite-access.log common
> ></VirtualHost>

> ><VirtualHost 'IP address assigned to my router'>
> >     ServerName myothersite.dyndns.org
> >     DocumentRoot /var/www/myothersite

> >     ErrorLog /var/log/apache/myothersite-error.log
> >     CustomLog /var/log/apache/myothersite-access.log common
> ></VirtualHost>

> > #<VirtualHost _default_:*>
> > #</VirtualHost>

> This makes no sense because I believe that the first vhost is the default.

> --
> David Efflandt - All spam ignored  http://www.de-srv.com/
> http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
> http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 11:51:42


I run the webserver from port 80 and no it is not blocked.  I was accessing
mysite.dyndns.org earlier today from work.  Both sites show the same
index.html page that is located in /var/www/mysite.

Dave




> > I'm trying to get Apache working so that I can host two web sites
> > (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but
am
> > having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> > and sits behind a linksys router that is assigned a dynamic IP from my
ISP
> > (however it rarely changes so I just manually change it at
dyndns...don't
> > use an IP
> > client yet).  Either both sites point to the same page, or neither page
> > loads.  My httpd.conf file is below.  Can anyone help me?

> <snip>

> I didn't bother to look through the relevant parts of the configuration,
> because there's other things you need to rule our first.

> What port do you run the web server on? Are you sure your provider
> doesn't block access to that port (a lot block port 80 so you can't run
> a web server on it).

> Can you ping the IP from a remote source?

> Are you able to get one web site working and accessible via remote
> sources, and it's just the two that you have trouble with?
> --
> Regards,

> Server admin, support & programing for shared & dedicated web servers
> Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by 2Host.com - Rober » Fri, 10 Jan 2003 12:07:54



> I run the webserver from port 80 and no it is not blocked.  I was accessing
> mysite.dyndns.org earlier today from work.  Both sites show the same
> index.html page that is located in /var/www/mysite.

I see. Well, going from your original post:

<VirtualHost 'IP address assigned to my router'>
    ServerName mysite.dyndns.org
    DocumentRoot /var/www/mysite

    ErrorLog var/log/apache/mysite-error.log
    CustomLog var/log/apache/mysite-access.log common
</VirtualHost>

<VirtualHost 'IP address assigned to my router'>
    ServerName myothersite.dyndns.org
    DocumentRoot /var/www/myothersite

    ErrorLog /var/log/apache/myothersite-error.log
    CustomLog /var/log/apache/myothersite-access.log common
</VirtualHost>

You shouldn't use the IP address of your router. Use the IP address that
your router uses to point to that system. Then configure the router to
forward requests to port 80 to that system.

Make those changes in your Apache configuration too, to point to an IP
on the system.

make sure that IP is bound to that system.

And, before the first occorance, add:

NameVirtualHost systemip:80

Also, on the first occrance, you have:

    ErrorLog var/log/apache/mysite-error.log
    CustomLog var/log/apache/mysite-access.log common

Make sure the logs are /var/log and not var/log. If it can't find the
log file (path) to create the log file in on startup, you'll have
problems.

So, after you've bound the IP and have any local configurations (in
/etc/hosts for example) or DNS to have this a valid IP/domain:

NameVirtualHost serverip:80

<VirtualHost serverip>
    ServerName mysite.dyndns.org
    DocumentRoot /var/www/mysite

    ErrorLog /var/log/apache/mysite-error.log
    CustomLog /var/log/apache/mysite-access.log common
</VirtualHost>

<VirtualHost serverip>
    ServerName myothersite.dyndns.org
    DocumentRoot /var/www/myothersite

    ErrorLog /var/log/apache/myothersite-error.log
    CustomLog /var/log
</VirtualHost>

That looks okay from what you've offered. Also, make sure the main
configuration for the default settings are correct and do not interfere
with the virtual host directives.
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by 2Host.com - Rober » Fri, 10 Jan 2003 12:10:48




> > I run the webserver from port 80 and no it is not blocked.  I was accessing
> > mysite.dyndns.org earlier today from work.  Both sites show the same
> > index.html page that is located in /var/www/mysite.

> I see. Well, going from your original post:

> <VirtualHost 'IP address assigned to my router'>
>     ServerName mysite.dyndns.org
>     DocumentRoot /var/www/mysite

>     ErrorLog var/log/apache/mysite-error.log
>     CustomLog var/log/apache/mysite-access.log common
> </VirtualHost>

> <VirtualHost 'IP address assigned to my router'>
>     ServerName myothersite.dyndns.org
>     DocumentRoot /var/www/myothersite

>     ErrorLog /var/log/apache/myothersite-error.log
>     CustomLog /var/log/apache/myothersite-access.log common
> </VirtualHost>

> You shouldn't use the IP address of your router. Use the IP address that
> your router uses to point to that system.

Read better -> The IP address of the system the router points to.

Quote:> Also, on the first occrance, you have:

I mistyped occurrence twice, but I'm sure you made sense of it. :-)

--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Dave » Fri, 10 Jan 2003 12:38:35


Something is still not right...I've tried everything you mentioned, and both
sites still point to mysite.dyndns.org??  I must be doing something wrong
still.  I'll have to work on it again tomorrow.  Thanks for the help so far.

Dave





> > > I run the webserver from port 80 and no it is not blocked.  I was
accessing
> > > mysite.dyndns.org earlier today from work.  Both sites show the same
> > > index.html page that is located in /var/www/mysite.

> > I see. Well, going from your original post:

> > <VirtualHost 'IP address assigned to my router'>
> >     ServerName mysite.dyndns.org
> >     DocumentRoot /var/www/mysite

> >     ErrorLog var/log/apache/mysite-error.log
> >     CustomLog var/log/apache/mysite-access.log common
> > </VirtualHost>

> > <VirtualHost 'IP address assigned to my router'>
> >     ServerName myothersite.dyndns.org
> >     DocumentRoot /var/www/myothersite

> >     ErrorLog /var/log/apache/myothersite-error.log
> >     CustomLog /var/log/apache/myothersite-access.log common
> > </VirtualHost>

> > You shouldn't use the IP address of your router. Use the IP address that
> > your router uses to point to that system.

> Read better -> The IP address of the system the router points to.

> > Also, on the first occrance, you have:

> I mistyped occurrence twice, but I'm sure you made sense of it. :-)

> --
> Regards,

> Server admin, support & programing for shared & dedicated web servers
> Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by LN » Sat, 18 Jan 2003 05:58:55


Did you try accessing the site without the router ?
--
LN.

>Something is still not right...I've tried everything you mentioned, and
both
>sites still point to mysite.dyndns.org??  I must be doing something wrong
>still.  I'll have to work on it again tomorrow.  Thanks for the help so
far.

>Dave





>> > > I run the webserver from port 80 and no it is not blocked.  I was
>accessing
>> > > mysite.dyndns.org earlier today from work.  Both sites show the same
>> > > index.html page that is located in /var/www/mysite.

>> > I see. Well, going from your original post:

>> > <VirtualHost 'IP address assigned to my router'>
>> >     ServerName mysite.dyndns.org
>> >     DocumentRoot /var/www/mysite

>> >     ErrorLog var/log/apache/mysite-error.log
>> >     CustomLog var/log/apache/mysite-access.log common
>> > </VirtualHost>

>> > <VirtualHost 'IP address assigned to my router'>
>> >     ServerName myothersite.dyndns.org
>> >     DocumentRoot /var/www/myothersite

>> >     ErrorLog /var/log/apache/myothersite-error.log
>> >     CustomLog /var/log/apache/myothersite-access.log common
>> > </VirtualHost>

>> > You shouldn't use the IP address of your router. Use the IP address
that
>> > your router uses to point to that system.

>> Read better -> The IP address of the system the router points to.

>> > Also, on the first occrance, you have:

>> I mistyped occurrence twice, but I'm sure you made sense of it. :-)

>> --
>> Regards,

>> Server admin, support & programing for shared & dedicated web servers
>> Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

Virtual Hosts with Apache and dynamic dns won't work??

Post by Mathias Koerbe » Fri, 02 May 2003 20:24:59



> I'm trying to get Apache working so that I can host two web sites
> (mysite.dyndns.org and myothersite.dyndns.org) using one IP address but am
> having problems.  My webserver runs on Debian Woody (with Apache 1.3.26)
> and sits behind a linksys router that is assigned a dynamic IP from my ISP
> (however it rarely changes so I just manually change it at dyndns...don't
> use an IP
> client yet).  Either both sites point to the same page, or neither page
> loads.  My httpd.conf file is below.  Can anyone help me?

> [...snip...]
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container. #
> <VirtualHost 'IP address assigned to my router'>
>     ServerName mysite.dyndns.org
>     DocumentRoot /var/www/mysite

>     var/log/apache/mysite-error.log CustomLog
>     var/log/apache/mysite-access.log common
> </VirtualHost>

> <VirtualHost 'IP address assigned to my router'>
>     ServerName myothersite.dyndns.org
>     DocumentRoot /var/www/myothersite

>     /var/log/apache/myothersite-error.log CustomLog
>     /var/log/apache/myothersite-access.log common
> </VirtualHost>

I'd fix the newline problems and try again. The directives
ErrorLog, CustomLog etc need to start on a new line. The filenames
should be after the directives.

Post again if that does not help.

- Show quoted text -

Quote:

> #<VirtualHost _default_:*>
> #</VirtualHost>

 
 
 

1. .htaccess Apache Virtual host Won't Work

I've set up an Apache server on a Linux machine with several Virtual
host.

The problem is that I can't use .htaccess files on any of the Virtual
hosts.

The thing is that .htaccess files works fine on the main host.

What should I have between <VirtualHost> and </VirtualHost> to make the
.htaccess files work on the Virtual Hosts?

Thanks in advance

Lars

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Video card suggestions....

3. APACHE Virtual Hosting: Done by the book, but still won't work!

4. /proc/asound/

5. htaccess Apache Virtual Host Won't Work

6. syslogd dumps core

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

8. Routing via 2 providers both with NAT

9. Dynamic DNS not working with Solaris DHCP/DNS server and win clients

10. Named Virtual Host won't work.

11. virtual hosts won't work !

12. Can't get Virtual Hosting working in Apache 1.3.9