IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> CentOS 7.9 安装 NextCloud -> 正文阅读

[系统运维]CentOS 7.9 安装 NextCloud

一.

vim /etc/selinux/config

配置如下:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# ? ? enforcing - SELinux security policy is enforced.
# ? ? permissive - SELinux prints warnings instead of enforcing.
# ? ? disabled - No SELinux policy is loaded.
# 如果SELinux处于启动状态,一般状态为enforing。致使很多服务端口默认是关闭的
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# ? ? targeted - Targeted processes are protected,
# ? ? minimum - Modification of targeted policy. Only selected processes are protected.
# ? ? mls - Multi Level Security protection.
SELINUXTYPE=targeted


二.

yum -y install httpd httpd-tools

日志如下:

Running transaction
? Installing : apr-1.4.8-7.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1/5
? Installing : apr-util-1.5.2-6.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2/5
? Installing : httpd-tools-2.4.6-97.el7.centos.5.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3/5
? Installing : mailcap-2.1.41-2.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4/5
? Installing : httpd-2.4.6-97.el7.centos.5.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5/5
? Verifying ?: apr-1.4.8-7.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1/5
? Verifying ?: mailcap-2.1.41-2.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2/5
? Verifying ?: httpd-tools-2.4.6-97.el7.centos.5.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3/5
? Verifying ?: apr-util-1.5.2-6.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4/5
? Verifying ?: httpd-2.4.6-97.el7.centos.5.x86_64 ?

Installed:
? httpd.x86_64 0:2.4.6-97.el7.centos.5 ? ? ? ? ? ? ? ? ? ? ? ? httpd-tools.x86_64 0:2.4.6-97.el7.centos.5

systemctl start httpd
httpd.service - The Apache HTTP Server
? ?Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
? ?Active: inactive (dead)
? ? ?Docs: man:httpd(8)
? ? ? ? ? ?man:apachectl(8)

? ? ? ? ??
查询状态
出现如下错误

Failed to start htppd.service: Unit not found.

先试用如下命令查询

systemctl list-unit-files --type=service

如果有 httpd 服务 使用?systemctl daemon-reload ,在yum install 安装的时候没有安装完全使用完之后在启动依然会出现
Job for httpd.service failed. See "systemctl status httpd.service" and "journalctl -xe" for details.
查询httpd的状态

?httpd.service - The Apache HTTP Server
? ?Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
? ?Active: failed (Result: protocol) since Wed 2022-04-20 19:48:46 CST; 43s ago
? ? ?Docs: man:httpd(8)
? ? ? ? ? ?man:apachectl(8)
? Process: 5884 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=0/SUCCESS)
?Main PID: 5884 (code=exited, status=0/SUCCESS)
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: Starting The Apache HTTP Server...
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z httpd[5884]: AH00558: httpd: Could not reliably determine the server's fully quali...ssage
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z httpd[5884]: httpd (pid 5830) already running
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: Failed to start The Apache HTTP Server.
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: Unit httpd.service entered failed state.
Apr 20 19:48:46 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

使用最笨的方法 用

ps -aux | grep httpd?

kill -9 杀httpd的进程

然后?

systemctl start httpd

在查询 httpd的状态

systemctl status httpd

日志如下:

httpd.service - The Apache HTTP Server
? ?Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
? ?Active: active (running) since Wed 2022-04-20 19:51:18 CST; 14s ago
? ? ?Docs: man:httpd(8)
? ? ? ? ? ?man:apachectl(8)
?Main PID: 5926 (httpd)
? ?Status: "Total requests: 0; Current requests/sec: 0; Current traffic: ? 0 B/sec"
? ? Tasks: 6
? ?Memory: 2.9M
? ?CGroup: /system.slice/httpd.service
? ? ? ? ? ?├─5926 /usr/sbin/httpd -DFOREGROUND
? ? ? ? ? ?├─5927 /usr/sbin/httpd -DFOREGROUND
? ? ? ? ? ?├─5928 /usr/sbin/httpd -DFOREGROUND
? ? ? ? ? ?├─5929 /usr/sbin/httpd -DFOREGROUND
? ? ? ? ? ?├─5930 /usr/sbin/httpd -DFOREGROUND
? ? ? ? ? ?└─5931 /usr/sbin/httpd -DFOREGROUND
Apr 20 19:51:18 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: Starting The Apache HTTP Server...
Apr 20 19:51:18 iZ2ze0t8eea7sr5m24u4x5Z httpd[5926]: AH00558: httpd: Could not reliably determine the server's fully quali...ssage
Apr 20 19:51:18 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

