How to install NextCloud 12.3 on FreeNAS 11 with all checks passed

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Ok so here it is: many people have been confused as how to get this guide to work and of course im sure u've noticed thier has been some changes to the O/S since the making of the guide.

Here is the fix.

You must create a iocage Jail in order for this guide to work

how do you create an iocage Jail?

that is another question many have have.


I shall explain it for you and post an plug and play example

Code:
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE


where the XXX's are after the -n is your jail name for the ip is emo or whatever you nic is called (you can see this in the freenas gui under network settings) the xxx in the ip is your ip address.

this is to be executed from the freenas user space not a jail

once you do execute it will install the iocage jail

after this you simply access the iocage jail the same you would any other jail in freenas by using the jls command and the the jexec jail# command

then to create the storage
iocage fstab -a myjail "/mnt/Share0/files /mnt/files nullfs rw 0 0"
iocage fstab -a myjail "/mnt/Share0/db /var/db/mysql nullfs rw 0 0"


after doing this install this guide the same as you would in a regular jail. hope this helps
 
Last edited:

pintu1228

Explorer
Joined
Mar 16, 2015
Messages
61
Hi, I have gone through this guide but am stuck at webui portion. When I tried to go to jail ip website doesn't open. It was working in the 'it works' step and after testing php installation (http://jailip/php.info) but once I added the virtual host 80 portion, it doesn't load.

any help to fix this would be great.
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Hi, I have gone through this guide but am stuck at webui portion. When I tried to go to jail IP website doesn't open. It was working in the 'it works' step and after testing php installation (http://jailip/php.info) but once I added the virtual host 80 portion, it doesn't load.

any help to fix this would be great.
did you use php 7.0 or 7.1
 

dnomode

Cadet
Joined
Feb 22, 2018
Messages
4
Hello Everyone. Im new to FreeNAS and FreeBSD and Im trying to get Nextcloud going. However Im running into a problem. Im getting the following error.
Code:
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Enter current password for root (enter for none):


Digging around the internet I was pointed to this page on the FreeBSD Forum

So I checked /usr/local/etc/my.cnf and socket =/tmp/mysql.sock

Code:
# The following options will be passed to all MySQL clients
[client]
#password	   = your_password
port			= 3306
socket		  = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port			= 3306
socket		  = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 240K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id	   = 1


socket = /tmp/mysql.sock was correct, I think. however I still changed it to socket=/var/db/mysql/mysql.sock in the "# The following options will be passed to all MySQL clients" section and the "# The MySQL server" section.

I'm still getting the error.

What am I missing. Any help would be much appreciated

I also posted the same question on the FreeBSD forum, however I thought it may be better to post here instead since im working with FreeNAS

Thank You for your help
Ed
 

virusbcn

Explorer
Joined
Apr 22, 2016
Messages
92
I keep this manual for later study.
you're the fucking master :smile: jajajaa

One question.... If I want to replicate my nextcloud in another remote freenas, what should I do? and replicate the data path and something else??
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Hello Everyone. Im new to FreeNAS and FreeBSD and Im trying to get Nextcloud going. However Im running into a problem. Im getting the following error.
Code:
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Enter current password for root (enter for none):


Digging around the internet I was pointed to this page on the FreeBSD Forum

So I checked /usr/local/etc/my.cnf and socket =/tmp/mysql.sock

Code:
# The following options will be passed to all MySQL clients
[client]
#password	   = your_password
port			= 3306
socket		  = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port			= 3306
socket		  = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 240K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id	   = 1


socket = /tmp/mysql.sock was correct, I think. however I still changed it to socket=/var/db/mysql/mysql.sock in the "# The following options will be passed to all MySQL clients" section and the "# The MySQL server" section.

I'm still getting the error.

What am I missing. Any help would be much appreciated

I also posted the same question on the FreeBSD forum, however I thought it may be better to post here instead since im working with FreeNAS

Thank You for your help
Ed
can you do a remote session
 

virusbcn

Explorer
Joined
Apr 22, 2016
Messages
92
Thank you for the doc, thank you thank you

I have a problem when i config mysqldb i make this ->

Run Wizard Script
$ mysql_secure_installation

