Welcome! Log In Create A New Profile

Advanced

Installing Centos 6 - Nginx - PHP-fpm - GitList (and OSTicket)

Posted by sridharpandu 
Installing Centos 6 - Nginx - PHP-fpm - GitList (and OSTicket)
August 16, 2013 06:16AM
Installed Centos 6 (selinux disabled) - NGINX - PHP-fpm when I access my URL I get a server error (The website encountered an error while retrieving http://git.sastratechnologies.net/. It may be down for maintenance or configured incorrectly.)

Here is what I did
1. Installed php (php and php-fpm)
2. Configure php (cgi.fix_pathinfo=0)
3. Configure /etc/php-fpm.d/www.conf and replaced user group with nginx
4. Changed nginx default.conf and increased worker process to 4
5. Created a virtual host by mapping an URL. Tested with php.info and found it working
6. Removed php.info.
7. Followed the instructions on github and installed gitlist by cloning, created cache directory, made it writable, changed paths in config.ini
7. Used the nginx virtual host configuration provided in the installation instructions on GitHub(I noticed the listen directive missing. I had to Include the listen directive to listen on git.sastratechnologies.net without it I was being redirected to the other vhost that had bugzilla. Changed the paths appropriately restarted nginx
8. Accessed the URL and I get the server error 500
9. Access log has the entry (122.164.43.240 - - [14/Aug/2013:14:47:13 +0000] "-" 400 0 "-" "-") and Error logs do not have entries

I then went on to install Osticket and used the VHOST configuration provided in the NGINX wiki, I get the same error. Has anyone had a similar experience. Would like to hear from you.

Regards,

Sridhar Pandurangiah
My nginx.conf entries
August 16, 2013 06:42AM
user nginx;
worker_processes 4;

events {
worker_connections 1024;
}

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
server_names_hash_bucket_size 64;
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
charset utf-8;
keepalive_timeout 65;

gzip on;
gzip_types text/plain application/xml text/javascript;
gzip_min_length 1000;

include /etc/nginx/conf.d/*.conf;
}
My VHOST entries for GITLIST
August 16, 2013 06:45AM
server {
listen git.sastratechnologies.net;
server_name git.sastratechnologies.net;

access_log /home/sridhar/public_html/git.sastratechnologies.net/log/access.log;
error_log /home/sridhar/public_html/git.sastratechnologies.net/log/error.log;

root /home/sridhar/public_html/git.sastratechnologies.net/public;
# index index.php;
# index index.cgi index.txt index.html index.xhtml index.php;

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~* ^/index.php.*$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}

location / {
try_files $uri @gitlist;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
add_header Vary "Accept-Encoding";
expires max;
try_files $uri @gitlist;
tcp_nodelay off;
tcp_nopush on;
}

location @gitlist {
rewrite ^/.*$ /index.php;
}

}
My VHOST entries for OSTICKET
August 16, 2013 06:48AM
server {
listen 80;
server_name support.sastratechnologies.net;
rewrite ^ https://support.sastratechnologies.biz permanent;

keepalive_timeout 70;

access_log /home/sridhar/public_html/support.sastratechnologies.net/log/access.log;
error_log /home/sridhar/public_html/support.sastratechnologies.net/log/error.log;

root /home/sridhar/public_html/support.sastratechnologies.net/public;
index index.php;
location ~ /include {
deny all;
return 403;
}

location ~ ^/api/(tickets|tasks)(.*)$ {
try_files $uri $uri/ /api/http.php;
}

location ~ ^/scp/ajax.php/(.*)$ {
try_files $uri $uri/ /scp/ajax.php;
}

location / {
index index.php;
try_files $uri $uri/ index.php;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:8888;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Removed the rewrite
August 16, 2013 08:44AM
I removed the erroneous rewrite rule and restarted NGINX.

rewrite ^ https://support.sastratechnologies.biz permanent;

I now get the following error

502 Bad Gateway
Re: Removed the rewrite
August 16, 2013 08:46AM
I have the following in my NGINX error log

2013/08/16 12:42:25 [error] 31336#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 122.164.43.240, server: support.sastratechnologies.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:8888", host: "support.sastratechnologies.net"
2013/08/16 12:42:25 [error] 31336#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 122.164.43.240, server: support.sastratechnologies.net, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:8888", host: "support.sastratechnologies.net"
2013/08/16 12:42:26 [error] 31336#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 122.164.43.240, server: support.sastratechnologies.net, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:8888", host: "support.sastratechnologies.net"
Re: Removed the rewrite
August 16, 2013 09:12AM
Changed fastcgi_pass 127.0.0.1:8888;

to fastcgi_pass 127.0.0.1:9000;

restarted NGINX and it worked
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 207
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready