tom's wiki

stuff and things

User Tools

Site Tools


Sidebar

https://trobinson.me TomR.me

Navigation

153 pages, 80 files

lab:apache

Apache Config

Don't show the server version

Add to apache2.conf:

ServerTokens ProductOnly
ServerSignature Off

Retain the real user IP (CloudFlare)

a2enmod remoteip # Enable the Apache Module
example.org.conf
RemoteIPHeader CF_CONNECTING_IP

Proxy example vhost

example.org.conf
<VirtualHost *:80>
    ServerName example.org
    ProxyRequests off
    ProxyPreserveHost On
    SSLProxyEngine on
    SSLProxyVerify none 
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
 
    DocumentRoot /var/www/html/generic
    ProxyPass /e/ !
    ErrorDocument 503 /e/503.html
 
    ProxyPass / http://host.example.com/
    ProxyPassReverse /  http://host.example.com/
</VirtualHost>
/var/www/dokuwiki/data/pages/lab/apache.txt · Last modified: 2021-02-19 06:24 by tom