本次将在 Debian 9 上部署LNMP环境搭建 Owncloud 私有云, debian系列linux发行版可使用此教程命令(如kali、ubuntu) redhat系列参考 yum
owncloud云盘试用 链接:https://tools.freeerror.org 账户:
deb http://mirrors.163.com/debian/ stretch main non-free contrib deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.163.com/debian/ stretch main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
apt-get install php7.0-curl php7.0-imap php7.0-xml php7.0-gd php7.0-common php7.0-mbstring php7.0-fpm php7.0-mysql mysql-server nginx
wget https://download.owncloud.org/community/owncloud-10.1.0.zip
upstream php-handler { server 127.0.0.1:9000; } server { listen 443 ssl http2; server_name pan.zhzy.pro; root /var/owncloud; client_max_body_size 10G; fastcgi_buffers 64 4K; ssl_certificate "/etc/nginx/chain/tools/full_chain.pem"; # 你的ssl密钥路径 ssl_certificate_key "/etc/nginx/chain/tools/private.key"; # 你的ssl密钥路径 gzip off; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; index index.php; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){ deny all; } location / { rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ /index.php; } location ~ \.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_pass php-handler; } location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; access_log off; } }
upstream php-handler { server 127.0.0.1:9000; } server { listen 80; server_name pan.zhzy.pro; root /var/owncloud; client_max_body_size 10G; fastcgi_buffers 64 4K; gzip off; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; index index.php; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){ deny all; } location / { rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ /index.php; } location ~ \.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_pass php-handler; } location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; access_log off; } }
service nginx start
在上述的nginx服务中我们通过127.0.0.1:9000调用php服务,所以我们需要指定php使用127.0.0.1:9000
vim /etc/php/7.3/fpm/pool.d/www.conf
user = www-data group = www-data listen = 127.0.0.1:9000
最后开启服务
service php7.3-fpm restart
MySQL [(none)]> create database pandb; Query OK, 1 row affected (0.00 sec)
MySQL [(none)]> grant all privileges on pandb.* to 'runpan'@'localhost' identified by 'zhzy@pan'; Query OK, 0 rows affected, 1 warning (0.00 sec)
tar -jxf owncloud-10.0.10.tar.bz2 -C /var/
cd /var/
chown www-data:www-data -R owncloud
123313
追风少年
嘿嘿,在测试一些功能~
哇
膜拜
好东西,学习一下
看看
2333到还没写完呢,这就是隐藏内容的魅力吗?
2333
这是在催我快点写嘛??
来充实充实
年内够呛啦
欸嘿嘿,正好过来参观一下
参观参观 o.o~
我个人认为回复应该限制字数,比如像我一样包括标点符号刚好32个。
瞧一瞧