NextCloud SSL help

Status
Not open for further replies.

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Machine Physical Specs
Build
FreeNAS-11.0-U4 (54848d13b)
Platform Intel(R) Core(TM) i7 CPU 980 @ 3.33GHz
Memory 24529MB

I hve tried every tutorial a lot of different configs in my apache file and i cannot get ssl to connect right.

However you can paste the install steps i have taken to achieve a fully working Nextcloud 12

my goal in posting this is to hopefully help someone else who may need a easy setup guide & to get help with installing a valid cert and proper cache based upon my install notes provided below

Any help is truly appreciated. as i know its something i am missing or simply just dont know what it is and how to configure.

Here are my install instruction thanks to a member onryo on a previous post mixed in with some of my notes and other post notes on this forum mixed to form this install guide

step 1. create a standard jail and add storage to that jail.

Be advised:
I highly recommend the use of putty to access the command line interface of your specific jail.
if you dont know how to access with putty look on the forums or you tube. but its pretty easy or i welcome a private message

once sshed in using a client like putty or similar

step 2: use command jls (this will list the available jails)
the use commander jexec 1 or whatever the number of the jail is and it will load into that jail specific

step 3. enter command "portsnap fetch extract" (this will update everyting)

step 4. pkg install nano

Step 5.
pkg install apache24
sysrc apache24_enable="yes"
service apache24 start

pkg install php56 php56-mbstring php56-zlib php56-curl php56-gd php56-json mod_php56 php56-mcrypt php56-opcache

nano /usr/local/etc/apache24/Includes/php.conf
add this

<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>

cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini-production.bakup
ln -s /usr/local/etc/php.ini-production /usr/local/etc/php.ini

service apache24 restart

pkg install mysql56-client mysql56-server php56-mysqli
sysrc mysql_enable="yes"
service mysql-server start
mysql_secure_installation
Do Y to all and set a root pw

mysql -u root -p
CREATE DATABASE nextclouddb;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'your_desired_password';
GRANT ALL PRIVILEGES ON nextclouddb.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
\q

pkg install nextcloud

nano /usr/local/etc/apache24/httpd.conf
add this

Alias /nextcloud /usr/local/www/nextcloud
AcceptPathInfo On
<Directory /usr/local/www/nextcloud>
AllowOverride All
Require all granted
</Directory>

then restart apache
service apache24 restart

When you enter http://yourIP/nextcloud you should get a nice web interface. Enter this for the database info. You can change it later.
user: nextcloud
pw: password
db: nextclouddb
localhost

once in the admin section your going to see error messages:
have no fear:
just do this to remedy those errors and and understand that non of these errors will show as fixed until you restart apache service:

go to this location:
nano /usr/local/etc/php.ini

edit these lines of this file to match the below and be sure to uncomment: (uncomment simply means to remove the ; symbol before each line)
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

you may get a write error when you attempt to use the built in updater:
have no fear there is good news:
in order to update the software simply run this command:

chown -R www:www /usr/local/www/nextcloud

to get rid of the below error message when restarting apache do the following:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Stopping apache24.
Waiting for PIDS: 80591.
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Starting apache24.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message when stating apache do the following:

navigate to "nano /usr/local/etc/apache24/httpd.conf"

