Requirements

Steps

  1. Configure Firewall forward port to local IP port 443

  1. Run Port Update
  1. # portsnap fetch
  1. # portsnap extract
  2. # portsnap update
  3. # portsnap fetch update

  1. Installing systems as root

  1. Go to /usr/ports/www/nextcloud

  1. Configure
  1. /usr/local/etc/apache24/httpd.conf

Alias /nextcloud /usr/local/www/nextcloud

AcceptPathInfo On<Directory /usr/local/www/nextcloud>

AllowOverride All

Require all granted

</Directory>#Uncomment

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

LoadModule ssl_module libexec/apache24/mod_ssl.soServerName nc.my_domain.org:443

ServerAdmin webmaster@my_domain.org#Uncomment

Include etc/apache24/extra/httpd-ssl.conf

  1. # service mysql-server start
  2. # mysql_secure_installation

  1. /usr/local/etc/apache24/httpd.conf

<FilesMatch "\.php$">

SetHandler application/x-httpd-php

</FilesMatch>

<FilesMatch "\.phps$">

SetHandler application/x-httpd-php-source

</FilesMatch>

  1. Edit /etc/rc.conf

  1. Browse to system

  1. Configure SSL

# cd /usr/local/etc/apache24

# openssl genrsa -des3 -out server.key 2048

# openssl req -new -key server.key -out server.csr

# ----- Self signed cert

# openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt

# ----- Self signed cert

### Get a free 6 month trial SSL Cert from

https://ssl.comodo.com/free-ssl-certificate.php

###Get a free 6 month trial SSL Cert from

# chmod 0400 /usr/local/etc/apache24/server.key

# chmod 0400 /usr/local/etc/apache24/server.crt

# cd /usr/local/etc/apache24

# cp server.key server.key.orig

# openssl rsa -in server.key.orig -out server.key

  1. Configure /usr/local/www/nextcloud/config/config.php

  1. Edit httpd-ssl.conf

<VirtualHost _default_:443>

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

  1. Test