Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
        DocumentRoot    /home/bugserver/htdocs
ScriptAlias /home/bugserver/cgi-bin
TransferLog /home/bugserver/logs/access_log
</VirtualHost>

<VirtualHost    212.85.67.67>
ServerName pts.gnulix.org
ServerAlias pts
DocumentRoot /home/pts/htdocs
ScriptAlias /home/pts/cgi-bin
TransferLog /home/pts/logs/access_log
ErrorLog /home/pts/logs/error_log
</VirtualHost>

TIP
If you are hosting websites on an intranet or internal network, users will
likely use the shortened name of the machine rather than the FQDN. For
example, users might type http://bugserver/index.html in their browser
location field rather than http://bugserver.gnulix.org/index.html. In that
case, Apache would not recognize that those two addresses should go to the
same virtual host. You could get around this by setting up VirtualHost
directives for both bugserver and bugserver.gnulix.org, but the
easy way around it is to use the ServerAlias directive, which lists all
valid aliases for the machine:

Click here to view code image
ServerAlias bugserver


For more    information about   VirtualHost,    refer   to  the help    system  on
http://localhost/_manual.

Logging


Apache provides logging for just about any web access information you might
be interested in. Logging can help with the following:


    System  resource    management, by  tracking    usage
Intrusion detection, by documenting bad HTTP requests
Diagnostics, by recording errors in processing requests

Two standard log files are generated when you run your Apache server:
access_log and error_log. They are found under the
/var/log/apache2 directory. (Others include the SSL logs
ssl_access_log, ssl_error_log, and ssl_request_log.) All

Free download pdf