King0770-Notes-Quick-Guide-Setting-Up-ZCS-8.8.15 And NextCloud17: Difference between revisions

 
(4 intermediate revisions by the same user not shown)
Line 31: Line 31:
Copyright (c) 1997-2018 The PHP Group
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
yum install httpd


yum install mysql-server
yum install mysql-server
Line 247: Line 245:


See, https://wiki.zimbra.com/wiki/Zimbra_Drive/How_to_Install_Zimbra_Drive#How_to_configure_Zimbra_Drive_app_on_ownCloud.2FnextCloud
See, https://wiki.zimbra.com/wiki/Zimbra_Drive/How_to_Install_Zimbra_Drive#How_to_configure_Zimbra_Drive_app_on_ownCloud.2FnextCloud
=== Special Note ===


When you access your NextCloud page for the first time, I would highly suggest use an admin username that will <strong>NOT</strong> be an account in Zimbra. Highly suggest don't use admin for NextCloud. I discovered, when I used the admin account from Zimbra, and access the Open Drive from ZWC, when I authenticated as admin into the NextCloud server, my admin rights from NextCloud were gone. I was changed into a regular account named admin.   
When you access your NextCloud page for the first time, I would highly suggest use an admin username that will <strong>NOT</strong> be an account in Zimbra. Highly suggest don't use admin for NextCloud. I discovered, when I used the admin account from Zimbra, and access the Open Drive from ZWC, when I authenticated as admin into the NextCloud server, my admin rights from NextCloud were gone. I was changed into a regular account named admin.   
Line 260: Line 260:
Authenticate into your Zimbra account using your browser. When you are in your account, you should see a tab labeled <strong>Open Drive</strong>, if you click it, you should see the default contents of your NextCloud account from the NextCloud server.<br>
Authenticate into your Zimbra account using your browser. When you are in your account, you should see a tab labeled <strong>Open Drive</strong>, if you click it, you should see the default contents of your NextCloud account from the NextCloud server.<br>


Next, use your Zimbra credentials to authenticate into your NextCloud account from the NextCloud server.  
Next, use your Zimbra credentials to authenticate into your NextCloud account from the NextCloud server. <br>
<br>
<br>


