...or more likely it's an issue with my configuration. I'm trying to setup name-based virtual hosts. In my case, I have two internal sites I want to host (e.g. site1.mydomain.org and site2.mydomain.org). In /etc/httpd/conf.d/ I have two config files (site1.conf and site2.conf) corresponding to the two sites. When I attempt to visit either site via a browser, only site1 is displayed.
'httpd -S' reveals:
VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:* site1.mydomain.org (/etc/httpd/conf.d/site1.conf:4) *:* site2.mydomain.org (/etc/httpd/conf.d/site2.conf:1) _default_:443 hostname.mydomain.org (/etc/httpd/conf.d/ssl.conf:99) Syntax OK
If I uncomment the line 'NameVirtualHost *:80' in the /etc/httpd/conf/httpd.conf file and restart httpd, 'httpd -S' yields:
VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:* site1.mydomain.org (/etc/httpd/conf.d/site1.conf:4) *:* site2.mydomain.org (/etc/httpd/conf.d/site2.conf:1) _default_:443 hostname.mydomain.org (/etc/httpd/conf.d/ssl.conf:99) Segmentation fault
Attempts to visit http://site1.mydomain.org/ or http://site2.mydomain.org still result in the same page (the home page for site1). Note that the DocumentRoot directives in the site1.conf and site2.conf files are pointing to different directories...and the index.html files stored in those directories are not alike or similar.
Help would be much appreciated.
TIA,
Ronald Nissley
Am Do, den 26.08.2004 schrieb Ronald Nissley um 23:56:
...or more likely it's an issue with my configuration. I'm trying to setup name-based virtual hosts. In my case, I have two internal sites I want to host (e.g. site1.mydomain.org and site2.mydomain.org). In /etc/httpd/conf.d/ I have two config files (site1.conf and site2.conf) corresponding to the two sites. When I attempt to visit either site via a browser, only site1 is displayed.
Ronald Nissley
Did you check your DNS setup for both domains / zones?
Alexander
Am Do, den 26.08.2004 schrieb Ronald Nissley um 23:56:
...or more likely it's an issue with my configuration. I'm trying to setup name-based virtual hosts. In my case, I have two internal sites I want to host (e.g. site1.mydomain.org and site2.mydomain.org). In /etc/httpd/conf.d/ I have two config files (site1.conf and site2.conf) corresponding to the two sites.
A strange configuration, at least. Usually you have only one config file in /etc/httpd/conf, which is httpd.conf
In this file you configure the two virtual domains in the following way:
<--------------------- snip -------------------------------------> ### Section 3: Virtual Hosts # # VirtualHost: If you want to maintain multiple domains/hostnames # on your machine you can setup VirtualHost containers for them. # Most configurations use only name-based virtual hosts so the # server doesn't need to worry about IP addresses. This is # indicated by the asterisks in the directives below. # # Please see the documentation at # URL:http://httpd.apache.org/docs-2.0/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.
# # Use name-based virtual hosting. # NameVirtualHost *:80
# Defaults for virtual hosts # Logs # #
# Virtual host Default Virtual Host #<VirtualHost *> # # ServerSignature email # # DirectoryIndex index.php index.html index.htm index.shtml # # LogLevel warn # HostNameLookups off #</VirtualHost>
# Virtual host site1.mydomain.org <VirtualHost *:80> ServerName site1.mydomain.org ServerAlias www.site1.mydomain.org
DocumentRoot /var/httpd/site1 ServerAdmin root@localhost ServerSignature email </VirtualHost>
# Virtual host site2.mydomain.org <VirtualHost *:80> ServerName site2.mydomain.org ServerAlias www.site2.mydomain.org
DocumentRoot /var/httpd/site2 ServerAdmin root@localhost
ServerSignature email </VirtualHost>
<--------------------------- snip --------------------------------->
Working here perfectly
You can put the configuration for each virtual host into its own configuration (sub-)file. But it's not the fedora way of doing it (e.g. compatibel with system-config-httpd)
Peter
On Thu, Aug 26, 2004 at 05:56:56PM -0400, Ronald Nissley wrote:
If I uncomment the line 'NameVirtualHost *:80' in the /etc/httpd/conf/httpd.conf file and restart httpd, 'httpd -S' yields:
There is a bug where httpd doesn't handle defining NameVirtualHost *:80 without defining any vhosts for :80, and segfaults in httpd -S and more. You should define at least one vhost for :80 otherwise there's no point in turning on NameVirtualHost for that port.
This is fixed in the FC2 httpd package.
Regards,
joe