简介

说真的现在的网盘真的是垃圾垃圾垃圾各种限速,各种会员比如百度云盘
那为什么不自己搭建一个网盘,朋友的 推荐是owncloud,那么就来搭建一下

安装lnmp

首先要安装lnmp,下面先列一下owncloud的环境要求

  • Operating System:Ubuntu 16.04, Debian 7 and 8, SUSE Linux Enterprise Server 12 and 12 SP1, Red Hat Enterprise Linux/Centos 6.5 and 7
  • Database:MySQL or MariaDB 5.5+, Oracle 11g, PostgreSQL, & SQLite
  • Web server:Apache 2.4 with mod_php
  • PHP Runtime:PHP (5.6+ or 7.0+)

为了方便我就使用lnmp一键安装包来安装了
先下载screen
yum install screen
这个是为了防止网络中断导致安装中断
之后创建一个会话来安装lnmp
screen -S lnmp
接着下载安装脚本
wget http://soft.vpser.net/lnmp/lnmp1.4.tar.gz
之后解压
tar -zxvf lnmp1.4.tar.gz

[root@iZuf65l667kvowasvo93k6Z ~]# cd lnmp1.4
[root@iZuf65l667kvowasvo93k6Z lnmp1.4]# ls
addons.sh  ChangeLog  conf  include  init.d  install.sh  License  lnmp.conf  pureftpd.sh  README  src  tools  uninstall.sh  upgrade1.x-1.4.sh  upgrade.sh

执行那个install.sh就好了
./install.sh

+------------------------------------------------------------------------+
|          LNMP V1.4 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
You have 5 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.56 (Default)
3: Install MySQL 5.6.36
4: Install MySQL 5.7.18
5: Install MariaDB 5.5.56
6: Install MariaDB 10.0.30
7: Install MariaDB 10.1.23
0: DO NOT Install MySQL/MariaDB
Enter your choice (1, 2, 3, 4, 5, 6, 7 or 0): 4
You will install MySQL 5.7.18
===========================
Please setup root password of MySQL.(Default password: root)
Please enter: 你的密码
MySQL root password: 你的密码
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]:
No input,The InnoDB Storage Engine will enable.
===========================
You have 6 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38 (Default)
5: Install PHP 5.6.31
6: Install PHP 7.0.21
7: Install PHP 7.1.7
Enter your choice (1, 2, 3, 4, 5, 6 or 7): 7
You will install PHP 7.1.7
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3):
No input,You will not install Memory Allocator.Press any key to install...or Press Ctrl+c to cancel

回车安装
你可以输入ctrl+a+d来退出这个会话。输入screen -r来进入这个会话
安装时间视配置来决定

============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
PHP-FPM: OK
Clean src directory...
+------------------------------------------------------------------------+
|          LNMP V1.4 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
|    lnmp status manage: lnmp {start|stop|reload|restart|kill|status}    |
+------------------------------------------------------------------------+
|  phpMyAdmin: http://IP/phpmyadmin/                                     |
|  phpinfo: http://IP/phpinfo.php                                        |
|  Prober:  http://IP/p.php                                              |
+------------------------------------------------------------------------+
|  Add VirtualHost: lnmp vhost add                                       |
+------------------------------------------------------------------------+
|  Default directory: /home/wwwroot/default                              |
+------------------------------------------------------------------------+
|  MySQL/MariaDB root password: 你的密码                          |
+------------------------------------------------------------------------+
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
nginx (pid 10396 10394) is running...
php-fpm is runing!SUCCESS! MySQL running (10924)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
Install lnmp takes 68 minutes.
Install lnmp V1.4 completed! enjoy it.

出现上面界面表示安装完成

安装owncloud

首先下载owncloud
wget https://download.owncloud.org/community/owncloud-10.0.2.tar.bz2
接着解压
unzip owncloud-10.0.2.zip
之后放入一个站点文件夹中
mv owncloud /home/wwwroot/
接着配置nginx
cd /usr/local/nginx/conf/vhost/
vim owncloud.conf
输入下面内容


