#apache #httpd namevirtualhost, virtualhost and servername

OSDE

in #apache #httpd to setup virtual hosts use tyhe directives namevirtualhost, virtualhost and servername

NameVirtualHost *:80

<VirtualHost *:80>
 ServerName site1.example.com
 DocumentRoot /var/www/site1/public_html
 <Directory "/var/www/site1/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

<VirtualHost *:80>
 ServerName site2.example.com
 DocumentRoot "/var/www/site2/public_html"
 <Directory "/var/www/site2/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

<VirtualHost *:80>
 ServerName site3.example.com
 DocumentRoot /var/www/site3/public_html
 <Directory "/var/www/site3/public_html">
  allow from all
  Options +Indexes
 </Directory>
</VirtualHost>

to get a list of your vhosts type

httpd -S

see also

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s