开启系统启动项然后查询状态:

systemctl enable htppd

systemctl status httpd


第三步:安装配置 Mariadb 服务

yum install mariadb-server mariadb -y

安装日志如下:

Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
? Installing : perl-Data-Dumper-2.145-3.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1/10
? Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2/10
? Installing : 1:mariadb-5.5.68-1.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3/10
? Installing : perl-Net-Daemon-0.48-5.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 4/10
? Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?5/10
? Installing : perl-IO-Compress-2.061-2.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 6/10
? Installing : perl-PlRPC-0.2020-14.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 7/10
? Installing : perl-DBI-1.627-4.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 8/10
? Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 9/10
? Installing : 1:mariadb-server-5.5.68-1.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 10/10
? Verifying ?: perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1/10
? Verifying ?: perl-Net-Daemon-0.48-5.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2/10
? Verifying ?: perl-Data-Dumper-2.145-3.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3/10
? Verifying ?: 1:mariadb-server-5.5.68-1.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4/10
? Verifying ?: perl-DBD-MySQL-4.023-6.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5/10
? Verifying ?: 1:mariadb-5.5.68-1.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 6/10
? Verifying ?: 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 7/10
? Verifying ?: perl-DBI-1.627-4.el7.x86_64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 8/10
? Verifying ?: perl-IO-Compress-2.061-2.el7.noarch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 9/10
? Verifying ?: perl-PlRPC-0.2020-14.el7.noarch ? ?
??
??
Installed:
? mariadb-server.x86_64 1:5.5.68-1.el7
Dependency Installed:
? mariadb.x86_64 1:5.5.68-1.el7 ? ? ? ? perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
? perl-DBD-MySQL.x86_64 0:4.023-6.el7 ? perl-DBI.x86_64 0:1.627-4.el7 ? ? ? ? ? ? ? ?perl-Data-Dumper.x86_64 0:2.145-3.el7
? perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 ? ? ? ? ?perl-PlRPC.noarch 0:0.2020-14.el7

安装10个,1个服务9个依赖,和上面对一下全部成功。

安装完成?Mariadb 服务之后加入系统启动项

systemctl start mariadb

systemctl enable mariadb


查询 Mariadb 运行状态

systemctl status mariadb

出现如下日志说明状态正常:Active: active (running)

Active: active 已激活状态
● mariadb.service - MariaDB database server
? ?Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
? ?Active: active (running) since Wed 2022-04-20 20:03:33 CST; 37s ago
?Main PID: 6089 (mysqld_safe)
? ?CGroup: /system.slice/mariadb.service
? ? ? ? ? ?├─6089 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
? ? ? ? ? ?└─6254 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=...
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: MySQL manual for more instructions.
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: Please report any problems at http://mariadb.org/jira
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: The latest information about MariaDB is available at h...g/.
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: You can find additional information about the MySQL part at:
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: http://dev.mysql.com
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: Consider joining MariaDB's strong and vibrant community:
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mariadb-prepare-db-dir[6005]: https://mariadb.org/get-involved/
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mysqld_safe[6089]: 220420 20:03:31 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Apr 20 20:03:31 iZ2ze0t8eea7sr5m24u4x5Z mysqld_safe[6089]: 220420 20:03:31 mysqld_safe Starting mysqld daemon with databas...mysql
Apr 20 20:03:33 iZ2ze0t8eea7sr5m24u4x5Z systemd[1]


MySQL安全配置向导:

mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
? ? ? SERVERS IN PRODUCTION USE! ?PLEASE READ EACH STEP CAREFULLY!
? ? ??In order to log into MariaDB to secure it, we'll need the current
password for the root user. ?If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

上面巴拉巴拉说一堆就看那个 NOTE 就可以,意思是 MariaDB使用msi安全向导,下面的配置步骤要仔细

(1)Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

