# Anyone running OSTicket with Nginx?

**URL:** <https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605>\
**Category:** NGINX\
**Created:** [May 11, 2016, 10:04pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605 "2016-05-11T22:04:06Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 11, 2016, 10:04pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/1 "2016-05-11T22:04:06Z")

</div>

Hi all,  
I’m using Nginx (obviously), but I want to try OSTicket. The only  
supported  
servers for it are, for whatever reason, Apache and IIS. I hate IIS, and  
I  
don’t know how I’d run Apache and Nginx together (plus Nginx seems much  
simpler than Apache to me). Does anyone have OSTicket working under  
Nginx  
by any chance?

I’ve followed this recipe:

> **[osTicket | NGINX](https://www.nginx.com/resources/wiki/start/topics/recipes/osticket/)**
>
> A sample NGINX configuration for osTicket.

but I can’t get it to work. It hits a wall during installation, saying  
that  
it can’t create configuration settings (#7). If anyone has this up and  
running successfully, I’d love to know how you did it. Hopefully the  
OSTicket team will eventually support Nginx natively, but I’m not  
holding  
my breath.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 10:10pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/2 "2016-05-11T22:10:31Z")

</div>

Try my config for Osticket 1.7, nginx+php-fpm  
I create that’s config just for testing  
server {  
listen 80;  
server\_name [test.com](http://test.com);  
access\_log /var/log/nginx/tickets.access.log;  
error\_log /var/log/nginx/tickets.error.log info;  
index index.php;  
root /var/www/ticket;  
client\_max\_body\_size 5M;  
keepalive\_timeout 0;  
fastcgi\_read\_timeout 120;  
fastcgi\_send\_timeout 60;  
index index.php index.html;  
autoindex off;

gzip on;  
gzip\_types text/plain text/css application/x-javascript text/javascript  
application/javascript application/json application/xml text/x-component  
application/rss+xml text/xml;  
sendfile on;  
set $path\_info “”;

location ~ /include {  
deny all;  
return 403;  
}

if ($request\_uri ~ “^/api(/[^?]+)”) {  
set $path\_info $1;  
}

location ~ ^/api/(?:tickets|tasks).\*$ {  
try\_files $uri $uri/ /api/http.php?$query\_string;  
}

if ($request\_uri ~ “^/scp/.\*.php(/[^?]+)”) {  
set $path\_info $1;  
}

location ~ ^/scp/ajax.php/.\*$ {  
try\_files $uri $uri/ /scp/ajax.php?$query\_string;  
}

location / {  
try\_files $uri $uri/ index.php;  
}

location ~ .php$ {  
fastcgi\_param SCRIPT\_FILENAME $document\_root$fastcgi\_script\_name;  
fastcgi\_pass unix:/var/run/php-fpm.sock;  
fastcgi\_index index.php;  
include fastcgi\_params;  
fastcgi\_param PATH\_INFO $path\_info;  
fastcgi\_intercept\_errors on;  
}  
}

2016-05-11 23:03 GMT+03:00 Alex H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 10:27pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/3 "2016-05-11T22:27:28Z")

</div>

Thanks for the quick response. Unfortunately, I’m not having any luck,  
unless I mistyped one of the rules. I also can’t find where errors go.  
Anyone know where, or if, errors in fastcgi/php5-fpm are logged?  
/var/log/php5-fpm.log is empty.

On Wed, May 11, 2016 at 4:09 PM, Yuriy M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 10:56pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/4 "2016-05-11T22:56:05Z")

</div>

On Wed, May 11, 2016 at 4:50 PM, Jim O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> > Is it possible that your script is trying to write a configuration file  
> > and lacks proper \> permission in that directory?

Yes, very possible, and I’d even say likely. The thing is, I can’t find  
out  
what the directory is. I’ve given permission to the entire folder:  
chown www-data /var/www/osticket  
chmod -R 777 /var/www/osticket

But that doesn’t seem to help. I’m new to Linux, though, so I may have  
missed something. I can’t imagine where else it would be trying to write  
to.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 10:56pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/5 "2016-05-11T22:56:05Z")

</div>

You can configure it  
In configuration of pool

php\_admin\_value[error\_log] = /var/log/tes2.ex.com-fpm-php-error.log

2016-05-11 23:26 GMT+03:00 Alex H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 10:51pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/6 "2016-05-11T22:51:25Z")

</div>

Hello,

