DMZでのRAWAリバースプロキシとしてのDebian + Apacheの構成
Exchange がインストールされていて、OWA を海外に公開する場合, Exchangeに直接ポートを開くべきではありません, このために、DMZにはプロキシがあり、OWAが表示されます. この場合、DEBIANとAPACHEを使用してリバースプロキシを設定します.
これを行うには、ポートを使用してDMZにdebianがインストールされているという事実から始めます 443 WAN がそれを指し、ポートが通過できるようにします 443 サーバーからLANのExchange CASへ.
Actualizamos nuestro servidor Debian
# apt-get アップデート
# apt-get upgrade
Instalamos Apache
# apt-get install apache2 apache2-mpm-prefork
Activamos los modulos requeridos
# a2enmod proxy
# a2enmod proxy_http
# A2Enmodヘッダー
# A2ENMODリライト
# A2ENMOD SSLの
Reiniciamos Apache
# /etc/init.d/apache2 再起動
Creamos los directorios para los certificados
# mkdir /etc/apache2/ssl.crt
# mkdir /etc/apache2/ssl.key
Exportamos el certificado de nuestro servidor Exchange a pfx. Botón derecho en el certificado y Exportar Certificado.
Le damos una ruta y un nombre, y le ponemos una contraseña y lo introducimos en nuestro linux con winscp por ejemplo.
Convertimos nuestro pfx a texto plano
# openssl pkcs12 -in correo.pfx -out correo.txt -nodes
Editamos el fichero correo.txt y veremos la RSA PRIVATE KEY そして CERTIFICADO.
Los guardamos independientemente en 2 fichero correo.crt y correo.key
Movemos el certificado a su directorio
# mv correo.crt /etc/apache2/ssl.crt
Movemos la rsa key a su directorio
# mv correo.key mkdir /etc/apache2/ssl.key
Creamos la carpeta owa, aunque sera ficticia solo para la configuración pero no la usaremos.
# mkdir /var/www/owa
Creamos y editamos el fichero owa
# vim /etc/apache2/sites-available/owa
Introducimos la siguiente configuración para actuar como proxy:
NameVirtualHost *:80
<バーチャルホスト *:80>
ServerName correo.tundra-it.com
ServerAdmin で**@co****.cオーム
DocumentRoot /var/www/owa
DirectoryIndex index.htm index.html
RedirectMatch ^/$ https://correo.tundra-it.com/owa
RedirectMatch ^/owa$ https://correo.tundra-it.com/owa
</バーチャルホスト>
NameVirtualHost *:443
<バーチャルホスト *:443>
ServerName correo.tundra-it.com
ServerAdmin で**@co****.cオーム
DocumentRoot /var/www/owa
DirectoryIndex index.htm index.html
# Set up SSL to work with this host
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/apache2/ssl.crt/correo.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/correo.key
# Redirect to ‘/owa’ from ‘/’
RedirectMatch ^/$ /owa
RewriteEngine On
# Fix a problem when ‘%’ symbols are in the subject line of OWA email
# (the email subject is used in the web query)
RewriteMap percentsubject int:escape
RewriteCond $1 ^/owa/.*%.*$
RewriteRule (/owa/.*) ${percentsubject:$1} [P]
RequestHeader set Front-End-Https “オン”
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
<Proxy *>
Order deny,allow
すべてから許可
</プロキシ>
#Reverse Proxy para OWA
ProxyPass /owa https://correo.tundra-it.com/owa
ProxyPassReverse /owa https://correo.tundra-it.com/owa
ProxyPass /exchweb https://correo.tundra-it.com/exchweb
ProxyPassReverse /exchweb https://correo.tundra-it.com/exchweb
ProxyPass /public https://correo.tundra-it.com/公共
ProxyPassReverse /public https://correo.tundra-it.com/公共
ProxyPass /iisadmpwd https://correo.tundra-it.com/iisadmpwd
ProxyPassReverse /iisadmpwd https://correo.tundra-it.com/iisadmpwd
ProxyPass /oma https://correo.tundra-it.com/oma
ProxyPassReverse /oma https://correo.tundra-it.com/oma
ProxyPass /Microsoft-Server-ActiveSync https://correo.tundra-it.com/Microsoft-Server-ActiveSync
ProxyPassReverse /Microsoft-Server-ActiveSync https://correo.tundra-it.com/Microsoft-Server-ActiveSync
ErrorLog /var/log/apache2/mailus-ssl-error_log
CustomLog /var/log/apache2/mailus-ssl-access_log common
</バーチャルホスト>
Activamos el sitio OWA
# a2ensite owa
Para no permitir el trafico DNS de la DMZ a los DNS de la LAN, introducimos el nombre del sitio local en el archivo hosts
# エコー 192.168.169.231 correo.tundra-it.com >> /etc/hosts
Reiniciamos el Apacahe
# /etc/init.d/apache2 再起動
Entramos desde el exterior