Nextcloud 16 installation on CWP7 Pro

Today we will be completing a Nextcloud 16 installation on CWP7 Pro Control Panel.

To install Nextcloud 16 cloud server on CentOS Web Panel Pro, some modifications must be made both to Apache as well as core CWP files.

You must first rebuild Apache

Apache rebuild for dav modules.

Rebuild Apache with the following added switches – you can use Apache 2.4.39 & suPHP 0.7.2 :

--enable-mod_dav_lock.so
--enable-mod_dav_fs.so
--enable-mod_dav.so
-–enable-auth-digest
-–enable-authn-core
-–enable-authz-core

Enable the Apache modules

Uncomment (remove the “#” sign) the following lines from your /usr/local/apache/conf/httpd.conf file (You may have to add some lines…)

LoadModule alias_module modules/mod_alias.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so

Uncomment:

Include conf/extra/httpd-dav.conf

Restart Apache:

systemctl restart httpd

Check for dav modules:

/usr/local/apache/bin/httpd -M | grep -i dav

The result should look like this:

dav_module (shared)
dav_fs_module (shared)
dav_lock_module (shared)

Edit your “httpd-userdir.conf”

…replace everything in this file with the following text…

<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

Copy the install of Nextcloud 16.x to your domain or subdomain. You should unzip it to a subdirectory like “nextcloud” This keeps it a bit away from prying eyes.

Edit your Nextcloud .htaccess file

…adding the following data to the end of the file:

<Limit GET POST>
order deny,allow
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
allow from all
</Limit>

Set your PHP version

Also don’t forget to have PHP7.3.x installed in CWP7pro and add this as the very first line in your .htaccess to select use of php 7.3 or your currently selected PHP version.

AddHandler application/x-httpd-php73 .php

Correcting errors with Nextcloud if it is installed to a subdirectory that result in Nextcloud’s DAV features not working properly and throwing errors..

We will use /nextcloud as our example Nextcloud installation folder.

Change the vhosts for nextcloud

Find your vhost file(s) (/usr/local/apache/conf.d/vhosts) Modify both the ordinary vhost and the one marked “ssl” if using an SSL certificate (which I advise…)

Open the proper vhost in an editor and add the following before the final </VirtualHost> tag (if there are any, otherwise post below present data).

 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/ocm-provider /nextcloud/ocm-provider/ [R=301,L]
RewriteRule ^/ocs-provider /nextcloud/ocs-provider/ [R=301,L]
RewriteRule ^/\.well-known/carddav /nextcloud/remote.php/dav/ [R=301,L]
RewriteRule ^/\.well-known/caldav /nextcloud/remote.php/dav/ [R=301,L]
</IfModule>

Yous should have now a working Nextcloud 16 installation on CWP7 Pro Control Panel.

Substitute your installation folder for /nextcloud above if different.

You should now be able to navigate to your Nextcloud installation and follow the installation instructions to complete the install.

Confirmed working on Apache v2.4.39 in CWP7pro version: 0.9.8.882, PHP v7.3.8 running Nextcloud 16.0.4 perfectly. NGINX installation is considerably different.

2 Comments

    Jeff

    Hi So with this installation, do we get the https for doing the setup of nextcloud directly ?
    And will it be ok for the new requirement.. as i see lot of nginx with openssl needed…
    Thanks

      Administrator

      Use CWP7 to create a domain with an SSL certificate and then as directed change both vhosts if you are installing to a subdirectory. These instructions will not work for NGINX – only when using Apache as your webserver. I would suggest you read on Nextcloud’s site about NGINX installs – there is a big difference between this tutorial using Apache and PHP than using NGINX and PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*