私有云盘的搭建(owncloud、seafile)

序号主机系统作用备注
1stu:192.168.3.81rockylinux8.6最小化安装owncloud云盘
2stu:192.168.3.82rockylinux8.6最小化安装seafile云盘

一、owncloud

1、关闭selinux及防火墙

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl disable firewalld
reboot

2、安装软件包

yum install  -y  httpd php php-mysqlnd mariadb-server mariadb vim net-tools \
  bash-completion  bzip2
systemctl start httpd.service
systemctl start mariadb.service
mysql_secure_installation

3、安装owncloud

下载地址

https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2

wget -P /var/www/html https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
cd /var/www/html
bzip2 -d owncloud-complete-latest.tar.bz2
tar -xvf owncloud-complete-latest.tar
chown -R apache:apache /var/www/html/owncloud/
mysql -uroot -ppassword
create database owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

访问:http://192.168.3.81/owncloud/index.php

rpm -qa | grep php

dnf module switch-to php:7.4 -y
rpm -qa | grep php

 访问:http://192.168.3.81/owncloud/index.php

dnf install -y php-zip php-intl php-gd

 重新访问:http://192.168.3.81/owncloud/index.php

 安装完成后登录,下载客户端

 创建用户并修改密码

 设置客户端

 

 

 二、seafile云盘搭建

1、 关闭selinux及防火墙

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl disable firewalld
reboot

2、安装软件包

dnf -y install vim net-tools bash-completion wget
yum install python3 python3-setuptools python3-pip python3-devel mysql-devel gcc -y
yum install nginx mariadb-server mariadb -y
pip3 install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host \
      mirrors.aliyun.com pip2pi
pip3 install --upgrade pip
pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 \
    django-pylibmc django-simple-captcha python3-ldap mysqlclient
systemctl start mariadb
mysql_secure_installation

3、安装seafile

mkdir /opt/seafile
useradd seafile
chown -R seafile:seafile /opt/seafile
su - seafile
cd /opt/seafile/
wget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_8.0.8_x86-64.tar.gz
tar -xvf seafile-server_8.0.8_x86-64.tar.gz
cd seafile-server-8.0.8/
./setup-seafile-mysql.sh

 

./seafile.sh start
./seahub.sh  start

su

vim /etc/nginx/conf.d/seafile.conf

log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';

server {
    listen 80;
    server_name 192.168.3.82;

    proxy_set_header X-Forwarded-For $remote_addr;

    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_read_timeout  1200s;

         # used for view/edit office file via Office Online Server
         client_max_body_size 0;

         access_log      /var/log/nginx/seahub.access.log seafileformat;
         error_log       /var/log/nginx/seahub.error.log;
    }

# If you are using [FastCGI](http://en.wikipedia.org/wiki/FastCGI),
# which is not recommended, you should use the following config for location `/`.
#
#    location / {
#         fastcgi_pass    127.0.0.1:8000;
#         fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
#         fastcgi_param   PATH_INFO           $fastcgi_script_name;
#
#         fastcgi_param  SERVER_PROTOCOL     $server_protocol;
#         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  SERVER_ADDR         $server_addr;
#         fastcgi_param  SERVER_PORT         $server_port;
#         fastcgi_param  SERVER_NAME         $server_name;
#         fastcgi_param   REMOTE_ADDR         $remote_addr;
#        fastcgi_read_timeout 36000;
#
#         client_max_body_size 0;
#
#         access_log      /var/log/nginx/seahub.access.log;
#        error_log       /var/log/nginx/seahub.error.log;
#    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;

        send_timeout  36000s;

        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    }
    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
    }
}
nginx -t
nginx -s reload
systemctl restart nginx

http://192.168.3.82

 

更换用户登录,登录需要修改密码

 下载客户端

下载 - Seafile

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值