owncloud9 php版本,Ubuntu16.04 ownCloud 9.0 安装日记

大致参考

https://doc.owncloud.org/server/9.0/admin_manual/installation/source_installation.html#ubuntu-

installation-label

国内可能安装 libapache2-mod-php5 出错

E: Package 'libapache2-mod-php5' has no installation candidate

编辑 /etc/apt/sources.list 加上

deb http://ftp.es.debian.org/debian stable main contrib non-free

deb-src http://ftp.es.debian.org/debian stable main contrib non-free

deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free

deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free

deb-src http://security.debian.org/ wheezy/updates main contrib non-free

再运行 sudo apt-get update

----------

安装 mysql

安装中设置mysql的root账号和密码

sudo apt-get install mysql-server

----------

安装 php

安装官方文档给出的3行命令安装 php5 等组件

apt-get install apache2 mariadb-server libapache2-mod-php5

apt-get install php5-gd php5-json php5-mysql php5-curl

apt-get install php5-intl php5-mcrypt php5-imagick

----------

下载最新版 ownCloud.

(wget http://owncloud.org/releases/owncloud-x.y.z.tar.bz2)

----------

验证 MD5/SHA256 省略

----------

解压 tar -xjf owncloud-x.y.z.tar.bz2

----------

复制 ownCloud 目录到你的站点中

cp -r owncloud /var/www

chown -R www-data:www-data /var/www (修改目录用户权限)

----------

官方给出的是配置 ownCloud 为一个子目录

如果作为网站根目录,参考以前的文档,,我是这么做的

直接编辑 /etc/apache2/sites-enabled/000-default.conf

修改 DocumentRoot /var/www/owncloud

后面加上

Options FollowSymLinks

AllowOverride All

Order deny,allow

Allow from all

Satisfy Any

Options FollowSymlinks

AllowOverride All

3ad4fcfe5fb693193c9400cd7546a970.png

----------

启用 url 重写

ra2enmod rewrite (禁用 ra2dismod rewrite)

注意,如果网站设为根目录,还需修改 /var/www/owncloud/.htaccess

将 RewriteBase /ownCloud 修改为 RewriteBase /

dacf86161b7b87353cc299e8a5ed5ce8.png

Url 重写未生效

检查 .htaccess 末尾是否有

ErrorDocument 403 /owncloud/core/templates/403.php

ErrorDocument 404 /owncloud/core/templates/404.php

RewriteRule . index.php [PT,E=PATH_INFO:$1]

RewriteBase /owncloud

SetEnv front_controller_active true

DirectorySlash off

----------

其它推荐模块

a2enmod headers

a2enmod env

a2enmod dir

a2enmod mime

----------

设置数据目录权限

默认目录 /var/www/owncloud/, 可以自行选择其它目录,如 /home/data

然后设置权限 chown -R www-data:www-data /home/data/

----------

重启 Apache

service apache2 restart

----------

打开网站进行第一次登录并配置

如果打开网站出现如下错误

Can't write into config directory!

This can usually be fixed by giving the webserver write access to the config directory.

点击页面中链接,使用官方提供的脚本执行解决,建立脚本后授权运行 chmod 700 Fixright.sh

f5974f9359a21308d01bd37caf59e830.png

----------

修改上传大小

通过Web管理页面即可修改, 如果是灰色说明.htaccess写入权限不够, 但最大只能设置为 2G

如果需要上传更大 修改 /var/www/owncloud/.htaccess

修改完 service apache2 restart

325e131e225544637abf9fa229ce885e.png

----------

WebDav 访问

只能用支持 WebDav 的客户端访问 ownCloud

地址

http://ip:port/ownCloud/remote.php/webdav/

----------

其它操作

● 扫描未通过ownCloud上传的文件,如手动拷贝文件到数据目录中

sudo -u www-data php occ files:scan --all

Footer

共享页面: owncloud/apps/files_sharing/templates/public.php

登录页面: owncloud/core/templates/layout.guest.php

logo-icon

共享页面: owncloud/apps/files_sharing/templates/public.php

页面: owncloud/core/templates/layout.user.php

Title

owncloud/core/templates/layout.base.php

owncloud/core/templates/layout.guest.php

owncloud/core/templates/layout.user.php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值