rainloop是一個使用php編寫的,開源免費的網頁郵件用戶端。他支援包括google、yahoo、outlook在内的主流的郵件伺服器,當然,他也支援你自己的本地郵件伺服器。它看起來大緻就像使用imap和smtp協定的mua(郵件用戶端)一樣。

在arch linux上安裝rainloop
一旦在您的伺服器部署上rainloop,剩餘要做的唯一的事情是通過web浏覽器通路您的rainloop,并提供你正在使用的郵件伺服器資訊。
本教程包含了在 arch linux上的rainloop 網頁用戶端的安裝流程,包括如何進行配置 apache 或 nginx, 當然本教程使用修改hosts的方式,進而避免了dns的通路。
if you also need references on installing rainloop on debian and red hat systems visit the previous rainloop webmail article at.
如果你還是需要一篇在debian 和 red hat 安裝 rainloop webmail 的教程,你可以看這篇文章:
<a href="http://www.tecmint.com/rainloop-webmail-a-modern-fast-web-based-email-client-for-linux/" target="_blank">在 debian 和 redhat 系的 linux 上安裝 rainloop webmail</a>
以及在 ubuntu 伺服器中安裝 rainloop webmail 的教程,你可以看這篇文章:
<a href="http://linux.cn/article-2794-1.html">如何在 ubuntu server 中設定 rainloop webmail</a>
<a target="_blank"></a>
<a href="http://www.tecmint.com/install-nginx-php-mysql-with-mariadb-engine-and-phpmyadmin-in-arch-linux/" target="_blank">在 arch linux 上安裝 lemp (nginx, php, mysql/mariadb 和 phpmyadmin)</a>
<a href="http://www.tecmint.com/create-virtual-hosts-using-nginx-on-arch-linux/" target="_blank">在 nginx 上建立虛拟主機</a>
<a href="http://www.tecmint.com/install-lamp-in-arch-linux/" target="_blank">在 arch linux 上安裝 lamp (linux, apache, mysql/mariadb 和 php/phpmyadmin)</a>
1. 假設你已經如上面介紹的連結所述,配置好了您的伺服器(nginx或apache),你需要做的第一件事是在hosts檔案裡建立一個原始解析記錄,以指向的arch linux系統的ip。
對于linux系統,修改 /etc/hosts 檔案并且在你的localhost條目之下添加 rainloop 的虛拟域。如下:
127.0.0.1 localhost.localdomain localhost rainloop.lan
192.168.1.33 rainloop.lan
添加域資訊
如果是windows系統,則修改 c:\windows\system32\drivers\etc\hosts 并且将接下來的内容添加到你的檔案裡:
192.168.1.33 rainloop.lan
2. 使用 ping 指令确認本地的 rainloop 域名建立成功之後,然後在 apache 或 nginx 中建立所需的 虛拟主機和 ssl 配置。
在/etc/nginx/sites-available/ 目錄下使用如下指令建立一個名叫rainloop.lan的檔案:
$ sudo nano /etc/nginx/sites-available/rainloop.conf
添加如下的檔案内容:
server {
listen 80;
server_name rainloop.lan;
rewrite ^ https://$server_name$request_uri? permanent;
access_log /var/log/nginx/rainloop.lan.access.log;
error_log /var/log/nginx/rainloop.lan.error.log;
root /srv/www/rainloop/;
# serve static files
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /srv/www/rainloop/;
expires 30d;
}
location / {
index index.html index.htm index.php;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
location ^~ /data {
deny all;
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000; (depending on your php-fpm socket configuration)
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
接下來建立ssl配置檔案:
$ sudo nano /etc/nginx/sites-available/rainloop-ssl.conf
添加如下内容:
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/rainloop.lan.crt;
ssl_certificate_key /etc/nginx/ssl/rainloop.lan.key;
ssl_session_cache shared:ssl:1m;
ssl_session_timeout 5m;
ssl_ciphers high:!anull:!md5;
ssl_prefer_server_ciphers on;
接下來将會自動生成certificate和keys檔案,然後在檔案中叫common name*的證書裡中添加您的虛拟域名( rainloop.lan**)。
$ sudo nginx_gen_ssl.sh
生成證書和密鑰
生成證書和ssl密鑰後,建立rainloop web伺服器根的檔案路徑(rainloop php檔案所在的位置),然後啟用虛拟主機,并重新啟動nginx的守護程序,應用配置。
$ sudo mkdir -p /srv/www/rainloop
$ sudo n2ensite rainloop
$ sudo n2ensite rainloop-ssl
$ sudo systemctl restart nginx
建立rainloop 網頁向導
在/etc/httpd/conf/sites-available/中建立 rainloop.conf檔案:
$ sudo nano /etc/httpd/conf/sites-available/rainloop.conf
<virtualhost *:80>
servername rainloop.lan
documentroot "/srv/www/rainloop/"
serveradmin [email protected]
errorlog "/var/log/httpd/rainloop-error_log"
transferlog "/var/log/httpd/rainloop-access_log"
<directory />
options +indexes +followsymlinks +execcgi
allowoverride all
order deny,allow
allow from all
require all granted
</directory>
</virtualhost>
建立apache虛拟主機
為apache添加ssl支援:
$ sudo nano /etc/httpd/conf/sites-available/rainloop-ssl.conf
添加如下檔案内容:
<virtualhost *:443>
errorlog "/var/log/httpd/rainloop-ssl-error_log"
transferlog "/var/log/httpd/rainloop-ssl-access_log"
sslengine on
sslcertificatefile "/etc/httpd/conf/ssl/rainloop.lan.crt"
sslcertificatekeyfile "/etc/httpd/conf/ssl/rainloop.lan.key"
<filesmatch "\.(cgi|shtml|phtml|php)$">
ssloptions +stdenvvars
</filesmatch>
browsermatch "msie [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
customlog "/var/log/httpd/ssl_request_log" \
"%t %h %{ssl_protocol}x %{ssl_cipher}x \"%r\" %b"
$ sudo apache_gen_ssl
建立ssl證書和密鑰
輸入組織資訊
after the certificate and ssl keys are created, add rainloop documentroot path, then enable virtual hosts and restart apache daemon to apply configurations. 在證書和密鑰建立之後,建立 rainloop 的documentroot 所指向的目錄,之後激活虛拟主機,并且重新開機apache應用設定。
$ sudo a2ensite rainloop
$ sudo a2ensite rainloop-ssl
$ sudo systemctl restart httpd
激活虛拟主機
3. 無論您使用的是apache或nginxweb伺服器,您需要激活php.ini檔案下中的php擴充,并将新伺服器的documentroot目錄放到 open_basedir 配置中。
$ sudo nano /etc/php/php.ini
找到并且取消如下的php擴充的注釋(lctt譯注,即啟用這些子產品):
extension=iconv.so
extension=imap.so
extension=mcrypt.so
extension=mssql.so
extension=mysqli.so
extension=openssl.so ( 注:啟用 imaps 和 smtp ssl protocols)
extension=pdo_mysql.so
open_basedir語句應該看起來類似如下:
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/srv/www/
4. 在修改好php.ini之後,重新開機你的伺服器,然後檢查 phpinfo() 輸出,去看看ssl協定是否已經激活。
----------對于 apache web 伺服器----------
----------對于 nginx web 伺服器----------
$ sudo systemctl restart php-fpm
檢視 php 資訊
5.現在可以從官方網站下載下傳rainloop應用并解壓縮到文檔根目錄了,但是需要首先安裝wget的和unzip程式(lctt譯注,如果你已經有了可以忽略此步)。
$ sudo pacman -s unzip wget
$ wget http://repository.rainloop.net/v1/rainloop-latest.zip
下載下傳 rainloop 包
7. 下載下傳過程完成後,解壓rainloop壓縮包到虛拟主機文檔根目錄路徑( /srv/www/rainloop/ )。
$ sudo unzip rainloop-latest.zip -d /srv/www/rainloop/
解壓
8. 然後設定應用程式的預設路徑下的權限。
$ sudo chmod -r 755 /srv/www/rainloop/
$ sudo chown -r http:http /srv/www/rainloop/
設定權限
9. rainloop應用程式可以通過兩種方式進行配置:使用浏覽器或者系統shell。如果要在終端配置就打開和編輯位于/ srv/www/rainloop/data/datada047852f16d2bc7352b24240a2f1599/default/configs/ 的application.ini**檔案。
10. 若要從浏覽器通路管理界面,使用下面的url位址 https://rainloop.lan/?admin,然後提供輸入預設的應用程式使用者名密碼,如下:
user = admin
password = 12345
rainloop web 界面
11. 首次登入後,你會被警示需要更改預設密碼,是以我勸你做這一點。
修改預設 password
設定新的 admin password
12. 如果您要啟用contact(聯系人)功能,就登入到mysql資料庫并建立一個新的資料庫及其使用者,然後提供在contacts字段裡面輸入資料庫資訊。
mysql -u root -p
create database if not exists rainloop;
create user rainloop_user@localhost identified by “password”;
grant all privileges on rainloop.* to rainloop_user@localhost;
flush privileges;
exit;
在 rainloop 中激活聯系人
添加聯系人資料庫配置
13. 預設情況下rainloop提供了** gmail,yahoo和outlook**的郵件伺服器的配置檔案,但是你如果願意,你也可以添加其他的郵件伺服器域。
預設 mail 域
添加新域
14. 登入你的郵件伺服器,通路 https://rainloop.lan,并提供您的域名伺服器驗證資訊。
登入到yahoo郵件頁面
登入gmail
rainloop 登入後的email 界面
通過rainloop你可以從浏覽器中通路具有internet連接配接的任何郵件伺服器。唯一的缺憾就是在arch linux下使用rainloop應用的話,少一個修改電子郵件帳戶密碼的poppassd插件包。
原文釋出時間:2014-06-20
本文來自雲栖合作夥伴“linux中國”