最後更新: 2024-06-20
目錄
Install
Debian6: 只能安 roundcube 7.3
原因:
以下 pecl 安裝唔到
- Net_SMTP
- Net_IDNA2
- Mail_mime
# C7
yum install php-pear-Auth-SASL php-pear-Mail-Mime php-pear-Net-SMTP php-pear-Net-IDNA2
Troubleshoot
在 Debian 與到 Error
[31-May-2012 09:28:30] MDB2 Error: not found (-4): unable to find package 'MDB2_Driver_mysql' file 'MDB2/Driver/mysql.php'
解決:
pear install MDB2_Driver_mysql
Centos6 安裝
準備:
php extension:
php-intl
安裝:
把最新的 tar.gz 放到 /usr/share
soft link 它到 roundcubemail
設定目錄 permission:
cd roundcubemail
chown apache. temp logs
chmod 770 temp logs
到 http://xxx/installer 建立設定檔
upload db.inc.php main.inc.php 到 config 目錄
設定目錄 permission
cd config
chmod 640 *
chgrp apache *
回到 http://xxx/installer 測試
測試成功後, 把 installer 的 permission 改成 000
cd ..
chmod 000 installer
Apache 設定
# Apache 2.4
<Directory ${WebmailRoot}> Require ip 127.0.0.1 Require all granted # php80 <FilesMatch ".+\.php$"> SetHandler application/x-httpd-php SetHandler "proxy:fcgi://127.0.0.1:9080" </FilesMatch> Options -Indexes <FilesMatch "(config.inc.php|composer.*|\.bak)"> Require all denied </FilesMatch> </Directory> <Directory "${WebmailRoot}/bin"> Require all denied </Directory> <Directory "${WebmailRoot}/config"> Require all denied </Directory> <Directory "${WebmailRoot}/installer"> Require all denied </Directory> <Directory "${WebmailRoot}/logs"> Require all denied </Directory> <Directory "${WebmailRoot}/temp"> Require all denied </Directory> <Directory "${WebmailRoot}/SQL"> Require all denied </Directory> <Directory "${WebmailRoot}/vendor"> Require all denied </Directory>
# Apache 2.2
roundcubemail.conf
Alias /mail "/var/www/roundcubemail/" Alias /webmail "/var/www/roundcubemail/" <Directory "/var/www/roundcubemail/"> Order allow,deny Allow from all Options -Indexes </Directory> <Directory "/var/www/roundcubemail/config"> Deny from all </Directory> <Directory "/var/www/roundcubemail/temp"> Deny from all </Directory> <Directory "/var/www/roundcubemail/logs"> Deny from all </Directory>
Nginx 設定
nginx.conf
include conf.d/*.conf;
vhosts.conf
# roundcube webmail config include snippets/roundcube.conf;
snippets/roundcube.conf
# ACL location ~ ^/webmail/(bin|config|installer|logs|SQL|temp|vendor)($|/.*) { deny all; } location ~ ^/webmail/(CHANGELOG|composer.json|INSTALL|jsdeps.json|LICENSE|README|UPGRADING)($|.*) { deny all; } location ~ ^/webmail/plugins/.*/config.inc.php.* { deny all; } location ~ ^/webmail/plugins/enigma/home($|/.*) { deny all; } # 用戶可以不鍵入尾的 "/" location = /webmail { return 302 /webmail/; } # 執行 php location ~ ^/webmail/(.*\.php)$ { # Setup 時要用到的 ACL allow X.X.X.X; deny all; include /etc/nginx/snippets/hsts.conf; include /etc/nginx/snippets/fastcgi_php.conf; fastcgi_param SCRIPT_FILENAME /opt/www/roundcubemail/$1; } # 使用 alias 將 Folder map 到其他地方, # 而不是 "root path_to_root;" 入面 location ~ ^/webmail/(.*) { alias /opt/www/roundcubemail/$1; index index.php; }
snippets/fastcgi_php.conf
include snippets/fastcgi_params.conf; fastcgi_index index.php; # Handle PHP files with upstream handler fastcgi_pass php_workers; # Fix the HTTPROXY issue. fastcgi_param HTTP_PROXY '';
snippets/fastcgi_params.conf
fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200;
snippets/hsts.conf
add_header Strict-Transport-Security "max-age=31536000";
conf.d/php-fpm.conf
upstream php_workers { server 127.0.0.1:9082; }
Version(roundcube & php)
1.4.9
支援手機界面
0.9.5-dep
PHP Version 5.2.1
.htaccess support
PEAR packages
Net_SMTP: NOT OK(Failed to load Net/SMTP.php; See http://pear.php.net/package/Net_SMTP) <-- pear install Net_SMTP
Net_IDNA2: NOT OK(Failed to load Net/IDNA2.php; See http://pear.php.net/package/Net_IDNA2)
Mail_mime: NOT OK(Failed to load Mail/mime.php; See http://pear.php.net/package/Mail_mime)
0.7.4-dep
PHP Version 5.2.1
0.5.4-dep
PHP Version 5.2.1