如何配置我的 apache 设置以在 1 个 IP 地址上为 3 个物理服务器提供服务,并且在这些服务器中的每一个上都存在多个带有 SSL 的域。我有每个服务器的多域 SSL 证书。
我是否需要为每个物理服务器上的每个 httpd 文件使用相同的设置?
如何配置路由器进行端口转发?
我当前的配置如下。如果您能提醒我注意我的设置中的任何错误并建议如何正确执行,我将不胜感激。
Server1 httpd:
<Directory />
AllowOverride all
Require all granted
</Directory>
### SERVER1 host ###
<VirtualHost *:80>
DocumentRoot D:/public_html
ServerName server1domain1.org
</VirtualHost>
####################################
#### server1domain1.org VirtualHost ####
<VirtualHost 192.168.1.9:80>
DocumentRoot "D:/public_html/server1domain1.org"
ServerName server1domain1.org
ServerAlias www.server1domain1.org
<Directory "D:/public_html/server1domain1.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server1domain1.org.err"
CustomLog "D:/server/apache/logs/server1domain1.org.log" combined
</VirtualHost>
####################################
#### SSL server1domain1.org VirtualHost ####
<VirtualHost 192.168.1.9:443>
DocumentRoot "D:/public_html/server1domain1.org"
ServerName server1domain1.org
ServerAlias www.server1domain1.org
<Directory "D:/public_html/server1domain1.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server1domain1.org.err"
CustomLog "D:/server/apache/logs/server1domain1.org.log" combined
SSLEngine on
SSLCertificateFile "D:/server/apache/conf/server1domain1.crt"
SSLCertificateKeyFile "D:/server/apache/conf/server1domain1.key"
SSLCertificateChainFile "D:/server/apache/conf/server1domain1-ca_bundle.crt"
</VirtualHost>
####################################
#### server1domain2.org VirtualHost ####
<VirtualHost 192.168.1.9:80>
DocumentRoot "D:/public_html/server1domain2.org"
ServerName server1domain2.org
ServerAlias server1domain2.org
<Directory "D:/public_html/server1domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server1domain2.org.err"
CustomLog "D:/server/apache/logs/server1domain2.org.log" combined
</VirtualHost>
####################################
#### SSL server1domain2.org VirtualHost ####
<VirtualHost 192.168.1.9:443>
DocumentRoot "D:/public_html/server1domain2.org"
ServerName server1domain2.org
ServerAlias server1domain2.org
<Directory "D:/public_html/server1domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server1domain2.org.err"
CustomLog "D:/server/apache/logs/server1domain2.org.log" combined
SSLEngine on
SSLCertificateFile "D:/server/apache/conf/server1domain2.crt"
SSLCertificateKeyFile "D:/server/apache/conf/server1domain2.key"
SSLCertificateChainFile "D:/server/apache/conf/server1domain2-ca_bundle.crt"
</VirtualHost>
***
Server2 httpd
<Directory />
AllowOverride all
Require all granted
</Directory>
### SERVER2 host ###
<VirtualHost server2domain1.com:8081>
DocumentRoot D:/public_html
ServerName server2domain1.com
</VirtualHost>
####################################
#### server2domain1.com VirtualHost ####
<VirtualHost 192.168.1.5:8081>
DocumentRoot "D:/public_html/server2domain1.com"
ServerName server2domain1.com
ServerAlias www.server2domain1.com
<Directory "D:/public_html/server2domain1.com">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server2domain1.com.err"
CustomLog "D:/server/apache/logs/server2domain1.com.log" combined
</VirtualHost>
####################################
#### SSL server2domain2.com VirtualHost ####
<VirtualHost 192.168.1.5:444>
DocumentRoot "D:/public_html/server2domain1.com"
ServerName server2domain1.com
ServerAlias www.server2domain1.com
<Directory "D:/public_html/server2domain1.com">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server2domain1.com.err"
CustomLog "D:/server/apache/logs/server2domain1.com.log" combined
SSLEngine on
SSLCipherSuite ALL:!ADD:!EXPORT56:RC4+RSA:+HIGD:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "D:/server/apache/conf/ssl_crt/server2domain1-multi-certificate.crt"
SSLCertificateChainFile "D:/server/apache/conf/ssl_crt/server2domain1-multi-ca_bundle.crt"
SSLCertificateKeyFile "D:/server/apache/conf/ssl_key/server2domain1-multi-private.key"
</VirtualHost>
####################################
#### server2domain2.org VirtualHost ####
<VirtualHost 192.168.1.5:8081>
DocumentRoot "D:/public_html/server2domain2.org"
ServerName server2domain2.org
ServerAlias www.server2domain2.org
<Directory "D:/public_html/server2domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server2domain2.org.err"
CustomLog "D:/server/apache/logs/server2domain2.org.log" combined
</VirtualHost>
####################################
#### SSL server2domain2.org VirtualHost ####
<VirtualHost 192.168.1.5:444>
DocumentRoot "D:/public_html/server2domain2.org"
ServerName server2domain2.org
ServerAlias www.server2domain2.org
<Directory "D:/public_html/server2domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server2domain2.org.err"
CustomLog "D:/server/apache/logs/server2domain2.org.log" combined
SSLEngine on
SSLCipherSuite ALL:!ADD:!EXPORT56:RC4+RSA:+HIGD:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "D:/server/apache/conf/ssl_crt/server2domain2-multi-certificate.crt"
SSLCertificateChainFile "D:/server/apache/conf/ssl_crt/server2domain2-multi-ca_bundle.crt"
SSLCertificateKeyFile "D:/server/apache/conf/ssl_key/server2domain2-multi-private.key"
</VirtualHost>
***
Server3 httpd
<Directory />
AllowOverride all
Require all granted
</Directory>
### SERVER3 host ###
<VirtualHost 192.168.1.8:8080>
DocumentRoot D:/public_html
ServerName server3domain1.com
</VirtualHost>
####################################
#### server3domain1.com VirtualHost ####
<VirtualHost 192.168.1.8:8080>
DocumentRoot "D:/public_html/server3domain1.com"
ServerName server3domain1.com
ServerAlias www.server3domain1.com
<Directory "D:/public_html/server3domain1.com">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server3domain1.com.err"
CustomLog "D:/server/apache/logs/server3domain1.com.log" combined
</VirtualHost>
####################################
#### SSL server3domain1.com VirtualHost ####
<VirtualHost 192.168.1.8:445>
DocumentRoot "D:/public_html/server3domain1.com"
ServerName server3domain1.com
ServerAlias www.server3domain1.com
<Directory "D:/public_html/server3domain1.com">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server3domain1.com.err"
CustomLog "D:/server/apache/logs/server3domain1.com.log" combined
SSLEngine on
SSLCipherSuite ALL:!ADD:!EXPORT56:RC4+RSA:+HIGD:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "D:/server/apache/conf/ssl_crt/server3domain1-multi-certificate.crt"
SSLCertificateChainFile "D:/server/apache/conf/ssl_crt/server3domain1-multi-ca_bundle.crt"
SSLCertificateKeyFile "D:/server/apache/conf/ssl_key/server3domain1-multi-private.key"
</VirtualHost>
####################################
#### server3domain2.org VirtualHost ####
<VirtualHost 192.168.1.8:8080>
DocumentRoot "D:/public_html/server3domain2.org"
ServerName server3domain2.org
ServerAlias www.server3domain2.org
<Directory "D:/public_html/server3domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server3domain2.org.err"
CustomLog "D:/server/apache/logs/server3domain2.org.log" combined
</VirtualHost>
####################################
#### SSL server3domain2.org VirtualHost ####
<VirtualHost 192.168.1.8:445>
DocumentRoot "D:/public_html/server3domain2.org"
ServerName server3domain2.org
ServerAlias www.server3domain2.org
<Directory "D:/public_html/server3domain2.org">
Options FollowSymLinks Indexes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "D:/server/apache/logs/server3domain2.org.err"
CustomLog "D:/server/apache/logs/server3domain2.org.log" combined
SSLEngine on
SSLCipherSuite ALL:!ADD:!EXPORT56:RC4+RSA:+HIGD:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "D:/server/apache/conf/ssl_crt/server3domain2-multi-certificate.crt"
SSLCertificateChainFile "D:/server/apache/conf/ssl_crt/server3domain2-multi-ca_bundle.crt"
SSLCertificateKeyFile "D:/server/apache/conf/ssl_key/server3domain2-multi-private.key"
</VirtualHost>
####################################