设置MySQL的用户名和密码,记住了,后面控制台登录要用,选择 Y

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
?... Success!
?
(2)By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. ?This is intended only for testing, and to make the installation
go a bit smoother. ?You should remove them before moving into a
production environment.

MariaDB安装有一个匿名用户,允许任何人使用,选N可以自己创建一个,y就是使用这个匿名用户,我的服务器块到期了我选择的Y,正常使用建议选择 N

Remove anonymous users? [Y/n] y
?... Success!
?
(3)Normally, root should only be allowed to connect from 'localhost'. ?This
ensures that someone cannot guess at the root password from the network.

是设置用户是否从localhost链接

Disallow root login remotely? [Y/n] y
?... Success!
?
(4)By default, MariaDB comes with a database named 'test' that anyone can
access. ?This is also intended only for testing, and should be removed
before moving into a production environment.

就是让你是否删除?MariaDB 的测试数据库,我选择的Y留着占内存,删了省心

Remove test database and access to it? [Y/n] y
?- Dropping test database...
?... Success!
?- Removing privileges on test database...
?... Success!
?
(5)Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

让你重新加载配置,加载完之后就即可生效了,这个要选择 y
Reload privilege tables now? [Y/n] y
?... Success!
?
Cleaning up... #删除NextCloud 的test数据库

All done! ?If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!


第四步:安装 PHP 模块并配置 NextCloud

yum install php php-common php-mysqlnd php-curl php-zip php-bz2 php-intl php-mbstring php-gd php-pecl-zip php-xml php-json unzip wget -y

安装完成校对(这个校队可以忽略):
Running transaction 安装数目 = Installed + Dependency Installed 总共已经安装数目之和就对了,有的Linux版会直接归为installed = Installed + Dependency Installed


第五步:创建?NextCloud 的 Databases?

mysql -uusername -ppassword

(1)创建 NextCloud 数据库

create database nextclouddb;

(2)创建一个新用户?

create user nextclouddevil@localhost identified by?? ?'password';

(3)在nextclouddb这个数据库上,给 nextclouddevil 这个用户所有权限

grant all on nextclouddb.* to nextclouddevil@localhost;

(4)刷新配置

flush privileges;

(5)退出

exit

第六步。下载并安装nextcloud,移动到 /var/www/html/ ?这个目录

cd /var/www/html/

(1)在浏览器上输入 https://nextcloud.com,找到nextcloud下载页面,下载 nextcloud 的 server 版本,鼠标对准下载按钮复制下载链接,然后通过wget httpurl下载到 /var/www/html这个目录下面
通过 unzip 解压

(2)在 /var/www/html/nextcloud 文件夹下面,创建一个 data 文件夹 ,

mkdir /var/www/html/nextcloud/data

(3)改变nextcloud这个文件夹的授权

chown -R apache:apache nextcloud

chmod -R 755 nextcloud

(4)改变收权之后 通过ls查看可以看到nextclou这个服务在apache下

drwxr-xr-x 15 apache apache ? ? 4096 Apr 20 20:36 nextcloud

(5)重启并查看httpd的状态

systemctl restart httpd

systemctl status httpd

(6)配置并重启防火墙

firewall-cmd --permanent --add-service=http

firewall-cmd --reload

(7)浏览器 输入你的nextcloud地址,格式如下:

http://your-Ip-server/nextcloud

(8)安装完才写的教程, 它妈的没截图,将就看吧。

(a)创建用户名密码

storage & database

Data folder/数据目录不需要动

(b)配数据库选择
MySQL/Mariadb
然后输入你在终端创建的数据库 账户和密码

最后点击安装完成,到这就完成nextcloud的安装了。

第七部:安装完成之后可能会遇到上传大小限制 和 NextCloud 服务的私有化配置

(1)下面 是NextCloud的官方文档

big_file_upload_configuration

在?php.ini 文件中设置以下两个参数

php_value upload_max_filesize ?16 G?
php_value ?post_max_size ?16 G

(2)配置?Nextcloud 服务器文件位置:
Nextcloud 带有自己的nextcloud/.htaccess文件。因为php-fpm 无法读取 PHP 设置,.htaccess这些设置必须在 nextcloud/.user.ini文件中设置。

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-05-13 12:00:08  更:2022-05-13 12:01:07 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年10日历 -2024/10/5 7:39:11-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码