文档章节

manjaro(linux)上搭建nextcloud,搞一个自己的网盘!

o
 osc_baeiwmv4
发布于 07/01 15:55
字数 613
阅读 45
收藏 0

精选30+云产品,助力企业轻松上云!>>>

manjaro(Linux)上搭建nextcloud

视频资源

大家可以看一下b站的教学资源教学视频,这个视频是YouTube上的,虽然语言是外语,并且还没字幕,但是是可以看懂的,按步骤来就行。下面是视频里的一些配置文件,直接复制就行了。

配置文件

Become a Patron!

Here’re the details and commands for this video on our channel!

Server Block

Create the conf.d directory:

$ sudo mkdir /etc/nginx/conf.d

Create the Nextcloud.conf file:

$ sudo nano /etc/nginx/conf.d/nextcloud.conf

Enter the following text for the Server Block:

server {
    listen 80;
    server_name localhost;

 # Add headers to serve security related headers
    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;

 # Path to the root of your installation
    root /usr/share/webapps/nextcloud/;

 location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

 # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
    # last;

 location = /.well-known/carddav {
        return 301 $scheme://$host/remote.php/dav;
    }
    location = /.well-known/caldav {
       return 301 $scheme://$host/remote.php/dav;
    }

 location ~ /.well-known/acme-challenge {
      allow all;
    }

 # set max upload size
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;

 # Disable gzip to avoid the removal of the ETag header
    gzip off;

 # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

 error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;

 location / {
       rewrite ^ /index.php$uri;
    }

 location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
       deny all;
    }
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
       deny all;
     }

 location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
       include fastcgi_params;
       fastcgi_split_path_info ^(.+\.php)(/.*)$;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_param PATH_INFO $fastcgi_path_info;
       #Avoid sending the security headers twice
       fastcgi_param modHeadersAvailable true;
       fastcgi_param front_controller_active true;
       fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
       fastcgi_intercept_errors on;
       fastcgi_request_buffering off;
    }

 location ~ ^/(?:updater|ocs-provider)(?:$|/) {
       try_files $uri/ =404;
       index index.php;
    }

 # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~* \.(?:css|js)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        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;
        # Optional: Don't log access to assets
        access_log off;
   }

 location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log off;
   }
}
Override text php-fpm service:

Enter in the Terminal:

$ sudo systemctl edit php-fpm.service

Enter the following text in the file:

[Service]
ReadWritePaths = /usr/share/webapps/nextcloud/apps
ReadWritePaths = /usr/share/webapps/nextcloud/data
ReadWritePaths = /etc/webapps/nextcloud/config

# Replace the following path with the Nextcloud data directory
ReadWritePaths = /var/nextcloud
Nextcloud Hook:

Create the hooks directory:

$ sudo mkdir /etc/pacman.d/hooks

Create the Nextcloud.hook file:

$ sudo nano /etc/pacman.d/hooks/nextcloud.conf

Enter the follwing text:

[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = nextcloud
Target = nextcloud-app-*
  
[Action]
Description = Update Nextcloud installation
When = PostTransaction
Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade

Thanks to everyone who joined us on the live stream and let us know how you like Arch Linux!

Become a Patron!

o
粉丝 0
博文 39
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。
manjaro(linux)上搭建nextcloud,搞一个自己的网盘!

manjaro(Linux)上搭建nextcloud 视频资源 大家可以看一下b站的教学资源教学视频,这个视频是YouTube上的,虽然语言是外语,并且还没字幕,但是是可以看懂的,按步骤来就行。下面是视频里的...

smallger666
06/30
0
0
痛心!Pandownload开发者被抓!我终于决定使用Docker搭建一个多端同步网盘!

原文地址:https://www.jianshu.com/p/54f157a211af 作者:zhaoolee 想必大家最近都被 “Pandownload 开发者被抓” 的新闻刷屏了。 说实话挺揪心了!站在使用者的角度我感谢他提供了一个不错...

JavaGuide
04/18
2
0
自建 Nextcloud 个人网盘图文搭建教程

前言 几年前还红红火火的国内网盘服务们,如今只剩下百度网盘一枝独秀了。虽然还有 OneDrive、Google Drive 等国外网盘,但国内访问并不友好。 私有云和 NAS 这种完全掌握在自己手中的云端存...

己立
2018/08/14
0
0
Centos8下搭建私人开源网盘NextCloud步骤及使用(基于LAMP)

简介: Nextcloud是一款开源免费的私有云存储网盘项目,可以让你快速便捷地搭建一套属于自己或团队的云同步网盘,从而实现跨平台跨设备文件同步、共享、版本控制、团队协作等功能。它的客户端...

osc_05umekgg
02/29
7
0
Linux下使用nextcloud搭建个人网盘

市面上有那么多的网盘服务提供商,为什么还要自己搭建网盘呢?主要有以下原因: 免费的网盘都有种种限制,要么不限速容量小(onedriver,google driver),要么容量大限速(百度云) 付费网盘服务...

osc_33f1gguo
2019/05/16
13
0

没有更多内容

加载失败,请刷新页面

加载更多

测试工程师需要了解的shell变量知识

顾老师安全测试新课,报名地址: http://www.hbz100.com/pc/course/courseInfo.do?courseId=182320200226121405459。疫情期间,您在注意身体安全的同时,关注身体安全了吗?500元工作几天的薪...

啄木鸟顾老师
04/15
0
0
前端面试开源项目清单(github仓库,个人网站都有)

 复习前端面试的知识,是为了巩固前端的基础知识,最重要的还是平时的积累! ” 开源项目 https://github.com/InterviewMap/CS-Interview-Knowledge-Map 建立最好的面试地图。目前的内容包...

Fe-frank
05/11
0
0
【Flutter 专题】33 自定义 View 之 Canvas (一)

和尚最近在学习自定义 View,刚了解了一下 Paint 画笔的神奇之处,现在学习一下 Canvas 画布的神秘之处。Flutter 提供了众多的绘制方法,和尚接触不深,尽量都尝试一下。 Canvas 画布 drawCo...

阿策
2019/02/26
0
0
程序员,有需求做需求,有bug改bug,有什么好生气的呢?

对哦,我有什么好生气的呢! 本文分享自微信公众号 - WriteSimpleDemo(this_is_a_wechat)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与“OSC源创计划”,欢迎正在阅读的你也加入...

PedroQin
2019/10/25
0
0
[从0到1搭建ABP微服务] - 搭建授权服务

一、简介 授权中心是微服务架构中最为核心重要的环节,不仅为web、app等客户端提供身份授权服务,还对其他微服务提供身份认证服务。ABP微服务架构中使用identityServer4框架进行身份管理,并...

osc_g91p39eg
5分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部