For this step read and follow prompts.
By default there is no root password, ( you must create a new one when promted just hit enter, and answer Y to all the following questions.

And have this error ->

root@nextcloud:/ # mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Thank you for the doc, thank you thank you

I have a problem when i config mysqldb i make this ->

Run Wizard Script
$ mysql_secure_installation

For this step read and follow prompts.
By default there is no root password, ( you must create a new one when promted just hit enter, and answer Y to all the following questions.

And have this error ->

root@nextcloud:/ # mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
u must use iocage
 
Joined
Apr 13, 2015
Messages
23
If you're getting the error:
Code:
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
and if you are finally using iocage then check your /mnt/Cloud/db and /mnt/Cloud/files (within FreeNAS user space) for old/previous, failed install attempts. Clear both folders out then start the guide over again at:
Install MariaDB 10.1
$ pkg install mariadb101-server
 

dnomode

Cadet
Joined
Feb 22, 2018
Messages
4
can you do a remote session

Thanks for the offer, however I started over and re-read the post and got it going using IOCAGE.

However, now Im stuck at this step:
Touch file: (I used a cloud.* subdomain, if you're not using a sub, remove the 'cloud.')

$ touch YOURDOMAIN.com or org or gov.conf

$ nano YOURDOMAIN*

make your secure file in this format (simply copy and paste):
Be sure to edit the YOURSITE.COM part of the below file with your domain info
(Example) if your domain is "tocool.no-IP.org" enter that and the domain name matches your touch file name.

I don't have a domain. Im just using a local ip like 192.168.1.3

So I did this:
touch 192.168.1.3
nano 192.168.1.3*
then

<VirtualHost *:80>
DocumentRoot "/usr/local/www/apache24/data/nextcloud"
ServerName 192.168.1.3
RewriteEngine on
RewriteCond %{SERVER_NAME} =192.168.1.3
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
#ErrorLog ${APACHE_LOG_DIR}/error.log
#CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /usr/local/www/apache24/data/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /usr/local/www/apache24/data/nextcloud
SetEnv HTTP_HOME /usr/local/www/apache24/data/nextcloud
Satisfy Any
</Directory>
</VirtualHost>


I then restarted Apache and navigate to my IP, however I don't see NExtCloud. I still see It Works!

*****UPDATE*****
I read the posts again and I needed to type into browser 192.168.1.3/nextcloud

I'm in. :)

Edmond
 
Last edited:

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Code:
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE


then to create the storage
iocage fstab -a myjail "/mnt/Share0/files /mnt/files nullfs rw 0 0"
iocage fstab -a myjail "/mnt/Share0/db /var/db/mysql nullfs rw 0 0"


after doing this install this guide the same as you would in a regular jail. hope this helps

So far so good @dureal99d.

But how do I install "pkgs" within iocage jails?
The commands portsnap fetch extract, pkg install nano wget sudo for example, always return warnings or errors.

Thanks
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
But how do I install "pkgs" within iocage jails?
With the same commands you'd use for warden jails.
always return warnings or errors.
Without knowing what those warnings or errors are, there's no way to help you--but my best guess, based on my own experience with iocage jails, is that it's a network thing.
 

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Thank you for your help @danb35

I was suspicious that iocage was without internet access:

[root@freenas ~]# iocage restart nextcloud
* Stopping nextcloud
+ Running prestop OK
+ Stopping services OK
+ Tearing down VNET FAILED
ifconfig: interface vnet0:5 does not exist
+ Removing jail process OK
+ Running poststop OK
* Starting nextcloud
+ Started OK
+ Configuring VNET OK
+ Starting services OK
[root@freenas ~]#


[root@freenas ~]# iocage exec nextcloud
root@nextcloud:/ # ping www.google.com
ping: cannot resolve www.google.com: Host name lookup failure
root@nextcloud:/ # portsnap fetch extract
Looking up portsnap.FreeBSD.org mirrors... none found.
Fetching public key from portsnap.FreeBSD.org... failed.
No mirrors remaining, giving up.
root@nextcloud:/ #


The FN has the network igb0 interface, but from what I understood by ifconfig the interface inside the iocage is "lo0" correct?.

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
root@nextcloud:/ #


UPDATE:

In the new UI, I changed from igb0|192.168.x.x./24 to lo0 and it looks like there have been some breakthroughs. But now it seems to be the packagesite

root@nextcloud:/ # pkg install nano
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, pl
ease wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/Latest/pkg
.txz: Non-recoverable resolver failure
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.
root@nextcloud:/ #


UPDATE 2:

In fact it was that and it wasn't that!!! It was the same interface that instead of igb0 for lo0 should be igb0 for vnet0! Now apparently it's okay!

[root@freenas ~]# iocage exec nextcloud
root@nextcloud:/ # portsnap fetch extract
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching public key from ec2-sa-east-1.portsnap.freebsd.org... done.
Fetching snapshot tag from ec2-sa-east-1.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Tue Feb 27 21:07:44 -03 2018:
552c7463042df83df876c394f81ff ....... 64% done....
 
Last edited:

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Ok so here it is: many people have been confused as how to get this guide to work and of course im sure u've noticed thier has been some changes to the O/S since the making of the guide.

Here is the fix.

You must create a iocage Jail in order for this guide to work

how do you create an iocage Jail?

that is another question many have have.


I shall explain it for you and post an plug and play example

Code:
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE


where the XXX's are after the -n is your jail name for the IP is emo or whatever you nic is called (you can see this in the freenas gui under network settings) the xxx in the IP is your IP address.

this is to be executed from the freenas user space not a jail

once you do execute it will install the iocage jail

after this you simply access the iocage jail the same you would any other jail in freenas by using the jls command and the the jexec jail# command

then to create the storage
iocage fstab -a myjail "/mnt/Share0/files /mnt/files nullfs rw 0 0"
iocage fstab -a myjail "/mnt/Share0/db /var/db/mysql nullfs rw 0 0"


after doing this install this guide the same as you would in a regular jail. hope this helps
When created the the jail, using "
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE[/CODE]" a dataset by name xxxx is created in the mnt but not under iocage. is this alright?
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Ok so here it is: many people have been confused as how to get this guide to work and of course im sure u've noticed thier has been some changes to the O/S since the making of the guide.

Here is the fix.

You must create a iocage Jail in order for this guide to work

how do you create an iocage Jail?

that is another question many have have.


I shall explain it for you and post an plug and play example

Code:
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE


where the XXX's are after the -n is your jail name for the IP is emo or whatever you nic is called (you can see this in the freenas gui under network settings) the xxx in the IP is your IP address.

this is to be executed from the freenas user space not a jail

once you do execute it will install the iocage jail

after this you simply access the iocage jail the same you would any other jail in freenas by using the jls command and the the jexec jail# command

then to create the storage
iocage fstab -a myjail "/mnt/Share0/files /mnt/files nullfs rw 0 0"
iocage fstab -a myjail "/mnt/Share0/db /var/db/mysql nullfs rw 0 0"


after doing this install this guide the same as you would in a regular jail. hope this helps
When created the the jail, using "
iocage create -n xxxx ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE[/CODE]" a dataset by name xxxx is created in the mnt but not under iocage. is this alright?
 

petzku

Cadet
Joined
Aug 28, 2017
Messages
2
Hi!

Which logfile should I look at to check for problems with Redis? I managed to get this working nicely until I tried enabling the redis cache. After that all I get is internal errors from the browser.
Here is the error page I get after trying to enable Redis.
Code:
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
 

jasemo

Dabbler
Joined
Mar 15, 2018
Messages
30
Hi,

Like a lot of other posters I've had problems once I got to the MariaDB section of the guide. Am I correct that the only way to get this to work now is using iocage?

I followed dureal99d's explanation and run the command:

Code:
iocage create -n Nextcloud ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE

(where 192.168.x.xxx is the ip address of my nextcloud box)

Unfortunately while the command seems to complete correctly and the iocage and Nextcloud jails volumes appear in the storage tab, nothing shows up when I use the jls command.

Is there something else that needs to be done? Is it fixable from this point, or do I need to roll back the iocage install and start over?

Thanks for your help.
 
Last edited:

spetke

Cadet
Joined
Mar 25, 2015
Messages
5
Hi,

Like a lot of other posters I've had problems once I got to the MariaDB section of the guide. Am I correct that the only way to get this to work now is using iocage?

I followed dureal99d's explanation and run the command:

Code:
iocage create -n Nextcloud ip4_addr="msk0|192.168.x.xxx/24" -r 11.1-RELEASE

(where 192.168.x.xxx is the IP address of my nextcloud box)

Unfortunately while the command seems to complete correctly and the iocage and Nextcloud jails volumes appear in the storage tab, nothing shows up when I use the jls command.

Is there something else that needs to be done? Is it fixable from this point, or do I need to roll back the iocage install and start over?

Thanks for your help.
Iocage start <jailname> will make it appear in the jls listing


Lähetetty minun ONEPLUS A5000 laitteesta Tapatalkilla
 
Top