screenshot
to update
install
#CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker
#Pull the MySQL image and remember to modify the database information docker run --name mysqlnc -d \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=moerats \ -e MYSQL_DATABASE=moerats \ -e MYSQL_USER=moerats \ -e MYSQL_PASSWORD=moerats \ -v /root/nextcloud/mysql:/var/lib/mysql \ mysql:5.7 #Pull the Nextcloud image docker run -d --name nextcloud --link mysqlnc \ -v /root/nextcloud/data:/data \ -p 3000:80 \ rootlogin/nextcloud
#CentOS 6 iptables -I INPUT -p tcp --dport 3000 -j ACCEPT service iptables save service iptables restart #CentOS 7 firewall-cmd --zone=public --add-port=3000/tcp --permanent firewall-cmd --reload
Domain name access
wget -N --no-check-certificate https://raw.githubusercontent.com/iiiiiii1/doubi/master/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh #Alternate address wget -N --no-check-certificate https://www.moerats.com/usr/shell/Caddy/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh
#The following is a whole. Please modify the domain name and copy it to SSH to run! #Http access. This configuration does not automatically issue SSL echo "xx.com { gzip proxy / 127.0.0.1:3000 { header_upstream Host {host} header_upstream X-Real-IP {remote} header_upstream X-Forwarded-For {remote} header_upstream X-Forwarded-Port {server_port} header_upstream X-Forwarded-Proto {scheme} } }" > /usr/local/caddy/Caddyfile #Https access. This configuration will automatically issue SSL. Please resolve the domain name to the VPS server in advance echo "xx.com { gzip tls admin@moerats.com proxy / 127.0.0.1:3000 { header_upstream Host {host} header_upstream X-Real-IP {remote} header_upstream X-Forwarded-For {remote} header_upstream X-Forwarded-Port {server_port} header_upstream X-Forwarded-Proto {scheme} } }" > /usr/local/caddy/Caddyfile
/etc/init.d/caddy start
#Add in configuration file location / { proxy_pass http://127.0.0.1:3000 ; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }