Ubuntu14.04服务搭建 next cloud—— 免费开源的自己的私有网盘

   **Ubuntu14.04服务搭建 next cloud—— 免费开源的私有网盘**

源代码安装

1. sudo apt-get  update 
 2. sudo apt-get install vim // 安装 vim编辑器
  1. 安装并配置lnmp

    Linux +Nginx+ MySQL的+的Perl / PHP / Python的(LNMP)一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度共同组成了一个强大的网络应用程序平台。
    Nginx有着诸多优势的Nginx的如今已是增长最快的网络服务器了,截止今年4月,7年前仅有3.9%占有率的Nginx的已经增长到如今的33.3%,这代表着平均每分钟就有一个排名前1000万以内的网站改弦更张,将老服务器替换成Nginx的。而相对同样快速增长的网络服务器的Node.js,改用Nginx的的网站达到了改用Node.js的网站数量的70倍。此外,自2010年以来,阿帕奇的市场份额从71.5%下滑至50%不到,而微软的IIS则从20.6%下滑到11.3%。结果不出所料,大多原本使用的Apache的网站都改用了Nginx的。大部分流量较大的网站都很喜欢使用Nginx的,在流量最大的前1万个网站中,有58.4%使用Nginx的。不过,在流量最大的前100万个网站中,阿帕奇的市场份额仍旧领先,占有率为42.8 %。随着Nginx的的占有率达到了39.7%,阿帕奇的优势也在不断丧失。

sudo chmod 777 /usr/local/src/  //改变安装目录src的权限

cd /usr/local/src/                           //改变路径到src下

sudo wget http://soft.vpser.net/lnmp/lnmp1.5.tar.gz   //下载lnmp1.5

sudo tar -xzf lnmp1.5.tar.gz                                           //解压

cd lnmp1.5/                                              //改变路径到lnmp1.5

 sudo  ./install.sh       //源代码安  (sudo  ./ uninstall.sh   //源代码卸载)

lnmp具体安装步骤:

sudo ./install.sh

±-----------------------------------------------------------------------+
| LNMP V1.5 for Ubuntu 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 10 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.60 (Default)
3: Install MySQL 5.6.40
4: Install MySQL 5.7.22
5: Install MySQL 8.0.11
6: Install MariaDB 5.5.60
7: Install MariaDB 10.0.35
8: Install MariaDB 10.1.33
9: Install MariaDB 10.2.14
0: DO NOT Install MySQL/MariaDB

Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9 or 0):  //按回车选择默认的5.5.60

**No input,You will install MySQL 5.5.60
===========================**
Please setup root password of MySQL.

Please enter: mysql_passwd           //设置mysql数据库的root帐号密码,别忘记!

**MySQL root password: mysql_passwd
===========================**
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 8 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
5: Install PHP 5.6.36 (Default)
6: Install PHP 7.0.30
7: Install PHP 7.1.18
8: Install PHP 7.2.6

Enter your choice (1, 2, 3, 4, 5, 6, 7 or 8): 8 //  选择PHP 7.2.6,Nextcloud依赖PHP7

You will install PHP 7.2.6

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  //按回车开始编译安装
.... ....
Install lnmp V1.5 completed! enjoy it   //  按Ctrl+C终止

安装后,lnmp 会默认启动。我们就可以使用浏览器访问的Web服务器了。首先查看自己的Ubuntu的服务器的IP地址。(例如:我的IP为:192.168.6.128,则在浏览器输入http://192.168.6.128 )会出现下界面:(不知道自己IP, 可用 ifconfig 查看自己虚拟机IP)

恭喜lnmp安装成功。

如果不能访问的话,要检查Linux系统的防火墙是否运行,可以使用ufw status命令查看:

sudo ufw status 

sudo ufw allow 80  //允许80端口

sudo ufw disable  //防火墙在系统启动时自动禁用

LNMP相关软件安装目录

Nginx目录:/ usr / local / nginx /
Nginx的日志目录:/家庭/ wwwlogs /
默认网站目录:0.9版本为/ home / wwwroot / 1.0及以后版本为/ home / wwwroot / default /
MySQL目录:/ usr / local / mysql /
MySQL的数据库所在目录:在/ usr /本地/ MySQL的在/ var /
MariaDB目录:/ usr / local / mariadb /
MariaDB的数据库所在目录:在/ usr /本地/ MariaDB的在/ var /
PHP目录:/ usr / local / php /
多PHP版本目录:/usr/local/php5.5/其他版本前面5.5的版本号换成其他即可
当前位置:替换。
/root/vhost.sh添加的虚拟主机配置文件所在目录:在/ usr /本地/ nginx的/ conf目录/虚拟主机/
LNMP相关配置文件位置
Nginx的主配置(默认虚拟主机)文件:/usr/local/nginx/conf/nginx.conf
添加的虚拟主机配置文件:在/ usr /本地/ nginx的/ conf目录/虚拟主机/域名的.conf
MySQL的配置文件:/etc/my.cnf中
PHP配置文件:/usr/local/php/etc/php.ini
PHP-FPM配置文件:/usr/local/php/etc/php-fpm.conf
如需要更改nginx,则:
sudo vim /usr/local/nginx/conf/nginx.conf   //nginx配置文档

4.安装配置Nextcloud

 cd /home/wwwroot/default/               //切换到LNMP的网络工作路径下
 
sudo wget https://download.nextcloud.com/server/releases/nextcloud-15.0.5.zip    
//从官方网站下载next cloud,因为是从外网下载可能会非常慢,可以让他自己下载,去休息一会儿
 sudo unzip nextcloud-15.0.5.zip  //下载完之后解压
sudo chown -R www.www *
 //Nginx的服务器是使用的WWW这个用户运行的,所以我们需要将所有的网页文件都更改所有者为万维网。

接下来我们可以使用地址http://IP/nextcloud/访问nextcloud目录并开始安装过程,其中mysql的根帐号密码是前面安装LNMP的过程中设置的密码,配置好后点击“安装完成”按钮即可开始安装。
安装完成之后,浏览器将会自动跳转出现下面Web服务器注明的404 Not Found错误.Nextcloud是完美支持apache的,如果使用Nginx的话可能会遇到一些状况,还有需要另外配置伪静态规则等。

  如果遇到安装后页面直接跳转404的话,可以通过修改nginx配置文件中的相应虚拟主机的配置,
  将“include enable-php.conf”改成“include enable-php-pathinfo.conf”,然后重启LNMP服务即可。
   
sudo service lnmp restart

这时浏览器上重新刷新或输入nextcloud的URL地(http://ip/nextcloud/ )即可通过访问自己的私有云盘了,当然我们也可以在Nextcloud的官方站点上下载Windows或手机客户端来同步或访问文件。

发布了16 篇原创文章 · 获赞 9 · 访问量 792

猜你喜欢

转载自blog.csdn.net/qq_44045338/article/details/97632837