PHP Applications - NGINX + PHP-FPM (+MySQL) - Jail Install and Setup

Status
Not open for further replies.

Joshua Parker Ruehlig

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

darkryoushii

Explorer
Joined
Jan 23, 2013
Messages
60
I took the links down, I am planning on editting the instructions to have mariadb+phpfpm compiled from ports instead.

I look forward to it :) I used this guide to install nginx since I have limited experience with FreeBSD but can't get PHP5 to work. Waiting patiently for your updated links :P
 

Scareh

Contributor
Joined
Jul 31, 2012
Messages
182
I've done a new install of jail/nginx/php/ajaxplorer on my new machine but i've run into a bump.
I moved my ajaxplorer from its subfolder in www towards the www-folder itself and now i'm getting an error 403- forbidden whenever i go towards my jail ip.

Any suggestions on why this is happening?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I've done a new install of jail/nginx/php/ajaxplorer on my new machine but i've run into a bump.
I moved my ajaxplorer from its subfolder in www towards the www-folder itself and now i'm getting an error 403- forbidden whenever i go towards my jail ip.

Any suggestions on why this is happening?


Did you used to access ajaxplorer from a sub-directory? example = IPAddress/ajaxplorer

I don't think ajaxplorer can switch from one to another, you probably need to change a config.php file somewhere.
 

Cosmo_Kramer

Contributor
Joined
Jan 9, 2013
Messages
103
Hello,
Thank you for your help in this thread so far. It is a great resource.
I followed this tutorial: http://forums.freenas.org/threads/h...x-in-plugin-jail-mysql-optional-webdav.10297/
and successfully got ajaxplorer running but I can't seem to get Zoho editor to save. How would I go about doing so?
I noticed that I don't have a domain.conf file and you specifically mention Zoho editor in that file.
May you please help direct me on how to allow this?

Thank you for your time.
 

extera

Cadet
Joined
Apr 19, 2013
Messages
8
Great post! Will try this soon.

Are you going to put an howto up for newznab aswell? That would be awesome :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Great post! Will try this soon.

Are you going to put an howto up for newznab aswell? That would be awesome :)

I might document what I did one day. I currently have nZEDb running and it's running great.
 

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
I took the links down, I am planning on editting the instructions to have mariadb+phpfpm compiled from ports instead.


Any chance you could review this? I've installed FreeNAS just to try out ownCloud on it and know nothing about BSD.

I'm looking at
http://forums.freenas.org/threads/howto-owncloud-with-nginx-and-mysql-in-plugin-jail.9985/
from 2012 where it has
Code:
portsnap fetch extract
pkg_delete --force pkg-config-0.25_1
cd /usr/ports/devel/pkgconf && make install clean
cd /usr/ports/www/nginx && make install clean (+ HTTP_DAV, HTTP_FLV, HTTP_GZIP_STATIC, HTTP_PERL, HTTP_SSL)
cd /usr/ports/lang/php5 && make install clean" (+ FPM)


