Nextcloud是客户端服务器软件的开源套件,用于创建和使用文件托管服务。有很多方法可以 安装它,这是我使用Docker尽可能容易地安装和运行的方法。 

Create Your 云 VM with 码头工人 and 烤盘 安装ed

1  Install 云中的Ubuntu或CentOS。更新到最新。

将Ubuntu更新并升级到最新版本 

$ sudo apt-get -y update && sudo apt-get -y upgrade

2  Install Docker


对于CentOS:

sudo -i
yum -y update
curl -sSL //get.docker.com/ | sh
systemctl start docker.service
systemctl enable docker.service


For Ubuntu

sudo apt update
sudo apt upgrade
sudo apt install docker.io -y
sudo -i
systemctl start docker
systemctl enable docker
docker version

3  Install Portainer

docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
docker ps
Use your browser to access URL http://<public ip of your linuxserver>:9000
First time, it will ask you to set up admin user's password.


创建您的Nginx容器



Nginx正在使用网桥网络。重新启动策略也设置为始终。 

[email protected]:/etc/nginx/conf.d# apt-get update
[email protected]/etc/nginx/conf.d# apt-get install nano

烤盘 docker的Nginx配置。 

[email protected]:/etc/nginx/conf.d# cat portainer.conf 
server {
    listen       80;
    server_name  opc1portainer.51sec.org;

location / {
    proxy_pass       http://132.145.9.41:9000;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

创建您的NextCloud容器

1 创建NextCloud容器


2 将TCP 8080添加到您的云防火墙或安全组中

3 为您的nextcloud域URL添加DNS A记录

4  配置Nginx以使用您自己的域来访问NextCloud网站


[email protected]:/etc/nginx/conf.d# apt-get update
[email protected]/etc/nginx/conf.d# apt-get install nano
[email protected]:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[email protected]:/# cd etc
[email protected]:/etc# cd nginx
[email protected]:/etc/nginx# cd conf.d
[email protected]:/etc/nginx/conf.d# ls
default.conf  portainer.conf  nextcloud.conf
[email protected]:/etc/nginx/conf.d# cat nextcloud.conf 
server {
    listen       80;
    server_name  nextcloud.51sec.org;


location / {
    proxy_pass       http://132.145.9.4:8080;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
[email protected]:/etc/nginx/conf.d# 
5  Restart Nginx

Service Nginx Restart

更改NextCloud Config.php文件以添加信任域

1  Accessing 您通过自己的域的nextcloud将出现以下错误

2 更改config / config.php文件以添加新的信任域:nextcloud.51sec.org

config / config.php中的片段:
‘Trusted_domains’=>
数组(
0 => ‘localhost’,
1 => ‘50.60.100.101’,
2 =>‘nextcloud.51sec.org’,
),

Testing access successful now using my own domain //ift.tt/39aomm0. Here are some screenshots:

来自Blogger //blog.fabiandinkins.com/2020/11/easiest-way-to-deploy-your-own.html

通过 约翰

发表评论