Nextcloud installation

Install required packages

root$

yum install php-soap php-gd php-imap php-json php-mbstring php-mcrypt php-mysqlnd php-opcache php-pdo php-pear php-pspell php-xml php-xmlrpc php-curl php-dom php-simplexml php-zip

root$

systemctl restart httpd

Nextcloud database and user

Login to mysql or mariadb as root and your root-password.

root$

mysql -u root -p

 

Now, create the database e.g. your_domain_com_cloud

mysql>

CREATE DATABASE your_domain_com_cloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Create a user with password for the Contao database for connections on localhost e.g. your_domain_com_cloud

mysql>

CREATE USER 'your_domain_com_cloud'@'localhost' IDENTIFIED BY 'new_password';

Grant all access to the Contao database for this created user.

mysql>

GRANT ALL ON your_domain_com_cloud.* TO 'your_domain_com_cloud'@'localhost';

mysql>

FLUSH PRIVILEGES;

Network policies for Nextcloud

Now we need to add two network policies to SELinux.

root$

setsebool -P httpd_can_sendmail on

root$

setsebool -P httpd_can_network_connect on

Create folder for Nextcloud

Create the folder for the Nextcloud installation folder where we extract the files later.

root$

mkdir /var/www/your-domain.com.cloud

root$

chown apache:apache /var/www/your-domain.com.cloud

Also create a folder for the Nextcloud user data.

root$

mkdir /home/cloud.your-domain.com.cloud-data

root$

chown apache:apache /home/cloud.your-domain.com.cloud-data

In each of the two steps, we have to change the owner of the folders to the Apache webserver user.

Configure Apache

Create a Apache configuration-file for your domain and the Nextcloud installation.

e.g. /etc/httpd/conf.d/your-domain.com.cloud443.conf

<VirtualHost xxx.xxx.xxx.xxx:443>

 DocumentRoot /var/www/your-domain.com.cloud
 ServerName cloud.your-domain.com

 <Directory "/var/www/your-domain.com.cloud">

  Options +FollowSymlinks
  AllowOverride All

  <IfModule mod_dav.c>
   Dav off
  </IfModule>

  SetEnv HOME /var/www/your-domain.com.cloud
  SetEnv HTTP_HOME /var/www/your-domain.com.cloud

 </Directory>

 <IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
 </IfModule>

 SSLEngine on
 SSLCertificateFile /etc/letsencrypt/live/your-domain.com/cert.pem

 SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/your-domain.com/chain.pem

</VirtualHost>

 

and redirect your http requests to https.

e.g. /etc/httpd/conf.d/your-domain.com.cloud80.conf

<VirtualHost xxx.xxx.xxx.xxx:80>

 DocumentRoot /var/www/your-domain.com.cloud
 ServerName cloud.your-domain.com

 <Directory "/var/www/your-domain.com.cloud">
  allow from all
  Options None
  Require all granted
 </Directory>

 Redirect / "https://cloud.your-domain.com/"

</VirtualHost>

Download and extract Nextcloud

Now change to the webservers root directory and download Nextcloud it with:

root$

cd /var/www

root$

wget https://download.nextcloud.com/server/releases/latest.tar.bz2

Extract the download archive to the Nexcloud installation folder.

root$

sudo -u apache tar -jxpvf latest.tar.bz2 -C ./your-domain.com.cloud/ --strip=1 nextcloud

SELinux policies

For the data directory.

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/home/cloud.your-domain.com.cloud-data'

And apply it with:

root$

restorecon '/home/cloud.your-domain.com.cloud-data'

 

For the Nextcloud config and app directory. 

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/your-domain.com.cloud/config(/.*)?'

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/your-domain.com.cloud/apps(/.*)?'

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/your-domain.com.cloud/.htaccess'

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/your-domain.com.cloud/.user.ini'

Apply it recursive with:

root$

restorecon -Rv '/var/www/your-domain.com.cloud/'

Memory caching (optional)

For more performance install and configure memory caching.

root$

yum install php-pecl-apcu

 

Add 'memcache.local' => '\OC\Memcache\APCu', to /var/www/your-domain.com.cloud/config/config.php similar to this:

<?php
$CONFIG = array (

 ...

 'logtimezone' => 'UTC',
 'memcache.local' => '\\OC\\Memcache\\APCu',
 'installed' => true,
 'mail_from_address' => 'nextcloud',

 ...

);

Start Nexcloud

To apply all changes first reload Apache.

root$

systemctl reload httpd

 

Now start ERPNext in your favorite web browser:

https://cloud.your-domain.com

References

System requirements

https://docs.nextcloud.com/server/11/admin_manual/installation/system_requirements.html

Nextcloud manual installation and Apache configuration.

https://docs.nextcloud.com/server/11/admin_manual/installation/source_installation.html

Description of all Nextcloud config.php settings.

https://github.com/nextcloud/server/blob/c76dc835c4a1abc179bef3c469d837946fe4d339/config/config.sample.php#L210-L215

Memory caching

https://docs.nextcloud.com/server/11/admin_manual/configuration_server/caching_configuration.html

Kommentare

Bitte addieren Sie 7 und 2.