Free Software Server Environment : ApacheVirtualHosts

HomePage :: Categories :: PageIndex :: RecentChanges


Search this site: FSSE.INFO is produced by "osde8info" :
http://httpd.apache.org/docs/2.2/vhosts/name-based.html
http://httpd.apache.org/docs/2.2/vhosts/details.html
http://httpd.apache.org/docs/2.2/vhosts/examples.html

apache httpd name based (named) virtual hosts (vhosts)


by address or by port
to enable apache httpd named virtual hosts you must first specify by address or by port (required if you will be running HTTPS SSL port 443 virtual hosts on the same server)

first / default virtual host (vhost)
make sure that the very FIRST named VirtualHost (vhost) you create in httpd.conf points to a "vhdefault.vhdefault" site !
(since all unmatched vhosts ALWAYS go to the FIRST / primary / default virtual host vhost listed in httpd.conf !)

ALSO NOTE : An IP based \_default\_ vhost never serves a request that was sent to an address / port that is used for name-based vhosts. If the request contained an unknown or no host : header it is always served from the FIRST / primary / default name based vhost (i.e. the vhost for that address/port that appears FIRST in the configuration file) !

address based named virtual hosts & default first site
NameVirtualHost 10.10.10.10

# first / default vhost site

<VirtualHost 10.10.10.10>
DocumentRoot "/var/www/html"
ServerName vhdefault.vhdefault
</VirtualHost>


port based named virtual hosts & default first site
NameVirtualHost *:80

# first / default vhost site

<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName vhdefault.vhdefault
</VirtualHost>


httpd -S
use httpd -S to Syntax check your httpd.conf file before reloading or restarting apache httpd

# httpd -S

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443   localhost.localdomain (/etc/httpd/conf.d/ssl.conf:88)
*:80              is a NameVirtualHost
		 default server vhdefault.vhdefault (/etc/httpd/conf/httpd.conf:999)
		 port * namevhost vhdefault.vhdefault (/etc/httpd/conf/httpd.conf:999)
		 port * namevhost fsse.info (/etc/httpd/conf/httpd.conf:1000)
		 port * namevhost osde.info (/etc/httpd/conf/httpd.conf:1004)
		 port * namevhost voippix.info (/etc/httpd/conf/httpd.conf:1014)
		 port * namevhost vizz.info (/etc/httpd/conf/httpd.conf:1026)
Syntax OK


ApacheVirtualHostsByAddress
ApacheVirtualHostsByPort


REFERRERS
HttpdConf

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0345 seconds