Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.
The following page has been changed by pctony: http://wiki.apache.org/httpd/Recipies/ExampleVhosts The comment on the change is: copied from ebp-moin New page: = Example VirtualHost Configurations = The excerpts below shows some example !VirtualHost config's that can be used in Apache. For each port that you want to use to serve content, you will need to define these before configuring your !VirtualHosts. You will need a Listen directive, and a !NameVirtualHost directive. {{{ Listen 80 # This tells Apache to listen on port 80 Listen 443 # This tells Apache to listen on port 443 NameVirtualHost *:80 # This tells Apache that you will be using vhost on port 80 NameVirtualHost *:443 # This tells Apache that you will be using vhost on port 443 }}} == Basic Setup, using Port 80, and Custom Log files == {{{ <VirtualHost *:80> ServerName www.foo.com # if you want this vhost to listen to extra names, uncomment the next line # ServerAlias foo.com www.bar.com bar.com DocumentRoot /var/www/www.foo.com/htdocs CustomLog /var/log/apache/www.foo.com-access.log combined ErrorLog /var/log/apache/www.foo.com-error.log </VirtualHost> }}} == Basic VirtualHost with Custom Log files, and authentication == {{{ <VirtualHost *:80> ServerName www.foo.com DocumentRoot /var/www/www.foo.com/htdocs CustomLog /var/log/apache/www.foo.com-access.log combined ErrorLog /var/log/apache/www.foo.com-error.log AuthUserFile /var/www/www.foo.com/.htpasswd AuthType Basic AuthName "Authorised Users Only" Require valid-user </VirtualHost> }}} == SSL enabled VirtualHost with Custom Log files == {{{ <VirtualHost *:443> ServerName www.foo.com DocumentRoot /var/www/www.foo.com/htdocs CustomLog /var/log/apache/www.foo.com-access.log combined ErrorLog /var/log/apache/www.foo.com-error.log SSLEngine On </VirtualHost> }}} ''Please note that the above example for SSL, will require an additional !NameVirtualHost directive, if not already in use''
