apt update
apt install apache2 mariadb-server libapache2-mod-php7.4
apt install php7.4-gd php7.4-mysql php7.4-curl php7.4-mbstring php7.4-intl
apt install php7.4-gmp php7.4-bcmath php-imagick php7.4-xml php7.4-zip
apt install libmagickcore-6.q16-3-extra
mysql_secure_installation
mariadb
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'p#ssw&rd';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
quit;
wget https://download.nextcloud.com/server/releases/nextcloud-23.0.3.zip
unzip nextcloud-23.0.3.zip
cp -r nextcloud /var/www
chown -R www-data: /var/www/nextcloud
mkdir /ncdata
chown www-data: /ncdata
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/nextcloud.conf
nano /etc/apache2/sites-available/nextcloud.conf
ServerName nextcloud.myservername.com
ServerAdmin myemail@mailserver.com
DocumentRoot /var/www/nextcloud
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
Satisfy Any
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
a2ensite nextcloud
a2enmod rewrite headers env dir mime
systemctl restart apache2
snap install --classic certbot
certbot --apache
nano /etc/php/7.4/apache2/php.ini
memory_limit = 512M
output_buffering = Off
nano /etc/apache2/sites-enabled/nextcloud-le-ssl.conf
ServerName nextcloud.myservername.com
ServerAdmin myemail@mailserver.com
DocumentRoot /var/www/nextcloud
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains";
</IfModulec>
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
Satisfy Any
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
nano /var/www/nextcloud/config/config.php
'htaccess.RewriteBase' => '/',
'default_phone_region' => 'US',
sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess
apt install php-redis redis-server
nano /etc/redis/redis.conf
usermod -aG redis www-data
nano /var/www/nextcloud/config/config.php
'memcache.local' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
'host' => '/var/run/redis/redis-server.sock',
'port' => 0,
],
sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess
systemctl restart apache2 redis
cd /usr/share/keyrings
sudo wget https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg
nano /etc/apt/sources.list.d/collaboraonline.sources
Types: deb
URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2004
Suites: ./
Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg
apt update
apt install coolwsd
apt install code-brand
apt install hunspell
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/collabora.conf
nano /etc/apache2/sites-available/collabora.conf
ServerName collabora.myservername.com
a2ensite collabora
systemctl restart apache2
certbot --apache
nano /etc/apache2/sites-available/collabora-le-ssl.conf
########################################
# Reverse proxy for Collabora Online
#
########################################
AllowEncodedSlashes NoDecode
ProxyPreserveHost On
# static html, js, images, etc. served from coolwsd
# browser is the client part of Collabora Online
ProxyPass /browser http://127.0.0.1:9980/browser retry=0
ProxyPassReverse /browser http://127.0.0.1:9980/browser
# WOPI discovery URL
ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery
# Capabilities
ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities
# Main websocket
ProxyPassMatch "/cool/(.*)/ws$" ws://127.0.0.1:9980/cool/$1/ws nocanon
# Admin Console websocket
ProxyPass /cool/adminws ws://127.0.0.1:9980/cool/adminws
# Download as, Fullscreen presentation and Image upload operations
ProxyPass /cool http://127.0.0.1:9980/cool
ProxyPassReverse /cool http://127.0.0.1:9980/cool
# Compatibility with integrations that use the /lool/convert-to endpoint
ProxyPass /lool http://127.0.0.1:9980/cool
ProxyPassReverse /lool http://127.0.0.1:9980/cool
a2enmod proxy proxy_wstunnel proxy_http
systemctl restart apache2
curl -v https://collabora.myservername.com:9980/hosting/discovery
curl -v http://collabora.myservername.com:9980/hosting/discovery
systemctl status coolwsd
nano /etc/coolwsd/coolwsd.xml
<ssl desc="SSL settings">
<!-- switches from https:// + wss:// to http:// + ws:// -->
<enable type="bool" desc="Controls whether SSL encryption between coolwsd and the network is enabled (do not disable for production deployment). If default is false, must first be compiled with SSL support to enable." default="true">false</enable>
<!-- SSL off-load can be done in a proxy, if so disable SSL, and enable termination below in production -->
<termination desc="Connection via proxy where coolwsd acts as working via https, but actually uses http." type="bool" default="true">true</termination>
systemctl restart coolwsd
nano /etc/coolwsd/coolwsd.xml
systemctl restart coolwsd
Last edit: by atmelino