2015年8月24日 星期一

webmail squirrelmail------guide to install to Centos (1)

http://www.server-world.info/en/note?os=CentOS_6&p=httpd&f=17


Step 1


Install Postfix to configure SMTP server. SMTP uses 25/TCP.
[1]Postfix is installed even if CentOS system was installed with [Minimal Install], but if Postfix is not, Install it first like follows.
[root@mail ~]# 
yum -y install postfix
[2]This example shows to configure SMTP-Auth to use Dovecot's SASL function.
[root@mail ~]# 
vi /etc/postfix/main.cf
# line 75: uncomment and specify the hostname

myhostname = 
mail.server.world
# line 83: uncomment and specify the domain name

mydomain = 
server.world
# line 99: uncomment

myorigin = $mydomain
# line 116: change

inet_interfaces = 
all
# line 119: change if you use only IPv4

inet_protocols = 
ipv4
# line 164: add

mydestination = $myhostname, localhost.$mydomain, localhost
, $mydomain
# line 264: uncomment and specify your local network

mynetworks = 127.0.0.0/8, 
10.0.0.0/24
# line 419: uncomment (use Maildir)

home_mailbox = Maildir/
# line 571: add

smtpd_banner = $myhostname ESMTP
# add follows to the end

# limit an email size for 10M

message_size_limit = 10485760

# limit a mailbox for 1G

mailbox_size_limit = 1073741824
# for SMTP-Auth

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
[root@mail ~]# 
/etc/rc.d/init.d/postfix start 

Starting postfix: 
[  OK  ]

[root@mail ~]# 
chkconfig postfix on




Step 2................................................................................
Install Dovecot to configure POP/IMAP server. POP uses 110/TCP, IMAP uses 143/TCP.
[1]Install Dovecot.
[root@mail ~]# 
yum -y install dovecot
[2]This example shows to configure to provide SASL function to Postfix.
[root@mail ~]# 
vi /etc/dovecot/dovecot.conf
# line 26: change ( if not use IPv6 )

listen = 
*
[root@mail ~]# 
vi /etc/dovecot/conf.d/10-auth.conf
# line 9: uncomment and change ( allow plain text auth )

disable_plaintext_auth = 
no
# line 97: add

auth_mechanisms = plain 
login
[root@mail ~]# 
vi /etc/dovecot/conf.d/10-mail.conf
# line 30: uncomment and add

mail_location = 
maildir:~/Maildir
[root@mail ~]# 
vi /etc/dovecot/conf.d/10-master.conf
# line 88-90: uncomment and add

# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix 

}
[root@mail ~]# 
/etc/rc.d/init.d/dovecot start 

Starting Dovecot Imap: 
[  OK  ]

[root@mail ~]# 
chkconfig dovecot on 

Step 3


 
Install PHP to use PHP Script on httpd.
[1]Install PHP.
[root@www ~]# 
yum -y install php php-mbstring php-pear
[root@www ~]# 
vi /etc/httpd/conf/httpd.conf
# line 402: add file name that it can access only with directory's name

DirectoryIndex index.html 
index.php
[root@www ~]# 
vi /etc/php.ini
# line 946: set you timezone

date.timezone = 
"Asia/Tokyo"
[root@www ~]# 
/etc/rc.d/init.d/httpd restart 

Stopping httpd: 
[ OK ]

Starting httpd: 
[ OK ]
[2]Create a PHP test page and access to it with a web browser on Client to make sure it works normally.






[root@www ~]# 
vi /var/www/html/index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
<?php
   print Date("Y/m/d");
?>
</div>
</body>
</html>




Step 4

 
Configure httpd to use SSL connection.
[1]
[2]Configure httpd for SSL.
[root@www ~]# 
yum -y install mod_ssl
[root@www ~]# 
vi /etc/httpd/conf.d/ssl.conf
# line 77: uncomment
DocumentRoot "/var/www/html"
# line 78: uncomment and specify the server name
ServerName 
www.server.world:443
# line 105: change to the one created in [1]
SSLCertificateFile 
/etc/pki/tls/certs/server.crt
# line 112: change to the one created in [1]
SSLCertificateKeyFile 
/etc/pki/tls/certs/server.key
[root@www ~]# 
/etc/rc.d/init.d/httpd restart 
Stopping httpd: 
[ OK ]
Starting httpd: 
[ OK ]
[3]Access to the test page from a client computer with a Web browser via HTTPS. The examample below is the Fiorefix. Following screen is shown because Certificates is own created one, but it's no ploblem, Proceed to next. Step 5 install 

沒有留言:

張貼留言