环境
centos7 5.20.0
ip 10.99.1.35
selinux disabled
firewalld enable
1.为了保护设备安全,开启firewalld
systemctl enable firewalld && systemctl start firewalld && systemctl status firewalld
2.放行http服务
firewall-cmd --add-service http --permanent
firewall-cmd --add-service https --permanent
firewall-cmd --reload
3.查看本机是否安装apache,如果有就卸载,没有就新装
rpm -qa | grep httpd
yum -y install httpd mod_ssl
4.安装完,自启动apache
systemctl enable httpd && systemctl start httpd
5.安装php7.2
更新Php安装源及版本
yum install epel-release yum-utils -y
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum-config-manager --enable remi-php72
安装php及依赖包
yum install httpd php php-mysql php-intl sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl php-mcrypt php-pear -y
6.安装Mariadb数据库,并自启动
yum install mariadb-server mariadb -y
systemctl start mariadb.service && systemctl enable mariadb.service && systemctl status mariadb
数据库初始化,一路yyyyy
mysql_secure_installation
配置数据库,创建ownclound数据库,并赋予完全访问者权限
mysql -u root -p
#>create database owncloud_db;
#>grant all on owncloud_db.* to ‘dbuser’@‘localhost’ identified by ‘Owncloud@123#’;
#>FLUSH PRIVILEGES;
7.安装 owncloud
vim /etc/yum.repos.d/ownCloud.repo
[ce_10.1]
name=wnCloud Server Version 10.1.x (CentOS_7)
type=rpm-md
baseurl=http://download.owncloud.org/download/repositories/production/CentOS_7
gpgcheck=1
gpgkey=http://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key
enabled=1
列出存储库
yum repolist
运行clean命令以使yum知道更改
yum clean expire-cache
安装owncloud
yum install owncloud
安装成功,设置自启动
8.访问http://10.99.1.35/owncloud/index.php
owncloud客户端下载
https://owncloud.com/download-server/#install-clients
修改存储容量值/var/www/html/owncloud/.htaccess
借鉴于此文档https://www.marksei.com/how-to-install-nextcloud-17-server-on-centos-7/
安装nextcloud
在LAMP基础上,安装netcloud
1.在数据库中创建nextcloud数据库,并赋予数据库管理者权限
CREATE DATABASE nextcloud;
CREATE USER ‘ncuser’@‘localhost’ IDENTIFIED BY ‘netcloud#123’;
GRANT ALL PRIVILEGES ON nextcloud.* TO ‘ncuser’@‘localhost’;
FLUSH PRIVILEGES;
2.下载nextcloud包,并安装
cd/var/www/html
curl-o NextCloud-17-latest.tar.bz2 https://download.nextcloud.com/server/releases/latest-17.tar.bz2
yum -y install bzip2
tar-xvjf nextCloud-17-latest.tar.bz2
mkdir nextCloud/data
Chown-R Apache:Apache nextCloud
3.新建/etc/httpd/con.d/nextCloud.conf
vi /etc/httpd/con.d/nextCloud.conf
Alias /nextcloud "/var/www/html/nextcloud/"
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
4.将Php值修改大一些
sed -i ‘/^memory_limit =/s/=.*/= 512M/’ /etc/php.ini
5.安装完成,进入界面
http://10.99.1.35/nextcloud/index.php
6.启用缓存(加入不启用,会变得非常慢)
两种缓存方案
php opcache php内置得告诉缓存解决方案,加速脚本得执行。
redis 服务器 一个快速得内存键值存储,能加快netcloud所有内容。