AlpineWeb Home
Search: For:   ~ Advanced Search  
  Support Home     Documentation     Knowledgebase     Help Desk     Blog 
Support Home > VPS v1 > Webserver > Subhosts > Thursday, August 28, 2008

Manually Configuring Log Files and Other Features for Virtual Subhosts


Another great feature is the ability to create separate logfiles for your Virtual Subhosts. Consider the following example:
<VirtualHost www.alpineweb.org alpineweb.org>
ServerName www.alpineweb.org
ServerAdmin alpineweb@alpineweb.org
DocumentRoot /usr/local/etc/httpd/vhosts/alpineweb
TransferLog /usr/local/etc/httpd/vhosts/alpineweb/logs/access_log
ErrorLog /usr/local/etc/httpd/vhosts/alpineweb/logs/error_log
ScriptAlias /cgi-bin/ /usr/local/etc/httpd/vhosts/alpineweb/cgi-bin/
ErrorDocument 404 /errors/notfound.html
</VirtualHost>
This code isolates the logfiles for the alpineweb Virtual Subhost rather than having them all lumped into the master log files. You will need to create the logs directory that you define using the TransferLog and ErrorLog directives. You can create the directory by connecting to your Virtual Server and issuing the command:
mkdir ~/usr/local/etc/httpd/vhosts/alpineweb/logs

Other resource directives


Most server resource directives can be included in your <VirtualHost> definition. For example, we can include the definition of a "Not Found Document" (ErrorDocument 404) in the alpineweb VirtualHost definition:
<VirtualHost www.alpineweb.org alpineweb.org>
ServerName www.alpineweb.org
ServerAdmin alpineweb@alpineweb.org
DocumentRoot /usr/local/etc/httpd/vhosts/alpineweb
ScriptAlias /cgi-bin/ /usr/local/etc/httpd/vhosts/alpineweb/cgi-bin/
ErrorDocument 404 /notfound.html
</VirtualHost>
Note the file location is specified with respect to the DocumentRoot.... so the actual file location of notfound.html is:
~/www/vhosts/alpineweb/notfound.html



Technical Support
° Getting Started Guide
  FreeBSD
° VPS v1 Help
° VPS v2/3 Help
° MPS v2/3 Help
  DNS
° Domain Name Service
° Domain Registration
   
° Help Desk
° Knowledgebase
° Support Policies
° Disclaimer

° AlpineWeb Home
° Compare Hosting Plans
° Network Topology

° Rates & Fees
° Order Center


  SEE ALSO
· About Virtual Subhosting
· Using vaddhost to Automatically Configure Virtual Subhosts
· Manually Configuring Virtual Subhosts
· Limitations of Virtual Subhosting
· VPS Help


  Home | Site Map | Customer Backroom Copyright  ©  1997-2008  AlpineWeb Design