Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build your own cloud using Fedora 31 and Nextcloud servers

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to build your own cloud using Fedora 31 and Nextcloud servers. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Step 1: pre-install conditions

There are some prerequisites that must be met before installing and configuring Nextcloud.

First, install the Apache Web server:

# dnf install httpd

Next, install PHP and some other modules. Ensure that the version of PHP installed meets the requirements of 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

After installing PHP, enable and start the Apache Web server:

# systemctl enable-now httpd

Next, allow HTTP traffic to pass through the firewall:

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

Next, install the MariaDB server and client:

# dnf install mariadb mariadb-server

Then enable and start the MariaDB server

# systemctl enable-now mariadb

Now that MariaDB is running, you can run the mysql_secure_installation command to protect it:

# 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): 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] 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]... 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]... 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? [YBO]-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]... Success! Cleaning up... All done! If you've completed all of the above steps, yourMariaDB installation should now be secure. Thanks for using MariaDB!

Next, create separate users and databases for your Nextcloud instance:

# 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; step 2: install Nextcloud server

Now that you have met the prerequisites for Nextcloud installation, please download and extract the Nextcloud package:

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

Next, create a data folder and grant Apache read and write access to the nextcloud directory tree:

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

SELinux must be configured to work with Nextcloud. The basic commands are shown below, but there are many other commands in the nexcloud installation that are released here: Nextcloud SELinux configuration.

# 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/' step 3: configure Nextcloud

You can use its Web interface or configure Nextcloud on the command line.

Use the Web interface

In your favorite browser, visit http://your_server_ip/nextcloud and enter the fields:

Use the command line

On the command line, simply enter the following and replace the corresponding value with the stand-alone Nextcloud user you created earlier in MariaDB:

# 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" the last few points

I use the http protocol, but Nextcloud can also run on https. I may write an article about protecting Nextcloud in a future article.

I disabled SELinux, but if you configure it, your server will be more secure.

Nextcloud's recommended PHP memory limit is 512m. To change it, edit the memory_limit variable in the / etc/php.ini configuration file, and then restart the httpd service.

By default, you can only access the Web interface using http://localhost/ URL. If you want to allow access using other domain names, you can edit / var/www/html/nextcloud/config/config.php to do so. The * character can be used to bypass domain name restrictions and allow any URL access that resolves to the server IP.

'trusted_domains' = >

Array (

0 = > 'localhost'

1 = >'*'

),

Thank you for reading! This is the end of the article on "how to use Fedora 31 and Nextcloud server to build your own cloud". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report