> > access\_log /var/log/nginx/tickets.access.log;  
> > gzip on;  
> > set $path\_info $1;  
> > location ~ ^/scp/ajax.php/.\*$ {  
> > fastcgi\_pass unix:/var/run/php-fpm.sock;
> > 
> > > I’ve followed this recipe:  
> > > [F5 NGINX Product Documentation](https://www.nginx.com/resources/wiki/start/topics/recipes/osticket/)  
> > > but I can’t get it to work. It hits a wall during installation, saying that it  
> > > can’t create configuration settings (#7). If anyone has this up and running  
> > > successfully, I’d love to know how you did it. Hopefully the OSTicket team will  
> > > eventually support Nginx natively, but I’m not holding my breath.

Is it possible that your script is trying to write a configuration file  
and lacks proper permission in that directory?

Jim

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:04pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/7 "2016-05-11T23:04:51Z")

</div>

Hello,

> chmod -R 777 /var/www/osticket
> 
> But that doesn’t seem to help. I’m new to Linux, though, so I may have missed  
> something. I can’t imagine where else it would be trying to write to.

Is that the php-fpm user? If so, it’s probably not the problem.

Jim

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:02pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/8 "2016-05-11T23:02:31Z")

</div>

example of php-fpm pool configuration  
user = www-data  
group = www-data  
pm = dynamic  
pm.max\_children = 50  
pm.start\_servers = 20  
pm.min\_spare\_servers = 5  
pm.max\_spare\_servers = 35  
pm.status\_path = /fpm-status  
ping.path = /fpm-ping  
ping.response = pong  
chdir = /var/www/test.ex.com  
catch\_workers\_output = yes  
request\_terminate\_timeout = 180s  
php\_admin\_value[error\_log] = /var/log/tes2.ex.com-fpm-php-error.log  
php\_admin\_value[max\_execution\_time] = 180  
php\_admin\_flag[log\_errors] = on  
php\_admin\_value[memory\_limit] = 320m  
php\_admin\_value[error\_reporting] = E\_ALL  
php\_admin\_flag[display\_errors] = on  
php\_admin\_flag[display\_startup\_errors] = on

2016-05-11 23:26 GMT+03:00 Alex H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:20pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/9 "2016-05-11T23:20:38Z")

</div>

On Wed, May 11, 2016 at 5:04 PM, Jim O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Is it possible that your script is trying to write a configuration file
> 
> Is that the php-fpm user? If so, it’s probably not the problem.

I’m not sure. I don’t find ‘user’ anywhere in php-fpm.conf, so I’m not  
sure  
where that gets set. www-data is the user for Nginx and UWSGI, though,  
not  
that UWSGI has anything to do here.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:32pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/10 "2016-05-11T23:32:19Z")

</div>

Hello,

> > > 
> > 
> > Is that the php-fpm user? If so, it’s probably not the problem.
> 
> I’m not sure. I don’t find ‘user’ anywhere in php-fpm.conf, so I’m not sure  
> where that gets set. www-data is the user for Nginx and UWSGI, though, not that  
> UWSGI has anything to do here.

What’s the output of

# ps aux | grep php

Jim

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:39pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/11 "2016-05-11T23:39:55Z")

</div>

Configuration of pool in /etc/php5/fpm/pool.d/ in Ubuntu/Debian.

2016-05-12 0:36 GMT+03:00 Alex H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:38pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/12 "2016-05-11T23:38:10Z")

</div>

The output of  
sudo ps aux | grep php

admin 16599 0.0 0.0 12728 2164 pts/0 S+ 21:34 0:00 grep  
php  
root 18852 0.0 0.6 295568 24484 ? Ss May09 0:08  
php-fpm:  
master process (/etc/php5/fpm/php-fpm.conf)  
www-data 18857 0.0 0.7 300736 29408 ? S May09 0:00  
php-fpm:  
pool www  
www-data 18858 0.0 0.7 300732 29380 ? S May09 0:00  
php-fpm:  
pool www

I have no idea what any of that means. 🙂 As mentioned, www-data is the  
Nginx user, and I’m logged in as admin over SSH.

---

<div class="post-metadata">

**Author:** ![redroot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/919ad9/32.png) [@redroot](https://www.ruby-forum.com/u/redroot)\
**Post date:** [May 11, 2016, 11:50pm UTC](https://www.ruby-forum.com/t/anyone-running-osticket-with-nginx/244605/13 "2016-05-11T23:50:26Z")

</div>

Hello,

> I have no idea what any of that means. 🙂 As mentioned, www-data is the Nginx  
> user, and I’m logged in as admin over SSH.  
> It means, among other things, that was-data is the php-fpm user. Both  
> php-fpm and nginx should be able to write to any writeable directory  
> owned by that user.

Jim
