2024-10/conf/kapitel/kapitel_12.conf
2024-10-17 16:18:28 +02:00

133 lines
3.3 KiB
Plaintext

##### Kapitel 12
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
### Forward-Proxy
ProxyVia full
Listen 127.0.0.1:3128
<VirtualHost 127.0.0.1:3128>
<Proxy *>
Require ip 127.0.0.0/8
</Proxy>
ProxyRequests On
CustomLog logs/proxy_access.log combined
ErrorLog logs/proxy_error.log
</VirtualHost>
### Forward-Proxy mit Caching
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule cache_module modules/mod_cache.so
#2.2#LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule cache_disk_module modules/mod_cache_disk.so
Listen 127.0.0.1:3142
<VirtualHost 127.0.0.1:3142>
<Proxy *>
Require ip 127.0.0.0/8
</Proxy>
ProxyRequests On
CacheEnable disk http://*
CacheRoot /usr/local/apache2/proxy-cache/
CacheDirLevels 2
CacheDirLength 2
# CacheMinFileSize 1
# CacheMaxFileSize 10000000
#
# CacheDefaultExpire 3600
# CacheMinExpire 600
# CacheMaxExpire 86400
#
# CacheLastModifiedFactor 0.1
# CacheIgnoreNoLastMod On
#
# CacheStoreNoStore On
# CacheStorePrivate On
#
CustomLog logs/caching_access.log combined
LogLevel debug
ErrorLog logs/caching_error.log
</VirtualHost>
### Reverse-Proxy für Heise-Newsticker
<VirtualHost 172.31.31.105:80>
ServerName revproxy.sv
ProxyPass /newsticker/ https://www.heise.de/newsticker/
ProxyPassReverse /newsticker/ https://www.heise.de/newsticker/
ProxyPassReverse /newsticker/ https://193.99.144.85/newsticker/
ProxyPassReverse /newsticker/ https://193.99.144.80/newsticker/
SSLProxyEngine On
CustomLog logs/revproxy_access.log combined
ErrorLog logs/revproxy_error.log
</VirtualHost>
### Reverse-Proxy für PHP-FPM
#LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
<VirtualHost 172.31.31.105:80>
ServerName revproxy-php.sv
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
</FilesMatch>
ProxyPassMatch "^/(.*\.php0(/.*)?)$" "fcgi://127.0.0.1:4001/usr/local/apache2/htdocs/$1"
CustomLog logs/revproxy-php_access.log combined
ErrorLog logs/revproxy-php_error.log
</VirtualHost>
### Reverse-Proxy für Tomcat
#LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
<VirtualHost 172.31.31.106:80>
ServerName tomcat.sv
DocumentRoot /usr/share/tomcat10-examples/
RewriteEngine On
RewriteRule ^/examples/(.*)\.jsp(x?)$ ajp://localhost:8009/examples/$1.jsp$2 [P,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^/examples/websocket/(.*)$ ws://localhost:8080/examples/websocket/$1 [P,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^/examples/(.*)$ ajp://localhost:8009/examples/$1 [P,L]
<Directory /usr/share/tomcat10-examples/>
Require all granted
Options Indexes
</Directory>
CustomLog logs/tomcat_access.log combined
ErrorLog logs/tomcat_error.log
</VirtualHost>