under this section
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
ServerName 192.168.2.3:80 <<<<<<<put your serving machines ip address and uncomment the line (uncomment simply means to remove the # symbol from the front of any line) and wala message will be fixed.

restart apache using the following command:
service apache24 restart

and the only errors you will see are that the cache is not properly configured and that you are not using ssl to connect

to enable custom modules:
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enable_previews --value=true --type=boolean'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 0 --value="OC\Preview\PNG"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 1 --value="OC\Preview\JPEG"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 2 --value="OC\Preview\GIF"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 3 --value="OC\Preview\BMP"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 4 --value="OC\Preview\XBitmap"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 5 --value="OC\Preview\MarkDown"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 6 --value="OC\Preview\MP3"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 7 --value="OC\Preview\TXT"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 8 --value="OC\Preview\Illustrator"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 9 --value="OC\Preview\Movie"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 10 --value="OC\Preview\MSOffice2003"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 11 --value="OC\Preview\MSOffice2007"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 12 --value="OC\Preview\MSOfficeDoc"'

I cannot get the cache properly setup so some help or instruction or that would also be nice and yes these are my exact step by steps

of course if you choose to use different install locations and such adjust to fit your particular install preference
 
Last edited:

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Were you able to figure this out?
only with the pbi plugin not based upon this setup, but i would like to based upon this setup provided as nextcloud 12 if far better than 10 as relates to fuctions and such!!!
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
If your willing to re - emulate what I've done (with mostly the help of others and i truly thank them all) and then find the solution of how to setup cache and https based upon this setup that would be great!!!!!!! and one other thing ive noticed is that this uses php5.6 but i guess thiers a way to setup using 7.1 i dunno but hey
 

luckyal

Dabbler
Joined
Aug 4, 2017
Messages
32
Machine Physical Specs
Build
FreeNAS-11.0-U4 (54848d13b)
Platform Intel(R) Core(TM) i7 CPU 980 @ 3.33GHz
Memory 24529MB

I hve tried every tutorial a lot of different configs in my apache file and i cannot get ssl to connect right.

However you can paste the install steps i have taken to achieve a fully working Nextcloud 12

my goal in posting this is to hopefully help someone else who may need a easy setup guide & to get help with installing a valid cert and proper cache based upon my install notes provided below

Any help is truly appreciated. as i know its something i am missing or simply just dont know what it is and how to configure.

Here are my install instruction thanks to a member onryo on a previous post mixed in with some of my notes and other post notes on this forum mixed to form this install guide

step 1. create a standard jail and add storage to that jail.

Be advised:
I highly recommend the use of putty to access the command line interface of your specific jail.
if you dont know how to access with putty look on the forums or you tube. but its pretty easy or i welcome a private message

once sshed in using a client like putty or similar

step 2: use command jls (this will list the available jails)
the use commander jexec 1 or whatever the number of the jail is and it will load into that jail specific

step 3. enter command "portsnap fetch extract" (this will update everyting)

step 4. pkg install nano

Step 5.
pkg install apache24
sysrc apache24_enable="yes"
service apache24 start

pkg install php56 php56-mbstring php56-zlib php56-curl php56-gd php56-json mod_php56 php56-mcrypt php56-opcache

nano /usr/local/etc/apache24/Includes/php.conf
add this

<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>

cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini-production.bakup
ln -s /usr/local/etc/php.ini-production /usr/local/etc/php.ini

service apache24 restart

pkg install mysql56-client mysql56-server php56-mysqli
sysrc mysql_enable="yes"
service mysql-server start
mysql_secure_installation
Do Y to all and set a root pw

mysql -u root -p
CREATE DATABASE nextclouddb;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'your_desired_password';
GRANT ALL PRIVILEGES ON nextclouddb.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
\q

pkg install nextcloud

nano /usr/local/etc/apache24/httpd.conf
add this

Alias /nextcloud /usr/local/www/nextcloud
AcceptPathInfo On
<Directory /usr/local/www/nextcloud>
AllowOverride All
Require all granted
</Directory>

then restart apache
service apache24 restart

When you enter http://yourIP/nextcloud you should get a nice web interface. Enter this for the database info. You can change it later.
user: nextcloud
pw: password
db: nextclouddb
localhost

once in the admin section your going to see error messages:
have no fear:
just do this to remedy those errors and and understand that non of these errors will show as fixed until you restart apache service:

go to this location:
nano /usr/local/etc/php.ini

edit these lines of this file to match the below and be sure to uncomment: (uncomment simply means to remove the ; symbol before each line)
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

you may get a write error when you attempt to use the built in updater:
have no fear there is good news:
in order to update the software simply run this command:

chown -R www:www /usr/local/www/nextcloud

to get rid of the below error message when restarting apache do the following:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Stopping apache24.
Waiting for PIDS: 80591.
Performing sanity check on apache24 configuration:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Starting apache24.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message when stating apache do the following:

navigate to "nano /usr/local/etc/apache24/httpd.conf"

under this section
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
ServerName 192.168.2.3:80 <<<<<<<put your serving machines ip address and uncomment the line (uncomment simply means to remove the # symbol from the front of any line) and wala message will be fixed.

restart apache using the following command:
service apache24 restart

and the only errors you will see are that the cache is not properly configured and that you are not using ssl to connect

to enable custom modules:
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enable_previews --value=true --type=boolean'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 0 --value="OC\Preview\PNG"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 1 --value="OC\Preview\JPEG"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 2 --value="OC\Preview\GIF"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 3 --value="OC\Preview\BMP"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 4 --value="OC\Preview\XBitmap"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 5 --value="OC\Preview\MarkDown"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 6 --value="OC\Preview\MP3"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 7 --value="OC\Preview\TXT"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 8 --value="OC\Preview\Illustrator"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 9 --value="OC\Preview\Movie"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 10 --value="OC\Preview\MSOffice2003"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 11 --value="OC\Preview\MSOffice2007"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set enabledPreviewProviders 12 --value="OC\Preview\MSOfficeDoc"'

I cannot get the cache properly setup so some help or instruction or that would also be nice and yes these are my exact step by steps

of course if you choose to use different install locations and such adjust to fit your particular install preference
Is there a reason for using Apache? It's a bit heavy, no? I'm tempted to do this but with NGINX.
 
Status
Not open for further replies.
Top