服务端安装
很简单,官网下载服务端程序上传到网站空间,设置权限为可读写即可。
这里重点讲下nginx配置,支持http自动跳转到https,以下是相关配置代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
server { listen 80; listen 443 ssl http2; server_name youurl.com; charset utf-8; root /var/www/youurl.com/; index index.php index.htm index.html; keepalive_timeout 90; client_max_body_size 1024M; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; ssl_certificate /var/ssl/youurl.com/youurl.com.crt; ssl_certificate_key /var/ssl/youurl.com/youurl.com.key; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:5m; ssl_session_timeout 5m; gzip off; add_header Strict-Transport-Security 'max-age=15552000; includeSubDomains'; 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; if ($scheme = http) { return 301 https://$host$request_uri; } fastcgi_buffers 64 4K; location = /robots.txt { allow all; log_not_found off; access_log off; } location = /data/htaccesstest.txt { root /var/www/iyun.org/; } location = /.well-known/carddav { return 301 $scheme://$host/remote.php/dav; } location = /.well-known/caldav { return 301 $scheme://$host/remote.php/dav; } location / { rewrite ^ /index.php$uri; } location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { return 404; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; fastcgi_param modHeadersAvailable true; fastcgi_param front_controller_active true; fastcgi_read_timeout 600; fastcgi_intercept_errors on; fastcgi_request_buffering off; fastcgi_pass 127.0.0.1:9002; } location ~ ^/(?:updater|ocs-provider)(?:$|/) { try_files $uri $uri/ =404; index index.php; } location ~ \.(?:css|js)$ { try_files $uri /index.php$uri$is_args$args; add_header Cache-Control max-age=15778463; add_header Strict-Transport-Security 'max-age=15552000; includeSubDomains'; 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; access_log off; } location ~ \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg|map)$ { add_header Cache-Control 'public, max-age=7200'; try_files $uri /index.php$uri$is_args$args; access_log off; } location ~* \.(js|css|jpg|gif|png|ico|bmp|swf)$ { expires 30d; } } |
基本上按以上配置,修改路径和域名后可正常运行,并且不报文件头错误,架设正常后安装客户端即可使用。
下面是php.ini的几个配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
##修改以下几个配置参数 ; should be bit bigger than upload_max_filesize 16400M = 16G + 16M = 16 * 1025 MB post_max_size = 1024M ; cannot be bigger than post_max_size upload_max_filesize = 1G ; on online servers this could require bigger values (my server is at home) max_input_time = 3600 ; from ownCloud documentation - not sure if is required output_buffering = Off ; not sure if it is required [3] but it seems like ownCloud needs time to move the file to it's ; final place after upload and that can take quite some time for big files max_execution_time = 1800 ; you may also want to point this to a folder having enough space for big files being uploaded upload_tmp_dir = /tmp/owncloud |
常见问题
Q:修改存储目录后需要做什么设置?
A:1.修改Config.php里面的存储路径
2.修改数据库表中的用户存储路径
Q:修改了主题后报文件完整性检查错误?
A:删除或重命名/apps/example-theme/appinfo/signature.json文件
Q:修改了主题后邮件模版无法载入?
A:修改Config.php里面的主题名为当前主题文件夹名
Q:系统如何执行cron.php计划任务?
A:以www用户创建每隔15分钟的计划任务命令
1 |
/var/youphp/bin/php -f /var/www/youurl.com/cron.php |
客户端安装
官方服务端下载:https://owncloud.org/install/#edition
官方客户端下载:https://owncloud.org/install/#install-clients
自编译Android端下载:https://yun.shileiye.com/index.php/s/6cOvF8i00alBZkR
如有问题,留言相告。
转载请注明:追风逐雨 » centos+nginx安装ownCloud服务端及客户端下载