Is that pretty much correct? (I didn't do the pkg_delete, pkgconf nor the nginx steps)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Any chance you could review this? I've installed FreeNAS just to try out ownCloud on it and know nothing about BSD.

I'm looking at
http://forums.freenas.org/threads/howto-owncloud-with-nginx-and-mysql-in-plugin-jail.9985/
from 2012 where it has
Code:
portsnap fetch extract
pkg_delete --force pkg-config-0.25_1
cd /usr/ports/devel/pkgconf && make install clean
cd /usr/ports/www/nginx && make install clean (+ HTTP_DAV, HTTP_FLV, HTTP_GZIP_STATIC, HTTP_PERL, HTTP_SSL)
cd /usr/ports/lang/php5 && make install clean" (+ FPM)


Is that pretty much correct? (I didn't do the pkg_delete, pkgconf nor the nginx steps)

Everything looks good. You dont need the special options for nginx (unless you want ssl through nginx). The pkg_delete/pkgconf stuff was to be able to use the latest ports on an older jail, probably no longer needed. Do you know how to configure nginx to serve a php program? I have a thread on this.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
I don't use nZEDb, but it doesn't seem to be that hard to install, at least no harder than installing any other PHP/MYSQL-based content like Drupal or PHPMyAdmin.
I'd say the hardest step is probably installing the web server and the MySQL/PostGreSQL back-end. The rest is just simply copying the content to your web root.
 

opowoj

Cadet
Joined
Mar 4, 2014
Messages
4
I thought it would be good to have a single place to link setup guides for popular PHP applications.
If anyone has an application setup guide please post it and I'll link it here.
Also, if you want to edit my install guide below I'm open to suggestions.

Do all of the command in your Plugins Jail's userland, you can enter it from the FreeNAS userland with..
Code:
jls # find you jail's id number
jexec ID csh # replace 'ID' with your jail's id number


NGINX INSTALL
Code:
pkg_add -r nginx

/usr/local/etc/nginx/nginx.conf
Code:
worker_processes  2; #Your number of threads
events {
worker_connections  1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile off; #Disable for files served from zfs
gzip on;
include domain.conf; #This is where I will put my server block(s)
}




PHP-FPM INSTALL
Code:
pkg_add -r php5-extensions
pkg_add -r pecl-APC
 
pkg_delete -f php5-5.3.10_1
fetch -o php5-5.3.10_1.tbz "http://admin.joshuaruehlig.com//data/public/d86e835e8b3c9b6b5739ad4625397b7a.php?dl=true"
pkg_add -f php5-5.3.10_1.tbz #Standard FreeBSD package doesn't come with FPM support
rm php5-5.3.10_1.tbz


Code:
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

/usr/local/etc/php.ini
Code:
date.timezone = America/Los_Angeles #Your timezone
cgi.fix_pathinfo=0 #Security Practice



/usr/local/etc/php-fpm.conf ~ I commented out the main pool and will create my own for each application
Code:
;;[www]
;;user = www
;;group = www
;;listen = 127.0.0.1:9000
;;pm = dynamic
;;pm.max_children = 5
;;pm.start_servers = 2
;;pm.min_spare_servers = 1
;;pm.max_spare_servers = 3



MariaDB INSTALL ~ drop in replacement for MySQL
Code:
fetch -o mariadb-client-5.5.28a.tbz "http://admin.joshuaruehlig.com//data/public/1a5334ed6a3c656a2705ae5fe38c27bf.php?dl=true"
fetch -o mariadb-server-5.5.28a.tbz "http://admin.joshuaruehlig.com//data/public/17aa89ee37ac38459852837b04e46a5b.php?dl=true"
pkg_add mariadb-client-5.5.28a.tbz
pkg_add mariadb-server-5.5.28a.tbz #No FreeBSD package for v5.5 yet
rm mariadb-client-5.5.28a.tbz
rm mariadb-server-5.5.28a.tbz
mysql_secure_installation #You should run this after you start mysql



ENABLE AND START SERVICES
/etc/rc.conf
Code:
nginx_enable="YES"
php_fpm_enable="YES"
mysql_enable="YES"


Code:
service nginx start && service php-fpm start && service mysql-server start



APPLICATIONS
ownCloud
AjaXplorer
Newznab
 

opowoj

Cadet
Joined
Mar 4, 2014
Messages
4
I am totally new in the world outside of Windows. I am very interested in this above mentioned subject. I started with a FreeNAS (9.x) NAS and want to implement WordPress there. (On my Win 7 x64 PC I have installed XAMPP and WordPress sucessfully, on my Synology NAS I have installed WordPress too).

My problems begin with the download of what software and where to store before I install it on the FreeNAS PC.
How do I get
  1. the NGIX NGIX Download Versions.JPG
  2. the MariaDB MariaDB Downloads.JPG
  3. the MySQL MySQL Downloads.JPG
  4. the PHP PHP Download Options.JPG
  5. the Apache Apache Download Options.JPG

I struggle with options "Source" versus "Binary" etc.

thanks in advance for any help/Joachim
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I am totally new in the world outside of Windows. I am very interested in this above mentioned subject. I started with a FreeNAS (9.x) NAS and want to implement WordPress there. (On my Win 7 x64 PC I have installed XAMPP and WordPress sucessfully, on my Synology NAS I have installed WordPress too).

My problems begin with the download of what software and where to store before I install it on the FreeNAS PC.
How do I get
  1. the NGIX View attachment 3706
  2. the MariaDB View attachment 3707
  3. the MySQL View attachment 3708
  4. the PHP View attachment 3709
  5. the Apache View attachment 3710
I struggle with options "Source" versus "Binary" etc.

thanks in advance for any help/Joachim
if your installing WordPress it's just like installing it on a normal FreeBSD system.

this thread should probably be closed cause it's plugin related. can someone close it?
 

opowoj

Cadet
Joined
Mar 4, 2014
Messages
4
Thanx for the reply.

I don't understand anything of your reply.
I want to install WordPress on a FreeNAS basis, and WP needs some software as requirement (webserver, database, php, mySQL and?)
Can you bring my message/questions onto the right section of the FreeNAS-Forum??

I hope to get some hints how to go on further....

Thanks in advance/Joachim
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanx for the reply.

I don't understand anything of your reply.
I want to install WordPress on a FreeNAS basis, and WP needs some software as requirement (webserver, database, php, mySQL and?)
Can you bring my message/questions onto the right section of the FreeNAS-Forum??

I hope to get some hints how to go on further....

Thanks in advance/Joachim
you would install the software on a portsjail. the jail is just like a standard freebsd system, nothing special about it running on top of freenas. so you could follow guides for WP on freebsd.

you can check my ownCloud guide in the how-to section of this forum. I install nginx+php+mysql in that. you would then need to modify your nginx config for WP, this isn't specific to freenas or freebsd.
 
Status
Not open for further replies.
Top