[How-To] ownCloud using NGINX, PHP-FPM, and MySQL

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I keep getting an Error 504 - Gatewy timeout when trying to access the 'apps' when logged in as admin.

This seems to be a known error, I followed the instructions here on how to install Owncloud V7.00 so can't really see why I am getting this error.
I do have proper Internet access - I loaded all of the sw into the jail correctly to make Owncloud V7 work so I know it has full access to the internet.
I did not add SSL access yet - for fear of screwing up something else.

Not sure how to go about debugging this though.
I hit the same issue and updated my timeout in HAProxy to >30s, though that wouldn't change in this guide. If you find the relevant timeout that needs to be changed please post it. I don't have time to test this currently.
 

norskman

Contributor
Joined
Sep 28, 2012
Messages
149
I am not using an HAproxy front end like you.

I go straight to my router and then out to the wide world . My router is doing the port forwarding.

Not sure where the error is - tried some of the clues given on owncloud forum. But that made no difference - including not checking .htaccess , internet access, webdav is working, ownCloud latest version.

Nothing helped.

Still you cannot easily get to the new apps. Not sure if its an owncloud or if the problems lies elsewhere

anyone know? Anyone got this problem?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
.htaccess doesn't matter with nginx. you can enable logging with nginx/php-fpm and the log should give some clues
 

norskman

Contributor
Joined
Sep 28, 2012
Messages
149
I did find that there were not enough children processes running - from php-fpm.log

However the real problem I think is this one:

It is a long line so I copied it to Pastebin:

http://pastebin.com/U3bFW0xf

2014/08/04 16:14:01 [crit] 34287#0: *10 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream

Odd - as everything else works?

I am not sure how to debug this further.

I have used the notes extensively, in fact I created a word document as I typed in the commands as Joshuas good instructions have become a bit hard to follow.
 

clicq

Dabbler
Joined
Jan 3, 2014
Messages
17
I did find that there were not enough children processes running - from php-fpm.log

However the real problem I think is this one:

It is a long line so I copied it to Pastebin:

http://pastebin.com/U3bFW0xf

2014/08/04 16:14:01 [crit] 34287#0: *10 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream

Odd - as everything else works?

I am not sure how to debug this further.

I have used the notes extensively, in fact I created a word document as I typed in the commands as Joshuas good instructions have become a bit hard to follow.

My default settings are OK on my machine (that is, I can see the apps fine and I followed the directions here), but it is pretty close to the 30 second time out, so if you have a slower machine I think you'll get an error.

To increase the timeout, according to the instructions on this page (I'm editing them to reflect the paths here):

  1. Edit /usr/local/etc/php.ini. Look for max_execution_time, change it from 30 to 300.
  2. In the location ~ \.php block (where all the other fast_cgi_param are), add the line fastcgi_read_timeout 300;
I think that will do it, but I'm not 100% sure since, as I said, it works on my machine with the default 30 second timeout.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Guys,
Is it just me when I get this part to include SSL:
Code:
# service stop nginx

I get this:
Code:
root@CloudJail:/ service stop nginx
stop does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d)


And if I try #service nginx stop I receive the same warning...

Thanks for help
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Because the service command is NOT like Windows... you should have done service nginx stop.
 

neto_hugo

Explorer
Joined
Mar 6, 2012
Messages
87
Thanks for help cyber, but as I said if I try 'service nginx stop' I getting the same warning...

Code:
root@CloudJail:/ service nginx stop
nginx does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Looks like nginx isn't installed properly then...
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I have tried this method; and I am getting stuck almost right away. Where it says to "Add Storage" after creating the new "Portjail"; When I try to browse the folders in the jail to set the db destination: mysql is not there.

I take it that the tank/db is described as a dataset that "I created"; though I would expect the mysql would be installed with the jail; correct? I tried just making a folder with that name; and it seemed to have issues.

-UPDATE-
I just realized that mysql is installed on the step using the 1st command in the Jail command prompt.
However; when I go to the second command: "Make Install Clean": it asks me what file I would like to patch . . .
The guide says nothing about patching a particular file.
 
Last edited:

Rickle

Dabbler
Joined
Aug 14, 2013
Messages
38
i suspect your ports tree is not current. you might try updating your ports tree with this command and run the "make install..." command again.

Code:
portsnap fetch update


more info can be found about ports here
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I decided this morning to refresh my USB install of FreeNAS; as I got error messages in the overnight security run, after trying to upgrade using the GUI. In my experience GUI upgrades can be very finicky.

I was also wondering your opinion on how my Jail land should be setup. It has been setup using the default methods for plugins. I'm not sure if this might be also causing problems for "portjails" vs. "pluginjails". If you have any suggestions please share.

Thanks for your help.
 

Rickle

Dabbler
Joined
Aug 14, 2013
Messages
38
If you are unfamiliar with jails, i would recommend sticking with the pre built plugins.

If you realy need to setup a jail. A ports jail is prety standard. IMO

As for updating issues, ive done dozens and never had issues. You might want to check your hardware.
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I really want to be able to access owncloud from outside my local network. Granted I realize this is not something to just hastily flip a switch and hope it all goes well. With that said, what myself and many other users would find very valuable; is if there were a way someone could create a plugin version of owncloud that was intended to be the base for adding further functionality such as SSL support, Fail2ban, etc. As well as being able to upgrade to the latest owncloud without waiting long periods for plugin updates. (Which always seem to be about 2-3 versions behind actual owncloud releases.) I really don't use or intend on using many if any other plugins. owncloud is the biggest draw for me. I currently use it (localy) to syncronize all my current projects to multiple OS' User accounts, etc. So far it has worked well; with the limitation that it is not accessible from the internet; (which is likely best at this point; I understand the security risks), and I cannot keep it up to date to take advantage of fixes or security patches.

-Also;

My question about Jails was not about the individual Jail itself; but rather the way the entire intial setup is performed when you enable Jails. I said that mine was created using the automated setup associated with Plugins; I was perhaps wondering if a port jail created within that environment would perhaps have some issues that otherwise would be solved if creating a Fresh Jail setup. Meaning; deleting the entire JAIL dataset; and recreating it.
 

Rickle

Dabbler
Joined
Aug 14, 2013
Messages
38
I used the owncloud plugin on the internet in the past and enabled ssl ont it. Not sure why you say it can't be done. All you need is forward the necessary port from your router/firewall.

As for the version issue, i agree. You are running an older version with the plugin.
 

Rickle

Dabbler
Joined
Aug 14, 2013
Messages
38
As for the jail question, for this setup you need a fresh ports jail amd not a plugin jail
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I already understand the difference between a plugin jail, and a port jail; or at least that there is a difference. I did use a port jail when i tried previously; NOT a previously used plugin jail.

What I was really getting at was this:

http://doc.freenas.org/index.php/Jails_Configuration

Does this aspect need any additional changes . . .
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
So your suggestion to run "portsnap fetch update"; seems to have made the difference. I still have a ways to go; but it obviously fixed what was hanging before.

Thank You.
 
Top