Roundcube
![]() 此页面需要被删除(Alpine 不打包 Roundcube)或更新为包含 Alpine 当前版本和 Roundcube 1.6.2 的说明 (讨论) |
Roundcube 是一款免费开源的 Webmail 软件,使用 PHP 编写,面向大众。
安装 PHP 和 Lighttpd
基本安装
要首先安装其他软件包,请激活社区软件包 并更新软件包索引
安装所需的软件包
# apk add lighttpd php82 fcgi php82-cgi
配置 Lighttpd
编辑 lighttpd.conf (/etc/lighttpd/lighttpd.conf) 并取消注释行
编辑 mod_fastcgi.conf (/etc/lighttpd/mod_fastcgi.conf),找到并更改 /usr/bin/php-cgi 为 /usr/bin/php-cgi82。
启动 lighttpd
服务并将其添加到默认运行级别
# rc-service lighttpd start # rc-update add lighttpd default
为了增加安全性,请在 Lighttpd 中配置 https 访问。
添加其他软件包
apk add php-openssl php-intl
vHost
vi /etc/lighttpd/lighttpd.conf
- 取消注释此行
"mod_simple_vhost"
- 添加以下行
simple-vhost.server-root = "/var/www/localhost/htdocs/" simple-vhost.default-host = "/" simple-vhost.document-root = "www/"
$SERVER["socket"] == "round.cube.mail.ipaddres:443" { ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/server-bundle.pem" }
- 重启 Web 服务
rc-service lighttpd restart
- 根据 [1] 设置 php 时区
vi /etc/php/php.ini
- 取消注释并设置 date.timezone = (例如 'America/Asuncion')
下载并安装 Roundcube
- 创建文件夹
mkdir -p /usr/share/webapps cd /usr/share/webapps
- 下载
wget https://downloads.sourceforge.net/project/roundcubemail/roundcubemail/0.5.2/roundcubemail-0.5.2.tar.gz
- 解压
tar zxvf roundcubemail-0.5.2.tar.gz
- 重命名文件夹并更改权限
mv roundcubemail-0.5.2 roundcubemail chmod 775 -R roundcubemail
- 创建符号链接
mv /var/www/localhost/htdocs/ /var/www/localhost/htdocs.old ln -s /usr/share/webapps/roundcube/ /var/www/localhost/htdocs/
- 创建日志文件夹
mkdir -p /var/log/roundcube/ chown -R lighttpd:lighttpd /var/log/roundcube/ chmod 775 /var/log/roundcube/ -R
Postgres 安装
- 添加 postgresql,创建和配置数据库
apk add postgresql postgresql-client rc-service postgresql setup rc-service postgresql start rc-update add postgresql
su postgres createuser roundcube
回答:N,N,Y
- 新角色应该是超级用户吗? (y/n) n
- 允许新角色创建数据库吗? (y/n) n
- 允许新角色创建更多新角色吗? (y/n) y
createdb -O roundcube -E UNICODE -T template0 roundcubemail
注意: 设置与 php.ini 中使用的时区相同的时区(例如 'America/Asuncion')
psql roundcubemail ALTER USER roundcube WITH PASSWORD 'the_new_password'; ALTER DATABASE roundcubemail SET timezone TO 'America/Asuncion'; \c - roundcube \i /usr/share/webapps/roundcube/SQL/postgres.initial.sql roundcubemail=> \q exit
Roundcube Web 配置
启动浏览器并访问:https://round.cube.mail.ipaddres/installer/
Roundcube Webmail 安装程序有 3 个步骤
- 检查环境
- 检查一切是否正常,点击 NEXT
- 创建配置
这里你需要设置
- a. 常规配置
- product_name
- 你的国家/地区分支 Webmail 访问
- temp_dir
- /tmp/
- identities_level
- 一个身份,可以编辑所有参数
- product_name
- b. 日志记录 & 调试
- log_driver
- syslog
- log_dir
- /var/log/roundcube/
- log_driver
- c. 数据库设置
- db_dsnw
- 用于读/写操作的数据库设置
- PgSQL 数据库类型
- localhost 数据库服务器
- roundcubemail 数据库名称
- roundcube 数据库用户名
- ********* 数据库密码
- db_dsnw
- d. IMAP 设置
- default_host
- 选择用于执行登录的 IMAP 主机
- your.exchange.ip.address
- username_domain
- your.domain
- e. SMTP 设置
- smtp_server
- your.exchange.ip.address
- smtp_server
现在需要下载并将两个文件(main.inc.php 和 db.inc.php)复制到 /etc/roundcube/
- 测试配置
- 通过发送邮件测试 SMTP 配置,并使用用户名和密码测试 IMAP 配置。
最后步骤
- 删除或重命名 /usr/share/webapps/roundcube/installer/ 文件夹。
- 现在你应该可以通过以下地址访问 Roundcube:https://round.cube.mail.ipaddres/