Apache som proxyserver i CentOS 7: Difference between revisions
Jump to navigation
Jump to search
m Peter moved page Apache webproxy i CentOS 7 to Apache som proxyserver i CentOS 7 without leaving a redirect |
mNo edit summary |
||
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Under utveckling. | Under utveckling. | ||
== Proxyn == | |||
[[Category: | installera: | ||
{{RootCmd|yum install httpd mod_ssl mod_proxy_html openssl}} | |||
{{bc|1= | |||
<VirtualHost *:80> | |||
ServerName centos1.kerwien.se | |||
ProxyPreserveHost On | |||
ProxyPass /app1 http://centos3.kerwien.se/app1 | |||
ProxyPassReverse /app1 http://centos3.kerwien.se/app1 | |||
ProxyPass /mediawiki http://centos3.kerwien.se/mediawiki | |||
ProxyPassReverse /mediawiki http://centos3.kerwien.se/mediawiki | |||
ProxyPass /wordpress http://centos3.kerwien.se/wordpress | |||
ProxyPassReverse /wordpress http://centos3.kerwien.se/wordpress | |||
ProxyPass /phpbb http://centos3.kerwien.se/phpbb | |||
ProxyPassReverse /phpbb http://centos3.kerwien.se/phpbb | |||
</VirtualHost> | |||
}} | |||
ssl.conf: | |||
{{bc|1= | |||
ServerName centos1.kerwien.se:443 | |||
RequestHeader set X-Forwarded-Proto "https" | |||
#ProxyRequests Off | |||
#ProxyPreserveHost On | |||
ProxyPass /app1 http://centos3.kerwien.se/app1 | |||
ProxyPassReverse /app1 http://centos3.kerwien.se/app1 | |||
ProxyPass /mediawiki http://centos3.kerwien.se/mediawiki | |||
ProxyPassReverse /mediawiki http://centos3.kerwien.se/mediawiki | |||
ProxyPass /wordpress http://centos3.kerwien.se/wordpress | |||
ProxyPassReverse /wordpress http://centos3.kerwien.se/wordpress | |||
ProxyPass /phpbb http://centos3.kerwien.se/phpbb | |||
ProxyPassReverse /phpbb http://centos3.kerwien.se/phpbb | |||
}} | |||
== Servern == | |||
http.conf | |||
{{bc|1= | |||
<VirtualHost *:80> | |||
ServerName centos1.kerwien.se | |||
RemoteIPHeader X-Forwarded-For | |||
RemoteIPInternalProxy 192.168.0.21 | |||
</VirtualHost> | |||
}} | |||
== Allmänt webserver == | |||
{{RootCmd|<nowiki>setsebool -P httpd_can_network_connect_db=on</nowiki> | |||
|<nowiki>setsebool -P httpd_can_connect_ldap=on</nowiki>}} | |||
{{RootCmd|<nowiki>yum --enablerepo=extras install epel-release</nowiki>}} | |||
== Wordpress == | |||
wp-config.php: | |||
{{bc|1= | |||
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') | |||
$_SERVER['HTTPS']='on'; | |||
/** | |||
* Force login and administration over SSL. | |||
*/ | |||
define('FORCE_SSL_ADMIN', true); | |||
}} | |||
== Roundcube == | |||
config.inc.php: | |||
{{bc|1= | |||
// List of trusted proxies | |||
// X_FORWARDED_* and X_REAL_IP headers are only accepted from these IPs | |||
$config['proxy_whitelist'] = array('192.168.0.21'); | |||
}} | |||
[[Category:GammalGuide]] |
Latest revision as of 14:00, 12 August 2023
Under utveckling.
Proxyn
installera:
<VirtualHost *:80> ServerName centos1.kerwien.se ProxyPreserveHost On ProxyPass /app1 http://centos3.kerwien.se/app1 ProxyPassReverse /app1 http://centos3.kerwien.se/app1 ProxyPass /mediawiki http://centos3.kerwien.se/mediawiki ProxyPassReverse /mediawiki http://centos3.kerwien.se/mediawiki ProxyPass /wordpress http://centos3.kerwien.se/wordpress ProxyPassReverse /wordpress http://centos3.kerwien.se/wordpress ProxyPass /phpbb http://centos3.kerwien.se/phpbb ProxyPassReverse /phpbb http://centos3.kerwien.se/phpbb </VirtualHost>
ssl.conf:
ServerName centos1.kerwien.se:443 RequestHeader set X-Forwarded-Proto "https" #ProxyRequests Off #ProxyPreserveHost On ProxyPass /app1 http://centos3.kerwien.se/app1 ProxyPassReverse /app1 http://centos3.kerwien.se/app1 ProxyPass /mediawiki http://centos3.kerwien.se/mediawiki ProxyPassReverse /mediawiki http://centos3.kerwien.se/mediawiki ProxyPass /wordpress http://centos3.kerwien.se/wordpress ProxyPassReverse /wordpress http://centos3.kerwien.se/wordpress ProxyPass /phpbb http://centos3.kerwien.se/phpbb ProxyPassReverse /phpbb http://centos3.kerwien.se/phpbb
Servern
http.conf
<VirtualHost *:80> ServerName centos1.kerwien.se RemoteIPHeader X-Forwarded-For RemoteIPInternalProxy 192.168.0.21 </VirtualHost>
Allmänt webserver
Wordpress
wp-config.php:
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; /** * Force login and administration over SSL. */ define('FORCE_SSL_ADMIN', true);
Roundcube
config.inc.php:
// List of trusted proxies // X_FORWARDED_* and X_REAL_IP headers are only accepted from these IPs $config['proxy_whitelist'] = array('192.168.0.21');