centos7安装next cloud以及遇到的问题合集

安装nextcloud

安装apache
yum -y install httpd在这里插入图片描述
启动apache
systemctl start httpd.service
在这里插入图片描述
注:这里会占用80端口,如果想要不使用80端口则在 /etc/httdp/conf/httpd.conf中将Listen 80 修改为你想要的关口

直接访问IP+端口在这里插入图片描述
PHP安装(添加EPEL和REMI存储库)
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm在这里插入图片描述
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm在这里插入图片描述
yum -y install yum-utils在这里插入图片描述
yum-config-manager --enable remi-php74在这里插入图片描述
yum update在这里插入图片描述
yum install php php-cli在这里插入图片描述
yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json在这里插入图片描述
测试
php -v
在这里插入图片描述
MySQL安装
可以参考Centos7安装mysql8.0教程
下载nextcloud
wget https://download.nextcloud.com/server/releases/nextcloud-18.0.2.zip在这里插入图片描述
解压文件
unzip -q nextcloud-18.0.2.zip -d /var/www/html/在这里插入图片描述
更改权限
chown -R apache:apache /var/www/html/nextcloud/
chmod 770 /var/www/html/nextcloud/ -Rf
重启服务
systemctl restart httpd
访问nextcloud页面
IP+端口/nextcloud/index.php在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

至此完成私有网盘的搭建

安装nginx后反向代理到私有next cloud

在nginx中这样配置
注:楼主这里是配置了SSL证书的

server {
        #SSL 访问端口号为 443
        listen 443 ssl;
        ssl on;
        #填写绑定证书的域名
        server_name xxx.com; 
        #证书文件名称
        ssl_certificate 你的.crt文件; 
        #私钥文件名称
        ssl_certificate_key 你的.key文件; 
        ssl_session_timeout 5m;
        #请按照以下协议配置
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
        #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 
        ssl_prefer_server_ciphers on;

	    add_header X-Content-Type-Options nosniff;
  	    add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        add_header Strict-Transport-Security "max-age=15768000";

        location / {
           #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
           #例如,您的网站运行目录在/etc/www下,则填写/etc/www。
            root html; 
            index  index.html index.htm;
        }
        location /nextcloud {
		proxy_buffering off;
      	proxy_set_header Host $http_host;
      	proxy_set_header Upgrade $http_upgrade;
      	proxy_set_header X-Real-IP $remote_addr;
     	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        
        proxy_pass 你的next cloud访问地址;
        }
    }

在这里插入图片描述
配置好nginx后,在nextcloud的配置文件中添加 ‘overwriteprotocol’ => ‘https’ 这个配置
在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值