Anyone running OSTicket with Nginx?

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:

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.

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;
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. [email protected]:

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. [email protected]

On Wed, May 11, 2016 at 4:50 PM, Jim O. [email protected] 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.

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. [email protected]:

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:
osTicket | NGINX
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

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

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. [email protected]:

On Wed, May 11, 2016 at 5:04 PM, Jim O. [email protected] 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.

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

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

2016-05-12 0:36 GMT+03:00 Alex H. [email protected]:

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. :slight_smile: As mentioned, www-data is the
Nginx user, and I’m logged in as admin over SSH.

Hello,

I have no idea what any of that means. :slight_smile: 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