Semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?' Semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/.user.ini' Semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/.htaccess' Semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/apps(/.*)?' Semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/config(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/nginx/html/nextcloud/data(/.*)?' Run the commands below and be sure to replace the Nextcloud installation paths accordingly. upstream php-handler /tcp -permanent firewall-cmd -reload Configure SELinuxĪlso, Nextcloud provide SELinux configurations that should at least fix the permission issues with Nextcloud. vim /etc/nginx/conf.d/nfīe sure to replace the server name, the web root directory, the path to the SSL/TLS certificates accordingly. You can simply grab the configuration and adjust it to suit your environment setting. Nextcloud provides a sample Nginx configuration code for Nextcloud. openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/nc-selfsigned.key -out /etc/pki/tls/nc-selfsigned.crt Configuring Nginx for Nextcloud ![]() If you are running Nextcloud in production environments, consider using the publicly trusted certificates from your preferred CA. This guide uses self signed certificates for demonstration purposes. Well, to setup Nextcloud with SSL/TLS certificates, you first need to generate the certificates. unzip latest.zip -d /usr/share/nginx/html/ Generate SSL/TLS Certificates The path might be different for your case. Since we are using Nginx as our Web server, we are gonna place the Nextcloud files and configurations under, /usr/share/nginx/html/nextcloud. wget Extract Nextcloud to Web Root Directory As such, download the latest stable release version of Nextcloud, v17.0.2, as of this writing from the releases page. In this guide, we are going to install Nextcloud from the source. Reload privileges tables and exit the DB. grant all privileges on ncdb.* to identified by ' ' create database ncdb Ĭreate Nextcloud database user with full privileges granted on the Nextcloud database. Next, create Nextcloud database ( The names of the database and database user used here are not standard, use whatever names you like). ![]() | InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |Įnsure that the support is set to DEFAULT. | Engine | Support | Comment | Transactions | XA | Savepoints | Create Nextcloud Database and Database Userīefore you can create MariaDB/MySQL database for Nextcloud ensure that InnoDB is the default storage engine mysql -u root -p show engines +-+-+-+-+-+-+ # Uncomment these lines by removing the at the beginning of the lines. Install other required packages dnf install zip wget tar policycoreutils-python-utils Configure PHPĮdit the /etc/php.ini and set the value of cgi.fix_pathinfo to 0. To install other required PHP modules and other packages, run the commands below dnf install php-gd php-json php-curl php-mbstring php-intl php-xml php-zip php-pear php-soap Install LEMP Stack on CentOS 8 Install Other Required PHP Modules We have provided a guide on how to setup LEMP stack on CentOS 8 in our previous guide. To run Nextcloud with Nginx, you first need to setup LEMP stack. Run System UpdateĮnsure that your system packages are up-to-date. Feel free to modify the steps to suit your environment. ![]() To install Nextcloud with Nginx and SSL/TLS Certificates on CentOS 8, these are the steps that were used in our environment. Install Nextcloud with Nginx and SSL/TLS Certificates on CentOS 8
0 Comments
Leave a Reply. |