upstream php-handler {#server 127.0.0.1:9000;server unix:/tmp/php-cgi.sock;
}server {listen 80;server_name 106.14.192.149;# Add headers to serve security related headers# Before enabling Strict-Transport-Security headers please read into this topic first.#add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";add_header X-Content-Type-Options nosniff;add_header X-Frame-Options "SAMEORIGIN";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 installationroot /home/wwwroot/owncloud;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 { }# set max upload sizeclient_max_body_size 16400M;fastcgi_buffers 64 4K;fastcgi_read_timeout 600;client_body_buffer_size 1048576k;client_body_temp_path /tmp/owncloud;# Disable gzip to avoid the removal of the ETag headergzip 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)/ {return 404;}location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {return 404;}location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {fastcgi_split_path_info ^(.+\.php)(/.*)$;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_INFO $fastcgi_path_info;#fastcgi_param HTTPS on;fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twicefastcgi_param front_controller_active true;fastcgi_pass php-handler;fastcgi_intercept_errors on;fastcgi_request_buffering off; #Available since nginx 1.7.11}location ~ ^/(?:updater|ocs-provider)(?:$|/) {try_files $uri $uri/ =404;index index.php;}# Adding the cache control header for js and css files# Make sure it is BELOW the PHP blocklocation ~* \.(?: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)# Before enabling Strict-Transport-Security headers please read into this topic first.#add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";add_header X-Content-Type-Options nosniff;add_header X-Frame-Options "SAMEORIGIN";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 assetsaccess_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 assetsaccess_log off;}
}

这样nginx就配置好了,注意的是如果fastcgi_pass unix:/tmp/php-cgi.sock这个配置错误,那么就会报502错误
接着配置数据库
mysql -uroot -p
创建一个数据库
create database owncloud;
在浏览器中输入你的地址访问

如果出现上面的错误,那么就要把你的那个目录的权限修改一下
比如
chown www:www owncloud/
点击storge&database设置你的数据库,(玩玩用sqlite就好了,生产用mysql,mysql配置我就不说了)然后设置你的管理员账号和密码,之后就可以登录了

客户端

owncloud的客户端是全平台的,连linux都有,所以66666666,因为我是ubuntu的所以就安装ubuntu了
输入下面命令
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud-client.list"
加入软件源
然后加入秘钥
wget -nv http://download.opensuse.org/repositories/isv:ownCloud:desktop/Ubuntu_16.04/Release.key -O Release.key
sudo apt-key add - < Release.key
更新软件源
sudo apt-get update
安装owncloud
sudo apt-get install owncloud-client
之后打开客户端,会让你设置server address

如果出现
Error downloading https://myip/owncloud/status.php - server replied: Internal Server Error"
这样的错误请重启一下php-fpm

Have Fun

