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

Joshua Parker Ruehlig

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

when I ran owncloud/robots.txt it gave me back this? any clue what that means? thanks

User-agent: *
Disallow: /
just Google search robots.text, I'm sure there's a wikipedia article on it
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
Hi Joshua and thank you for all work you have put into this. I have a pbi based Jail instalation runing but did run into probems of updating it and manage it. I then tried DrKK s Lighttpd based methode only to find that the latest owncloud verison does not support lighttpd and the instaltion acted strange (see post under DrKKs thread). So here I am with you. I have instaled according to your guide. When I try to enter owncloud via the web interface i get the follwoing errors:

PHP module cURL not installed
Please ask your server administrator to install the module

PHP modules have been installed, but they are still listed as missing?
Please ask your server administrator to restart the web server.


Do you have any idea what I can do to fix this?


FreeNAS-9.3-STABLE-201509282017
pkg upgraded today.
owncload 8.2.0 (according to your guide)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua and thank you for all work you have put into this. I have a pbi based Jail instalation runing but did run into probems of updating it and manage it. I then tried DrKK s Lighttpd based methode only to find that the latest owncloud verison does not support lighttpd and the instaltion acted strange (see post under DrKKs thread). So here I am with you. I have instaled according to your guide. When I try to enter owncloud via the web interface i get the follwoing errors:

PHP module cURL not installed
Please ask your server administrator to install the module

PHP modules have been installed, but they are still listed as missing?
Please ask your server administrator to restart the web server.


Do you have any idea what I can do to fix this?
it should have been installed when you run this command from the guide..
pkg install php56-curl

you could try installing it again and restarting php-fpm
service php-fpm restart
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
it should have been installed when you run this command from the guide..
pkg install php56-curl

you could try installing it again and restarting php-fpm
service php-fpm restart

Hi yes for some reason the line :
3. make install clean -C /usr/ports/security/php56-openssl && pkg install php56-curl
did not work. I did run pkg install php56-curl.
The make install clean did not work either so I used pkg install php56-openssl. ??

I was then able to get in OK
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi yes for some reason the line :
3. make install clean -C /usr/ports/security/php56-openssl && pkg install php56-curl
did not work. I did run pkg install php56-curl.
The make install clean did not work either so I used pkg install php56-openssl. ??

I was then able to get in OK
That's fine. compiling php56-openssl just might be needed to install apps.
 

Aaron W Floch

Dabbler
Joined
Mar 10, 2015
Messages
14
Good evening Joshua, I have been working on this jail installation for the past few days. Not surprisingly, every time I follow the guide, my nginx.conf is the cause of some problems (at least, I think). For starters, my file information is quite a bit different than yours shown, and even what others have posted on this forum. The reason I think nginx.conf is the issue, is because I type in my ip, and the "Welcome to nginx!" page appears. So things are working on some level!

The nginx.conf file should be posted below. I have tried a few things with this file, trying to rule out possibilities before writing here on the forum. Of those, I replaced the entire file with what you have shown. I got the spdy module error. I then tried to replace from http up until the virtual host part: got the spdy moduel error. I probably tried a few other things. Each time, I get the spgy module error. Oh, I should mention I run the |service nginx reload| command.

As of now I redid everything (databases, jails, CL entries). Though, I have hardly messed with nginx.conf and only changed the worker_processes line, and am afraid to change anything else. If you have time, I would really appreciate your help. A few things I want to ask that may or may not matter depending on your suggestions. Sendfile and gzip are both off in your example, but are on for me. Should I change those instances to match? More specifically, in your github how-to, the words that are turquoise, should those all be changed?

Thanks again, I really appreciate the comprehensive guide. This was the first time I used command line, and so far you've made it easy.

Code:
#user  nobody;
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Good evening Joshua, I have been working on this jail installation for the past few days. Not surprisingly, every time I follow the guide, my nginx.conf is the cause of some problems (at least, I think). For starters, my file information is quite a bit different than yours shown, and even what others have posted on this forum. The reason I think nginx.conf is the issue, is because I type in my ip, and the "Welcome to nginx!" page appears. So things are working on some level!

The nginx.conf file should be posted below. I have tried a few things with this file, trying to rule out possibilities before writing here on the forum. Of those, I replaced the entire file with what you have shown. I got the spdy module error. I then tried to replace from http up until the virtual host part: got the spdy moduel error. I probably tried a few other things. Each time, I get the spgy module error. Oh, I should mention I run the |service nginx reload| command.

As of now I redid everything (databases, jails, CL entries). Though, I have hardly messed with nginx.conf and only changed the worker_processes line, and am afraid to change anything else. If you have time, I would really appreciate your help. A few things I want to ask that may or may not matter depending on your suggestions. Sendfile and gzip are both off in your example, but are on for me. Should I change those instances to match? More specifically, in your github how-to, the words that are turquoise, should those all be changed?

