Configure apache - mttstt/Domoticasite GitHub Wiki

Configuration Apache2 > 2.4.10

Apache modules

sudo a2enmod proxy proxy_connect rewrite headers

/etc/apache2/sites-enables/default-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost _default_:4443>
            ServerName matteosetti.noip.me
            ServerAdmin [email protected]
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined

            SSLEngine on
            SSLProxyEngine On
            ProxyRequests Off

            SSLCertificateFile /etc/letsencrypt/live/matteosetti.noip.me/cert.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/matteosetti.noip.me/privkey.pem
            SSLCertificateChainFile /etc/letsencrypt/live/matteosetti.noip.me/chain.pem
            SSLCACertificatePath /etc/ssl/certs/

            DocumentRoot /var/www/123solar

            <Location /webcam/>
                   ProxyPass http://192.168.1.104:88/
                   ProxyPassReverse http://192.168.1.104:88/
            </Location>

            ProxyPass /123solar http://localhost/123solar
            ProxyPassReverse /123solar http://localhost/123solar

            ProxyPass /dump1090/ http://localhost/dump1090/
            ProxyPassReverse /dump1090/ http://localhost/dump1090/

            ProxyPass / http://localhost:3000/
            ProxyPassReverse / http://localhost:3000/

            RewriteEngine on
            RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
            RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
            RewriteRule .* ws://localhost:3000%{REQUEST_URI} [P]
            
            BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0
            # MSIE 7 and newer should be able to use keepalive
            BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    </VirtualHost>

/etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
  	    Listen 4443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 4443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
⚠️ **GitHub.com Fallback** ⚠️