owncloud
1.准备工作
1.1 配置YUM源
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/C* /media/
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
yum repolist
yum -y install gcc gcc-c++ unzip vim net-tools
1.2 HTTP安装
yum -y install httpd
systemctl start httpd
systemctl enable httpd //开机自启
vi /etc/httpd/conf/httpd.conf //配置PHP
搜索DirectoryIndex index.html
编辑成:
再搜索AllowOverride none
编辑成:
systemctl restart httpd
1.3 压缩包准备
准备10.9.1的owncloud包,使用wget或者网页上直接下都行,搭配php7.4.30
1.4 注意一定要注意包和php的兼容
下载地址https://download.owncloud.com/server/stable/
(1)wget https://download.owncloud.com/server/stable/owncloud-10.9.1.tar.bz2
tar -jxf owncloud-10.9.1.tar.bz2
mv owncloud/* /var/www/html/ //网页默认存放目录
chmod 777 /var/www/html/ //给网页文件权限
mkdir data//存放网页数据,放在主目录
出现以下问题
[root@localhost ~]# wget https://download.owncloud.com/server/stable/owncloud-10.9.1.tar.bz2
-bash: wget: 未找到命令
使用yum命令安装wget
[root@localhost ~]# yum -y install wget
如解压时出现以下情况
[root@localhost ~]# tar -jxf owncloud-10.9.1.tar.bz2
tar (child): bzip2:无法 exec: 没有那个文件或目录
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
使用yum命令安装bzip2
[root@localhost ~]# yum -y install bzip2
1.5 关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
1.6 安装Mariadb安装
yum -y install mariadb-server
systemctl start mariadb
systemctl enable mariadb
1.7 初始化数据库
mysql_secure_installation
1.8 PHP7.4安装
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi install php74-php
yum --enablerepo=remi install php74-php php74-php-gd php74-php-xml php74-php-sockets php74-php-session php74-php-snmp php74-php-mysql php74-php-zip php74-php-intl php74-php-mbstring
php74 -v
1.9 配置数据库
[root@localhost owncloud]# mysql -uroot -p123456
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# 创建数据库
MariaDB [(none)]> create database owncloud;
Query OK, 1 row affected (0.00 sec)
# 创建用户 用户名 owncloud_user 密码 qwe`123
MariaDB [(none)]> grant all on owncloud.* to owncloud_user@192.168.237.130 identified by '123456';
Query OK, 0 rows affected (0.00 sec)
# 刷新权限表
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
2. 启动OwnCloud
在浏览器里访问192.168.237.130/owncloud/index.php //地址和本人的地址不一样