如何使用Fedora31和Nextcloud服务器构建自己的云

这篇文章给大家分享的是有关如何使用Fedora 31和Nextcloud服务器构建自己的云的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

10年积累的成都网站制作、成都做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有盐津免费网站建设让你可以放心的选择与我们合作。

步骤 1:预先安装条件

在安装和配置 Nextcloud 之前,必须满足一些预先条件。

首先,安装 Apache Web 服务器:

# dnf install httpd

接下来,安装 PHP 和一些其他模块。确保所安装的 PHP 版本符合 Nextcloud 的要求:

# dnf install php php-gd php-mbstring php-intl php-pecl-apcu php-MySQLnd php-pecl-redis php-opcache php-imagick php-zip php-process

安装 PHP 后,启用并启动 Apache Web 服务器:

# systemctl enable --now httpd

接下来,允许 HTTP 流量穿过防火墙:

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

接下来,安装 MariaDB 服务器和客户端:

# dnf install mariadb mariadb-server

然后启用并启动 MariaDB 服务器

# systemctl enable --now mariadb

现在,MariaDB 正在运行,你可以运行 mysql_secure_installation 命令来保护它:

# 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 thecurrent password for the root user.  If you've just installedMariaDB, and you haven't set the root password yet, the passwordwill be blank, so you should just press enter here. Enter current password for root (enter for none): <ENTER>OK, successfully used password, moving on... Setting the root password ensures that nobody can log intothe MariaDB root user without the proper authorization. Set root password? [Y/n] <ENTER>New password: Your_Password_HereRe-enter new password: Your_Password_Here Password updated successfully! Reloading privilege tables... ... Success! By default, a MariaDB installation has an anonymous user,allowing anyone to log into MariaDB without having to havea user account created for them.  This is intended only fortesting, and to make the installation go a bit smoother.  Youshould remove them before moving into a production environment. Remove anonymous users? [Y/n] <ENTER> ... Success! Normally, root should only be allowed to connect from'localhost'.  This ensures that someone cannot guess at theroot password from the network. Disallow root login remotely? [Y/n] <ENTER> ... Success! By default, MariaDB comes with a database named 'test' thatanyone can access.  This is also intended only for testing, andshould be removed before moving into a production environment. Remove test database and access to it? [Y/n] <ENTER>  - Dropping test database... ... Success!  - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changesmade so far will take effect immediately. Reload privilege tables now? [Y/n] <ENTER> ... Success! Cleaning up... All done!  If you've completed all of the above steps, yourMariaDB installation should now be secure. Thanks for using MariaDB!

接下来,为你的 Nextcloud 实例创建独立的用户和数据库:

# mysql -p> create database nextcloud;> create user 'nc_admin'@'localhost' identified by 'SeCrEt';> grant all privileges on nextcloud.* to 'nc_admin'@'localhost';> flush privileges;> exit;

步骤 2:安装 Nextcloud 服务器

现在,你已满足 Nextcloud 安装的预先条件,请下载并解压 Nextcloud 压缩包:

# wget https://download.nextcloud.com/server/releases/nextcloud-17.0.2.zip# unzip nextcloud-17.0.2.zip -d /var/www/html/

接下来,创建一个数据文件夹,并授予 Apache 对 nextcloud 目录树的读写访问权限:

# mkdir /var/www/html/nextcloud/data# chown -R apache:apache /var/www/html/nextcloud

SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:Nextcloud SELinux 配置。

# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?'# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?'# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?'# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'# restorecon -Rv '/var/www/html/nextcloud/'

步骤 3:配置 Nextcloud

可以使用它的 Web 界面或在命令行配置 Nextcloud。

使用 Web 界面

在你喜欢的浏览器中,访问 http://your_server_ip/nextcloud 并输入字段:

如何使用Fedora 31和Nextcloud服务器构建自己的云

使用命令行

在命令行中,只需输入以下内容,使用你之前在 MariaDB 中创建的独立 Nextcloud 用户替换相应的值:

# sudo -u apache php occ maintenance:install --data-dir /var/www/html/nextcloud/data/ --database "mysql" --database-name "nextcloud" --database-user "nc_admin" --database-pass "DB_SeCuRe_PaSsWoRd" --admin-user "admin" --admin-pass "Admin_SeCuRe_PaSsWoRd"

最后几点

  • 我使用的是 http 协议,但是 Nextcloud 也可以在 https 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。

  • 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。

  • Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 /etc/php.ini 配置文件中的 memory_limit 变量,然后重新启动 httpd 服务。

  • 默认情况下,只能使用 http://localhost/ URL 访问 Web 界面。如果要允许使用其他域名访问,你可编辑 /var/www/html/nextcloud/config/config.php 来进行此操作。* 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。


    1. 'trusted_domains' =>

    2. array (

    3.    0 => 'localhost',

    4.    1 => '*',

    5. ),

感谢各位的阅读!关于“如何使用Fedora 31和Nextcloud服务器构建自己的云”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

本文题目:如何使用Fedora31和Nextcloud服务器构建自己的云
文章地址:https://www.cdcxhl.com/article32/pidhsc.html

成都网站建设公司_创新互联,为您提供App设计品牌网站建设外贸建站网站维护网页设计公司网站设计公司

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

搜索引擎优化