在阿里云上创建一个个人网盘(owncloud)相关推荐

  1. 利用阿里云OSS开发一个私人网盘/外链系统,php+js实现

    什么是阿里云OSS? 简单地理解,阿里云OSS(以下简称OSS)就是一个储存空间比较大的硬盘. 一般储存空间在40GB-400TB范围内 根据自己的需要去购买,而且便宜! 在阿里云官网可以购买. 我自 ...

  2. 如何在阿里云上构建一个合适的Kubernetes集群

    摘要: 声明 本文主要介绍如何在阿里云上构建一个K8S集群的实践,只是作为参考,大家可以根据实际情况做出调整. 集群规划 在实际案例中发现,有不少同学使用了很多的小规格的ECS来构建K8S集群,这样其 ...

  3. 阿里云上创建Oracle RAC-静默模式

    编前语: 小编成功在阿里云上搭建Oracle RAC断断续续花了1个月的时间,中间的过程简直是痛苦,网上很多的资料都是基于图形化界面的,也有静默模式但是步骤都非常的粗略,可能是写这样的步骤太费时间了. ...

  4. 华为云上部署Seafile私人网盘

    华为云上部署Seafile私人网盘 一.环境的准备 1.安装Nginx 2.安装Mariadb(Mysql) 3.安装其他的其他依赖组件 二.安装Seafile服务器端(Linux) 1.下载seaf ...

  5. 【花费9毛钱购买阿里云服务器搭建一个私有云盘-owncloud】

    花费9毛钱购买阿里云服务器搭建一个私有云盘-owncloud 参考 准备工作 安装 参考 https://blog.csdn.net/u013894429/article/details/879160 ...

  6. 阿里云上创建个人网站

    1.注册域名 a)打开阿里云网站首页 https://www.aliyun.com/ b)打开产品页面下的域名注册页面 c)查询自己喜欢的域名(未被注册的,且价格低廉的,尽量选择.com的域名,方便别 ...

  7. 【SVN】在阿里云上创建svn服务器

    1.创建用户及相关设置 阿里云搭建ubuntu18.04工作台,默认只有root超级用户.为了安全起见,我们使用普通用户来创建svn: useradd hello // 创建用户hello mkdir ...

  8. php制作云端网盘项目,用云开发整一个专属网盘,原来如此简单!

    相信不少同学都曾想部署自己的个人网盘,又不想专门租一个服务器.操心环境搭建以及各种各样繁杂的运维工作. 现在,云托管的诞生,让个人网盘的搭建变得so easy,只需几步,"啪"的一 ...

  9. ubuntu上踩的坑—阿里云上创建服务器(深度学习)

    管理控制台  -->  云服务器ECS  -->  实例,选择  "创建实例" 如下选择,一切为了 便宜 ¥¥¥ 注意:如果没有自定义镜像的话,需要先创建自定义镜像(需 ...

最新文章

  1. ESP8266-iot-2
  2. 基于容器的全链路运维平台实践
  3. Maven简单的配置Junit测试及使用简单的mock
  4. tensorflow 进阶(三),BP神经网络之两层hidden_layer
  5. MySQL 常用语法 之 DISTINCT
  6. 清掉数据_大数据超详尽分析,带你看懂打野江湖
  7. Ergo生态:首个算法稳定币SigmaUSD正式启动
  8. 每日一道算法题--leetcode 169--求众数--python--两种方法
  9. 第八回 新年晚会艺压群芳 文理分科三人聚首[林大帅作品选]
  10. 幼儿园网络图怎么绘制_如何设计幼儿园主题网络图
  11. apm系统服务器,APM系统简单对比(zipkin,pinpoint和skywalking)
  12. 在没有SSRS的ASP.NET中运行RDL/RDLC(SQL报告)
  13. mysql 5.7 存储引擎_简述MySQL 7种存储引擎
  14. Python pip distribute
  15. ajax java首字母检索_AJAX的拼音首字母查找对应中文的portlet
  16. 基于mahout的动漫推荐系统
  17. 微信小程序中裁剪图片以及压缩到指定尺寸并上传
  18. 【已解决】Paragon NTFS for mac彻底删除
  19. 5、谷歌地图官方API-可视化数据:地震图
  20. 分布式服务框架 dubbo/dubbox 入门示例(2)

热门文章

  1. 腾讯云发布全链路数据开发平台WeData,大数据开发迈入新时代
  2. Java工程师的成长路线图是什么?
  3. [luogu 3773][CTSC 2017]吉夫特
  4. intellij 打开node项目 一直停留在scanning files to index....,或跳出内存不够的提示框...
  5. 用Vue来实现音乐播放器(十六):滚动列表的实现
  6. 第174天:面向对象——公有属性、私有属性和静态属性
  7. Node.js模拟发起http请求从异步转同步的5种方法
  8. 19. 删除链表的倒数第N个节点
  9. 放弃java转战kotlin,我的心路历程
  10. AM335X can驱动移植