More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes
More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes
Line 267: Line 269:
[[Category:Command Line Interface]]
[[Category:Command Line Interface]]
[[Category:King0770-Notes]]
[[Category:King0770-Notes]]
===Troubleshooting===
If you want to test connectivity, use curl from the Zimbra server to the NextCloud server.<br>
Should look something like this.
<code><pre>
curl -vv http://rick1.lab.local
* Rebuilt URL to: http://rick1.lab.local/
*  Trying xx.xxx.xx.xxx..
* TCP_NODELAY set
* Connected to rick1.lab.local (xx.xxx.xx.xxx) port 80 (#0)
> GET / HTTP/1.1
> Host: rick1.lab.local
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Fri, 28 Feb 2020 22:17:22 GMT
< Server: Apache/2.2.15 (CentOS)
< Referrer-Policy: no-referrer
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Robots-Tag: none
< X-XSS-Protection: 1; mode=block
< X-Powered-By: PHP/7.2.28
< Set-Cookie: ockxxmnqcyur=3u9g48r9ci2ko4hbnpsnf769d4; path=/; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=sVYGcB9qgMAVfakeYUhxcwI0L095xUz%2FOCYTVU%2BM7rrTKXKFEHurZoQNyg9y69inavETu4NbjDsB2sq8XyUyOx697fijrVfKtWFg3RD1DA7DlkFpFyivrBumBD3dnRxQ; path=/; HttpOnly
< Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-WkNwNFdlMmVMYVVrb2xaNjV1MzIzdnJianA2dUdjdUMveWorcThRU1hkRT06SjBnNkNJSElmZEFYeURoT2w3bUZ1WVBzMjlUbWM2K3d5R1dUMHE0a0JlVT0='; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri 'self';
< Set-Cookie: nc_sameSiteCookielax=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
< Set-Cookie: nc_sameSiteCookiestrict=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
< Location: http://rick1.lab.local/login
< Content-Length: 0
< Connection: close
< Content-Type: text/html; charset=UTF-8
</pre></code>
And use curl from your NextCloud to connect to your Zimbra server.<br>
Should see something like this.
<code><pre>
curl -k -vv -X POST http://zimbra.lab.local/service/extension/ZimbraDrive_ConnectivityTest
* About to connect() to zimbra.lab.local port 80 (#0)
*  Trying xx.xxx.xx.xxx... connected
* Connected to zimbra.lab.local (xx.xxx.xx.xxx) port 80 (#0)
> POST /service/extension/ZimbraDrive_ConnectivityTest HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: zimbra.lab.local
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 28 Feb 2020 22:25:29 GMT
< Content-Length: 4
< Connection: keep-alive
< Vary: Accept-Encoding, User-Agent
<
ok
* Connection #0 to host zimbra.lab.local left intact
* Closing connection #0
</pre></code>

Latest revision as of 22:39, 28 February 2020

Requirements

  • Two servers, one with Zimbra 8.8.15, and one with NextCloud
  • Zimbra Open Drive (Not to be confused with Zimbra-Drive-NG)
  • NextCloud 17 requires PHP and Apache/HTTPD and mysql-server

Summary of steps

  • Install required software for NextCloud
  • Install NextCloud
  • Config NextCloud
  • Setup Zimbra Open Drive on Zimbra

Section I - Install required software for NextCloud

In my instance, I am using CentOS 6 for NextCloud 17. NextCloud required PHP7, so I went with php7.2 and httpd-2.2.15, & mysql-server

Additional Info

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

yum install httpd

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install yum-utils
yum-config-manager --enable remi-php72
yum update
yum install php

php -v
PHP 7.2.28 (cli) (built: Feb 18 2020 11:15:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

yum install mysql-server

When you are done with installing httpd and php72, you should have the following modules.

php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib


httpd -M
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 substitute_module (shared)
 rewrite_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 proxy_connect_module (shared)
 cache_module (shared)
 suexec_module (shared)
 disk_cache_module (shared)
 cgi_module (shared)
 version_module (shared)
 php7_module (shared)
Syntax OK

Section II - Install NextCloud

wget https://download.nextcloud.com/server/releases/nextcloud-17.0.3.zip /tmp/releases/nextcloud-17.0.3.zip

cd /tmp/

chown -R apache:apache nextcloud

rsync -av /tmp/nextcloud/ /var/www/html

Section III - Configure httpd

For /etc/httpd/conf/httpd.conf I used the default for DocumentRoot.

DocumentRoot "/var/www/html"

Directory "/var/www/html"

Next create a /etc/httpd/conf.d/nextcloud.conf file with the following.


<VirtualHost *:80>
  DocumentRoot /var/www/html/
  ServerName  rick1.lab.local    <<== use your own server hostname

  <Directory /var/www/html/>
    AllowOverride All
    Options FollowSymLinks MultiViews

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

  </Directory>
</VirtualHost>

Section IV - Create mysql database for NextCloud

mysql -u root <PRESS ENTER>

mysql> create database nextcloud;

mysql> CREATE USER 'apache'@'localhost' IDENTIFIED BY 'apache';

mysql> GRANT ALL ON apache.* TO 'apache'@'localhost' IDENTIFIED BY 'apache';

mysql> FLUSH PRIVILEGES;

mysql> EXIT; 

Section V - Configure Zimbra Server, and Zimbra Domain

yum install zimbra-drive

su - zimbra  <PRESS ENTER>

zmprov md lab.local zimbraDriveOwnCloudURL 'http://rick1.lab.local/index.php'    <<== be sure to use your own hostname for NextCloud

zmmailboxdctl restart

Section VI - Install Zimbra App for NextCloud


wget https://zextras-artifacts.s3-eu-west-1.amazonaws.com/zimbradrive/28_Nov_2019_23_MANUAL/zimbradrive.tar.gz /var/www/html/app/zimbradrive.tar.gz

cd /var/www/html/

tar -xvf zimbradrive.tar.gz

chown -R apache:apache zimbradrive

Section VII - Start httpd from NextCloud, and go to the login page

/etc/init.d/httpd start

Now go to http://YOUR-NEXTCLOUD-HOSTNAME/

Section VIII - Setup Zimbra App for NextCloud

See, https://wiki.zimbra.com/wiki/Zimbra_Drive/How_to_Install_Zimbra_Drive#How_to_configure_Zimbra_Drive_app_on_ownCloud.2FnextCloud

Special Note

When you access your NextCloud page for the first time, I would highly suggest use an admin username that will NOT be an account in Zimbra. Highly suggest don't use admin for NextCloud. I discovered, when I used the admin account from Zimbra, and access the Open Drive from ZWC, when I authenticated as admin into the NextCloud server, my admin rights from NextCloud were gone. I was changed into a regular account named admin.

In order to provision a admin account just for NextCloud, but NOT Zimbra, I ran the following,

sudo -u apache php ./occ user:add --display-name="NextCloud Admin" --group="admin" --group="db-admins" ncadmin

Section IX - Test

Authenticate into your Zimbra account using your browser. When you are in your account, you should see a tab labeled Open Drive, if you click it, you should see the default contents of your NextCloud account from the NextCloud server.

Next, use your Zimbra credentials to authenticate into your NextCloud account from the NextCloud server.


More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes

Troubleshooting

If you want to test connectivity, use curl from the Zimbra server to the NextCloud server.
Should look something like this.

curl -vv http://rick1.lab.local
* Rebuilt URL to: http://rick1.lab.local/
*   Trying xx.xxx.xx.xxx..
* TCP_NODELAY set
* Connected to rick1.lab.local (xx.xxx.xx.xxx) port 80 (#0)
> GET / HTTP/1.1
> Host: rick1.lab.local
> User-Agent: curl/7.58.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Date: Fri, 28 Feb 2020 22:17:22 GMT
< Server: Apache/2.2.15 (CentOS)
< Referrer-Policy: no-referrer
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Robots-Tag: none
< X-XSS-Protection: 1; mode=block
< X-Powered-By: PHP/7.2.28
< Set-Cookie: ockxxmnqcyur=3u9g48r9ci2ko4hbnpsnf769d4; path=/; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=sVYGcB9qgMAVfakeYUhxcwI0L095xUz%2FOCYTVU%2BM7rrTKXKFEHurZoQNyg9y69inavETu4NbjDsB2sq8XyUyOx697fijrVfKtWFg3RD1DA7DlkFpFyivrBumBD3dnRxQ; path=/; HttpOnly
< Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-WkNwNFdlMmVMYVVrb2xaNjV1MzIzdnJianA2dUdjdUMveWorcThRU1hkRT06SjBnNkNJSElmZEFYeURoT2w3bUZ1WVBzMjlUbWM2K3d5R1dUMHE0a0JlVT0='; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri 'self';
< Set-Cookie: nc_sameSiteCookielax=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
< Set-Cookie: nc_sameSiteCookiestrict=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
< Location: http://rick1.lab.local/login
< Content-Length: 0
< Connection: close
< Content-Type: text/html; charset=UTF-8

And use curl from your NextCloud to connect to your Zimbra server.
Should see something like this.

curl -k -vv -X POST http://zimbra.lab.local/service/extension/ZimbraDrive_ConnectivityTest
* About to connect() to zimbra.lab.local port 80 (#0)
*   Trying xx.xxx.xx.xxx... connected
* Connected to zimbra.lab.local (xx.xxx.xx.xxx) port 80 (#0)
> POST /service/extension/ZimbraDrive_ConnectivityTest HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: zimbra.lab.local
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 28 Feb 2020 22:25:29 GMT
< Content-Length: 4
< Connection: keep-alive
< Vary: Accept-Encoding, User-Agent
< 
ok
* Connection #0 to host zimbra.lab.local left intact
* Closing connection #0
Jump to: navigation, search