Thanks again, I really appreciate the comprehensive guide. This was the first time I used command line, and so far you've made it easy.

Code:
#user  nobody;
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
your nginx.conf should match the one posted. I'm not sure what's causing the spdy error as I've never experienced that myslef. I suggest you google or post on the nginx/freebsd forum for more specific help with that.
 

Aaron W Floch

Dabbler
Joined
Mar 10, 2015
Messages
14
Thanks, Joshua. It looks like my mistake was several things. First, I was using the nginx.conf you have in the Github website. Now, I used the most recent version you have here and noticed everything did not past over correctly. I believe I fixed the issue... sort of. Now I type in jailip/owncloud and am sent to https://www.yourdomain.com/owncloud. Is this somehow carry over from the nginx.conf I used from the Github website? I have ran |service nginx reload| and everything is working fine there, now. If starting over would be the best choice, I can do that. It becomes laborious after the 6th time, even though I am learning. Again, I appreciate the help.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks, Joshua. It looks like my mistake was several things. First, I was using the nginx.conf you have in the Github website. Now, I used the most recent version you have here and noticed everything did not past over correctly. I believe I fixed the issue... sort of. Now I type in jailip/owncloud and am sent to https://www.yourdomain.com/owncloud. Is this somehow carry over from the nginx.conf I used from the Github website? I have ran |service nginx reload| and everything is working fine there, now. If starting over would be the best choice, I can do that. It becomes laborious after the 6th time, even though I am learning. Again, I appreciate the help.
What do you mean from the github website? Why are you mixing multiple nginx.conf's?

Just use the one i posted here exactly. Once you get it working you can tweak stuff.
 

Aaron W Floch

Dabbler
Joined
Mar 10, 2015
Messages
14
https://gist.github.com/InQuize/f6748225b8be966c1976

This is the guide I originally followed. I am now using the guide here. So far, I have done everything except a few things.

For the /usr/local/etc/php.ini file I could not find the apc.enable_cli=1 line.

For /usr/local/etc/php-fpm.conf the only thing I changed was listen = /var/run/php-fpm.sock the other lines were already there, unless I was supposed to remove the ; from in front of them. When I post http://jailip/owncloud I am redirected to https://www.yourdomain.com/owncloud

Thanks again for the help.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
https://gist.github.com/InQuize/f6748225b8be966c1976

This is the guide I originally followed. I am now using the guide here. So far, I have done everything except a few things.

For the /usr/local/etc/php.ini file I could not find the apc.enable_cli=1 line.

For /usr/local/etc/php-fpm.conf the only thing I changed was listen = /var/run/php-fpm.sock the other lines were already there, unless I was supposed to remove the ; from in front of them. When I post http://jailip/owncloud I am redirected to https://www.yourdomain.com/owncloud

Thanks again for the help.
I specifically say "add" for the php.ini since the apc line should be added (in the PHP section)

you need to remove the ";", I specifically show those lines without them for a reason

the redirect is probably from the nginx guide you started with. if you're using my guide, I can only support using the nginx.conf I posted, so either replace what you have completely or ask for help on github instead.
 

garyjg

Dabbler
Joined
Dec 31, 2014
Messages
24
I've deleted my jail a couple of time and tried to reinstall as per your guide. now I have a couple of other errors
  • make install clean -C /usr/ports/security/php56-openssl && pkg install php56-curl
Stop in /usr/ports/devel/gmake.
*** [install] Error code 1
Stop in /usr/ports/devel/gmake.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1
Stop in /usr/ports/security/php56-openssl.

from the web:
PHP module cURL not installed.
Please ask your server administrator to install the module.

PHP modules have been installed, but they are still listed as missing?
Please ask your server administrator to restart the web server.

Thanks
 

garyjg

Dabbler
Joined
Dec 31, 2014
Messages
24
Hi, can anyone help me with a cronjob... I've goolged the heck out of this and I still can get the vi to save and exit.

Thanks...
 

garyjg

Dabbler
Joined
Dec 31, 2014
Messages
24
Thanks for the reply but I've tried it many times... I.ve pressed "i"to insert than ecs to switch and :w :q
 

garyjg

Dabbler
Joined
Dec 31, 2014
Messages
24
Thanks but I used this:
To insert the pound sign(#) so that the line is commented, press the i key to insert text and then add the pound sign to the very beginning of the line.
To save your changes, press the Esc key and then type :x and press ENTER to exit and save changes.
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
I don't know or perhaps I didn't understand. I press i paste for command then press escape :wq enter. That's all.... So sorry I can't help you to solve the problem
 
Top