久一网络科技

久一网络科技是您快速建站的首选,我们提供快速高效的服务:快速建站,服务器运维,整站建设,网络编程,网络安全等。持久的品质保证,始终如一的服务理念,久一网络科技-----您身边的网络专家。 如有需求,请联系:tech@jooyee.net
四月 08

所需套件
openwebmail libcompress-zlib-perl

建議安裝套件
apache-ssl

微調 OpenWebmail
OpenWebmail 的設定檔位於 /etc/openwebmail/openwebmail.conf,建議修改其中的 domainnames 及 default_signature 區段:

(上略)
domainnames virtual.com


--
Open WebMail Project (http://openwebmail.org)
Debian Project (http://www.debian.org)

(下略)


修改 /etc/apache/httpd.conf,讓 Apache 不會傳送 Default Charset 資訊給 Client:

(上略)
# Default charset to iso-8859-1 (http://www.apache.org/info/css-security/).

AddDefaultCharset off
(下略)


在 Apache 上設定 Virtual Hosts
在安裝好 OpenWebmail 之後,直接以 Web Browser 連上 http://localhost/openwebmail/ 即可進入 Open Web Mail 畫面,但這個網址可不好記!所以我們可以使用 Apache 的 Name-based Virtual Host 功能,讓使用 www.domain.com 時可以連接上一般的 Web 畫面,但使用 mail.domain.com 時可以進入 Open Web Mail 畫面。方法是修改 /etc/apache/httpd.conf 如下:

(上略)
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them.
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# configuration.

# 宣告虛擬網站所使用的 IP 位址
NameVirtualHost 192.168.1.4

# 宣告虛擬網站

DocumentRoot /var/www
ServerName www.domain.com
ErrorLog /var/log/apache/www.domain.com-error.log
CustomLog /var/log/apache/www.domain.com-access.log common


# 宣告虛擬網站

DocumentRoot /usr/share/openwebmail/www
ServerName mail.domain.com
ErrorLog /var/log/apache/mail.domain.com-error.log
CustomLog /var/log/apache/mail.domain.com-access.log common


# Automatically added by the post-installation script
# as part of the transition to a config directory layout
# similar to apache2, and that will help users to migrate
# from apache to apache2 or revert back easily
Include /etc/apache/conf.d
Include /etc/openwebmail/apache.conf
在 Apache 上設定 Virtual Hosts over SSL
方法也是類似,修改 /etc/apache-ssl/httpd.conf 如下:

(上略)
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them.
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# configuration.

# 宣告虛擬網站所使用的 IP 位址
NameVirtualHost 192.168.1.4

# 宣告虛擬網站

DocumentRoot /var/www
ServerName www.virtual.com
SSLEnable
ErrorLog /var/log/apache/www.virtual.com-ssl-error.log
CustomLog /var/log/apache/www.virtual.com-ssl-access.log common


# 宣告虛擬網站

DocumentRoot /usr/share/openwebmail/www
ServerName mail.virtual.com
SSLEnable
ErrorLog /var/log/apache/mail.virtual.com-ssl-error.log
CustomLog /var/log/apache/mail.virtual.com-ssl-access.log common


# Automatically added by the post-installation script
# as part of the transition to a config directory layout
# similar to apache2, and that will help users to migrate
# from apache to apache2 or revert back easily
Include /etc/apache/conf.d
Include /etc/openwebmail/apache.conf

0 评论 ---->點閱數:

发表评论

关注者

热门帖子

网页浏览总次数