CentOS7完整配置LAMP搭建nextcloud

Step1: Install software

yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install httpd php70w php70w-dom php70w-mbstring php70w-gd php70w-pdo php70w-json php70w-xml php70w-zip php70w-curl php70w-mcrypt php70w-pear setroubleshoot-server bzip2
 
Step 2: Database selection

yum install mariadb-server php70w-mysql
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
#接下来按喜好进行一系列的设置
#设置完毕后登录
$ mysql -u root -p
 
#现在创建一个数据库
CREATE DATABASE nextcloud;
 
#创建这个数据库的链接用户
#CREATE USER ‘nc_user’@’localhost’ IDENTIFIED BY ‘YOUR_PASSWORD_HERE’;
CREATE USER ‘cloud’@’%’ IDENTIFIED BY ‘mez@199023’;
 
#设置这个数据库的访问权限
#GRANT ALL PRIVILEGES ON nextcloud.* TO ‘nc_user’@’localhost’;
GRANT ALL PRIVILEGES ON nextcloud.* TO ‘cloud’@’%’;
FLUSH PRIVILEGES;
 
完成后Ctrl-D to exit
 
Step 3: Install NextCloud

#通过以下步骤去下载Nextcloud并且部署他们
cd /var/www/html
#curl -o nextcloud-12-latest.tar.bz2 https://download.nextcloud.com/server/releases/latest-12.tar.bz2
curl -o nextcloud-13-latest.tar.bz2 https://download.nextcloud.com/server/releases/latest-13.tar.bz2
tar -xvjf nextcloud-13-latest.tar.bz2
mkdir nextcloud/data
chown -R apache:apache nextcloud
rm nextcloud-13-latest.tar.bz2
 
接下来需要创建配置文件
/etc/httpd/conf.d/nextcloud.conf
 
Step 4: Setting Apache and SELinux

如果正在使用Mariadb/MySQL/PostgreSQL数据库,则需要让apache去允许使用:
setsebool -P httpd_can_network_connect_db 1
 
systemctl start httpd
systemctl enable httpd
 
确保下面文件中的selinux为disable
#/etc/sysconfig/selinux
SELINUX=disabled
 
Step 5: Configuring firewall

如果没有关闭防火墙,则执行如下几步:
firewall-cmd –add-service http –permanent
firewall-cmd –add-service https –permanent
firewall-cmd –reload
 
 
Step 6: Install

开始访问浏览器去安装nextcloud吧
http://xxxx.com/nextcloud


评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据