Owncloud-X安装配置
系统是基于Centos7.2
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 #将selinux临时关闭,需要修改/etc/selinux/config,将SELINUX=enforcing修改为SELINUX=disabled 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 php70w -y
4.启动服务:
systemctl start httpd.service
systemctl start mariadb.service
systemctl enable httpd.service
systemctl enable mariadb.service
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 databases;
MariaDB> exit
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软件包:
rpm --import https://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key
wget http://download.owncloud.org/download/repositories/production/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
yum clean expire-cache
yum install owncloud-files #安装好后会在/var/www/html/owncloud生成网页文件
8.配置owncloud
http://你的ip地址/owncloud #打开
数据目录:填上你要放数据的目录 #创建目录要执行:chown -R apache:apache /创建的目录
数据库用户:owncloud
数据库密码:owncloud
数据库名: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