首页 > 代码库 > Owncloud安装配置

Owncloud安装配置

1.更改yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
2.更新
yum update
3.安装软件包
yum install -y httpd mariadb-server mariadb
yum install http://repo.webtatic.com/yum/el7/x86_64/RPMS/webtatic-release-7-3.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w-fpm php70w-cli php70w-json php70w-mcrypt php70w-pear php70w-mysql php70w-xml php70w-gd php70w-mbstring php70w-pdo php70w-dom
4.启动服务
systemctl start httpd.service
systemctl start mariadb.service
systemctl enable httpd.service
systemctl enable mariadb.service
chown -R apache.apache /var/www/html/owncloud/
5.配置数据库
mysql_secure_installation
MariaDB> create database owncloud;
MariaDB> CREATE USER ‘owncloud‘@‘localhost‘IDENTIFIED BY ‘owncloud‘;
MariaDB> grant all privileges on owncloud.* to ‘owncloud‘@localhost identified by ‘ownclound‘;
MariaDB> set password for ‘owncloud‘@‘localhost‘=password(‘owncloud‘);
MariaDB> flush privileges;
MariaDB> show database;
MariaDB> quit;
6.添加虚拟主机
vim /etc/httpd/conf.d/owncloud.conf
Alias /owncloud /var/www/html/owncloud
Options Indexes FollowSymLinks
<Directory /var/www/html/owncloud>
AllowOverride All
</Directory>
<Proxy *>
Order allow,deny
allow from all
</Proxy>
systemctl restart httpd.service
systemctl restart mariadb.service
7.配置owncloud
http://你的ip地址/owncloud

 

一、改变存储目录:
vi /var/www/html/owncloud/config/config.sample.php
将‘datadirectory‘ => ‘/var/www/owncloud/data‘更改为‘datadirectory‘ => ‘/media/disk/data‘
chown -R apache:apache /media/disk/data
chmod 777 /media/disk/data
在配置owncloud的界面把目录写进去


二、更改ownCloud的上传文件大小限制
vi /var/www/html/owncloud/.htaccess
修改以下几行:
php_value upload_max_filesize 10240M
php_value post_max_size 10240M
php_value memory_limit 10240M
vi /etc/php.ini
修改以下几行:
upload_max_filesize = 10240M
post_max_size = 10240M

systemctl restart httpd.service
systemctl restart mariadb.servic

Owncloud安装配置