在 Debian 8 系统里安装 seafile 服务器(mysql数据库)
环境:Debian 8 64位,seafile-server_6.2.2_x86-64
目的:使用https://swas.anqun.org 访问到 Seahub 网站
过程:
- apt-get update #更新
- apt-get install mariadb-server #安装 mariadb-server
- apt-get install python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3 #安装python及相应软件
- apt-get install nginx #安装nginx,用来反向代理后端的 seahub 网站
vi /etc/nginx/sites-enabled/swas.conf #创建swas.anqun.org反向代理配置内容,详细如下:
server { listen 80; server_name swas.anqun.org; rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https # Enables or disables emitting nginx version on error pages and in the "Server" response header field. server_tokens off; } server { listen 443; ssl on; ssl_certificate /etc/ssl/214298380010268.pem; # path to your cacert.pem ssl_certificate_key /etc/ssl/214298380010268.key; # path to your privkey.pem server_name swas.anqun.org; server_tokens off; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Proto https; access_log /var/log/nginx/seahub.access.log; error_log /var/log/nginx/seahub.error.log; proxy_read_timeout 1200s; client_max_body_size 0; } }
- adduser liujia #创建一个普通用户,seafile相应文件放在 /home/liujia 路径里
- su liujia #切换到普通用户liujia
- wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_6.2.2_x86-64.tar.gz #下载当前版本的seafile安装文件
- tar xzvf seafile-server_6.2.2_x86-64.tar.gz #解压安装文件
- cd seafile-server-6.2.2 #切换到程序目录
- ./setup-seafile-mysql.sh #开始安装
- 按提示回答问题,如输入Mariadb的root密码,其它如端口和数据库名称,可保持默认的
- ./seafile.sh start # 启动 Seafile 服务
- ./seahub.sh start # 启动 Seahub 网站
- 在浏览器里访问,登录,正常