Posted on Leave a comment

Apache2 VirtualHost


<VirtualHost *:8080>
        ServerName intra
        DocumentRoot /var/www/intra


<VirtualHost *:80>
        DocumentRoot /var/www/default

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog /var/www/default/error.log
        CustomLog /var/www/default/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

IP address in VirtualHost *:80 directive is the one that apache2 binds. It may be different from the public IP if apache2 is behind proxy, etc. Or It can have multiple IPs. In any case, default will be served if no ServerName matches.

To respond to port 8080, apache2 must listen to it.


Listen 80
Listen 8080

<IfModule ssl_module>
        Listen 443

<IfModule mod_gnutls.c>
        Listen 443
Leave a Reply

Your email address will not be published. Required fields are marked *