Centos7 官方安装方法(略有修改),nextcloud-20.0.1版本亲测
- 执行第一个脚本文件,文件内容如下
#!/bin/bash
systemctl stop firewalld;systemctl disable firewalld;setenforce 0;sed -i '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2
yum update -y
yum install -y httpd
cat > /etc/httpd/conf.d/nextcloud.conf << EOF
<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerName your.server.com
<Directory "/var/www/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
EOF
systemctl enable httpd.service
systemctl start httpd.service
yum install -y centos-release-scl
yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis rh-php72-php-opcache rh-php72-php-imagick
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
##安装数据库
yum install -y mariadb mariadb-server
systemctl enable mariadb.service
systemctl start mariadb.service
- 设置数据库
- 进入数据库,输入密码,默认没有密码.直接回车,设置密码的地址换成自己的
sudo mysql -u root -p
CREATE DATABASE nextcloud;
create user nextcloud@localhost identified by '改成自己的密码';
grant all on *.* to 'nextcloud'@'localhost' identified by '上面设置的密码' with grant option;
FLUSH PRIVILEGES;
EXIT
- 执行第二个脚本,脚本内容(官网下载zip文件,放到/root下,也可以修改脚本里的安装包路径)
#!/bin/bash
systemctl restart mariadb.service
unzip /root/nextcloud-20.0.1.zip -d /var/www/html
mkdir /var/www/html/nextcloud/data
chown -R apache:apache /var/www/html/nextcloud
systemctl restart httpd.service
- Web设置安装
- 打开web页面.http://安装这台电脑的IP地址/nextcloud
- 设置自己的用户名,密码;设置数据库需要点开,选择MySQL/MariaDB.
- 数据库:nextcloud
- 用户名:nextcloud
- 密码:上面设置的密码
- 安装推荐的应用的勾去掉,国内的网可能安装不上.
- 点击安装
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)