Apache vhost setup

assuming apache with ssl is up and running already

cd /etc/httpd/conf.d/
vi examplehost.conf

<VirtualHost *:80>
        ServerAdmin user@example.com
        ServerName examplehost.example.com
        ServerAlias examplehost
        Redirect / https://examplehost.example.com/
</VirtualHost>

<VirtualHost *:443>
        Include conf/certs.conf
        ServerAdmin user@example.com
        ServerName examplehost
        Redirect / https://examplehost.example.com/
</VirtualHost>

<VirtualHost *:443>
        Include conf/certs.conf
        ServerAdmin user@example.com
        ServerName examplehost.example.com

        ErrorLog logs/examplehost.ssl.error.log
        TransferLog logs/examplehost.ssl.access.log
        #CustomLog logs/examplehost.ssl.request.log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
        CustomLog logs/examplehost.ssl.request.log ssl_combined
        LogLevel warn

        ProxyRequests off
        ProxyTimeout 300

        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

        <Location />
                #Require ip 10.0.0.0/255.0.0.0 ::1/128
                ProxyPass http://localhost:9001/
                ProxyPassReverse http://localhost:9001/
        </Location>
</VirtualHost>

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun