Skip to content

Instantly share code, notes, and snippets.

@oogali
Created September 10, 2015 15:42
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save oogali/29e32fe54065674656db to your computer and use it in GitHub Desktop.
Save oogali/29e32fe54065674656db to your computer and use it in GitHub Desktop.
Observium Nginx configuration
server {
listen 80;
server_name observium.yourdomain.com;
access_log /var/log/nginx/observium-access_log combined;
error_log /var/log/nginx/observium-error_log warn;
root /opt/observium/html;
client_max_body_size 10m;
client_body_buffer_size 8K;
client_header_buffer_size 1k;
large_client_header_buffers 4 8k;
location / {
index index.php index.html index.htm;
autoindex on;
try_files $uri $uri/ /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
@oogali
Copy link
Author

oogali commented Sep 10, 2015

Installing Observium on FreeBSD with Nginx?

You're crazy. I'm crazy. Let's be eccentric together.

pkg install nginx mysql56-client mysql56-server php56
sysrc nginx_enable="YES"
sysrc php_fpm_enable="YES"
sysrc mysql_enable="YES"

pkg install net-snmp php56-snmp
pkg install graphviz fping rrdtool subversion
pkg install pear php56-mysql php56-gd php56-posix php56-mcrypt php56-session php56-filter php56-ctype php56-json php56-xml php56-zlib py27-MySQLdb56

cat << EOF >>/usr/local/etc/php-fpm.conf
listen = /var/run/php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
EOF

# next, put the above configuration file into /usr/local/etc/nginx/conf.d
# oh, that directory doesn't exist? then you'll need to:
#1) create it (mkdir /usr/local/etc/nginx/conf.d)
#2) massage /usr/local/etc/nginx/nginx.conf to include *.conf from the above directory
#3) get the help of a unix grownup if you can't do step #2 by yourself

# mysqld on freebsd ships by default in strict mode
# observium will not operate with strict mode...
# so edit /usr/local/my.cnf and change the value of sql_mode to "PIPES_AS_CONCAT,ANSI_QUOTES"
#
# root@ops:~ # cat /usr/local/my.cnf
# [mysqld]
# innodb_file_per_table=1
# sql_mode=PIPES_AS_CONCAT,ANSI_QUOTES

# start php, nginx, and mysql
service php-fpm start
service nginx start
/usr/local/etc/rc.d/mysql-server start

# yes, you have to start mysql this way for the first time
# don't believe me?
# try "service mysql start" and watch it fail, without an actionable error message at that

# continue with the observium rhel documentation (http://www.observium.org/docs/rhel/#download-observium)
# but!
# - replace all users/groups named "apache" with "www"
# - skip the selinux section
# - add the following lines to config.php:
#
# $config['fping'] = "/usr/local/sbin/fping";
# $config['rrdtool'] = "/usr/local/bin/rrdtool";
# $config['snmpwalk'] = "/usr/local/bin/snmpwalk";
# $config['snmpget'] = "/usr/local/bin/snmpget";
# $config['snmpbulkget'] = "/usr/local/bin/snmpbulkget";
# $config['snmpbulkwalk'] = "/usr/local/bin/snmpbulkwalk";
# $config['snmptranslate'] = "/usr/local/bin/snmptranslate";
#
# - lastly, install the polling cron entries in the root crontab
# (or www or some other user, if you know what you're doing)

Copy link

ghost commented Nov 30, 2016

Ugh, thanks so much. I was missing the damned try_files line.

Works perfectly with my uwsgi setup now. Thanks!

pinboard'd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment