財神娛樂首存即享優惠回饋唷~詳情請進👉

CeSlot 教學ntOS6.5下使用lnmp架構裝置nextcloud云盤

《CentOS6.5下使用lnmp架構裝置nextcloud云盤》要點:
本文先容了CentOS6.5下使用lnmp架構裝置nextcloud云盤,但愿對您有效。若是有疑難,可以接洽咱們。

周福金 云手藝社區專家,青鳥卒業.來到上海.干過網管,現在從事運維兩年,在一家互聯網公司事情,喜歡開源手藝.但愿能以及人人一路交流.

作者博客,http://thedream.blog.51cto.com/6427769/1940531

近來兩年跟著各大網盤紛紛封閉,百度云也早早的就最先限速,文件的寧靜也沒有保證.以是還不如本人搭建一個網盤.網上望了下,發明有一個nextcloud比較好用.支撐多平臺客戶端,支撐分享,使用操作簡略.支撐插件擴大,文件預覽,在線協作.

1.裝置nginx

wget http://nginx.org/download/nginx-1.10.3.tar.gz

tar -zxf nginx-1.10.3.tar.gz && cd nginx-1.10.3

./configure –prefix=/usr/local/data/nginx –user=nginx –group=nginx –with-pcre –with-http_stub_status_module –with-http_ssl_module –with-http_gzip_static_module

make && make install

2.裝置設置php

yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

yum –e電競運彩下注nablerepo=rem六合彩規則i-php56 install php php-fpm php-mysql php-gd php-xml php-redis php-libs php-de六合彩結果號碼vel php-zlib php-mbstring

nginx 以及php-fpm 的運轉用戶這里使用nginx

vim /etc/php-fpm.conf

user = nginx

group = nginx

listen = 127.0.0.1:9000

env[HOSTNAME] = $HOSTNAME

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp

3.裝置mysql

yum -y install 改善偏財運mysql mysql-server

service mysqld start

4.建庫,受權

CREATE DATABASE nextcloud_db;
GRANT ALL ON nextcloud_db.* TO ‘nextcloud’@’%’ IDENTIFIED BY ‘nextcloud’; //注重肯定要加 “%”,不然沒法讓收集讓任何人上傳文件

FLUSH PRIVILEGES;

5.裝置nextcloud

wget https://download.nextcloud.com/server/releases/nextcloud-10.0.2.zip –no-check-certificate

unzip nextcloud-10.0.2.zip

mv nextcloud /usr/local/data/nginx/html

/usr/local/data/nginx/html

chown -R nginx.nginx

創立數據目次,這里倡議數據目次不要以及web目次放到一路

/usr/local/data/nginx/html/nextcloud/data

6.申請證書

為了網盤的寧靜,有需要使用https 證書,這里可以在阿里云后臺申請收費的DV證書

7.設置nginx

創立虛構主機文件

cd /usr/local/data/nginx/conf

vim nextcloud.conf

upstream php-handler {

server 127.0.0.1:9000;

}

server {
listen 80;

server_name cloud.nextcloud.com;

return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name cloud.nextcloud.com;

ssl_certificate /usr/local/data/nginx/conf/nextcloud.crt;

ssl_certificate_key /usr/local/data/nginx/conf/nextcloud.key;

#增添以下header首要為了寧靜

add_header Strict-Transport-Security “max-age=15768000;
includeSubDomains; preload;”;
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;

#nextcloud代碼目次

root /usr/local/data/nginx/html/nextcloud/;

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

#為了支撐user_webfinger 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;
}

#配置上傳文件的最大巨細,php也得點竄

client_max_body_size 512M;
fastcgi_buffers 64 4K;

# Disable gzip to avoid the 六合彩即時removal of the ETag header
gzip off;

error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;

#緊張的:將一切哀求轉發到index.php上

location / {
rewrite ^ /index.php$uri;

}

#寧靜配置,禁止走訪部門敏感內容

【免責聲明】本站內容轉載自互聯網,其相關談吐僅代表作者小我私家概念盡非權勢巨子,不代表本站態度。如您發明內容存在版權成績,請提交相關鏈接至郵箱:,咱們將實時予以處置。