如何使用Fedora31和Nextcloud服務(wù)器構(gòu)建自己的云

這篇文章給大家分享的是有關(guān)如何使用Fedora 31和Nextcloud服務(wù)器構(gòu)建自己的云的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。

10年積累的成都網(wǎng)站制作、成都做網(wǎng)站經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有鹽津免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

步驟 1:預(yù)先安裝條件

在安裝和配置 Nextcloud 之前,必須滿足一些預(yù)先條件。

首先,安裝 Apache Web 服務(wù)器:

# 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 后,啟用并啟動(dòng) Apache Web 服務(wù)器:

# systemctl enable --now httpd

接下來,允許 HTTP 流量穿過防火墻:

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

接下來,安裝 MariaDB 服務(wù)器和客戶端:

# dnf install mariadb mariadb-server

然后啟用并啟動(dòng) MariaDB 服務(wù)器

# systemctl enable --now mariadb

現(xiàn)在,MariaDB 正在運(yùn)行,你可以運(yùn)行 mysql_secure_installation 命令來保護(hù)它:

# 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 實(shí)例創(chuàng)建獨(dú)立的用戶和數(shù)據(jù)庫:

# 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 服務(wù)器

現(xiàn)在,你已滿足 Nextcloud 安裝的預(yù)先條件,請(qǐng)下載并解壓 Nextcloud 壓縮包:

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

接下來,創(chuàng)建一個(gè)數(shù)據(jù)文件夾,并授予 Apache 對(duì) nextcloud 目錄樹的讀寫訪問權(quán)限:

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

SELinux 必須配置為可與 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安裝中還有很多其他的命令,發(fā)布在這里: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服務(wù)器構(gòu)建自己的云

使用命令行

在命令行中,只需輸入以下內(nèi)容,使用你之前在 MariaDB 中創(chuàng)建的獨(dú)立 Nextcloud 用戶替換相應(yīng)的值:

# 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"

最后幾點(diǎn)

  • 我使用的是 http 協(xié)議,但是 Nextcloud 也可以在 https 上運(yùn)行。我可能會(huì)在以后的文章中寫一篇有關(guān)保護(hù) Nextcloud 的文章。

  • 我禁用了 SELinux,但是如果配置它,你的服務(wù)器將更加安全。

  • Nextcloud 的建議 PHP 內(nèi)存限制為 512M。要更改它,請(qǐng)編輯 /etc/php.ini 配置文件中的 memory_limit 變量,然后重新啟動(dòng) httpd 服務(wù)。

  • 默認(rèn)情況下,只能使用 http://localhost/ URL 訪問 Web 界面。如果要允許使用其他域名訪問,你可編輯 /var/www/html/nextcloud/config/config.php 來進(jìn)行此操作。* 字符可用于繞過域名限制,并允許任何解析為服務(wù)器 IP 的 URL 訪問。


    1. 'trusted_domains' =>

    2. array (

    3.    0 => 'localhost',

    4.    1 => '*',

    5. ),

感謝各位的閱讀!關(guān)于“如何使用Fedora 31和Nextcloud服務(wù)器構(gòu)建自己的云”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

本文題目:如何使用Fedora31和Nextcloud服務(wù)器構(gòu)建自己的云
文章地址:http://muchs.cn/article32/pidhsc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、品牌網(wǎng)站建設(shè)、外貿(mào)建站、網(wǎng)站維護(hù)、網(wǎng)頁設(shè)計(jì)公司網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化