Finishing this guide you'll get:
- A running Ghost installation
- Amazon SES mail configuration
- Simple ssh hardenings
- Nginx proxy
- Node.js configured with forever
Specification of latest running installation:
| #!/bin/sh | |
| # | |
| # Written by Denis Vazhenin <denis.vazhenin@me.com> | |
| # | |
| # This script was ported from Debian/Ubuntu version of start script for Gitlab: | |
| # https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab | |
| # | |
| # PROVIDE: gitlab | |
| # REQUIRE: NETWORKING SERVERS DAEMON LOGIN | |
| # KEYWORD: shutdown |
| /var/log/nginx-access.log 644 7 1024 * JC /var/run/nginx.pid 30 | |
| /var/log/nginx-error.log 644 7 1024 * JC /var/run/nginx.pid 30 | |
| /home/app/episodefever/shared/log/unicorn.stdout.log app:app 666 7 1024 * JC | |
| /home/app/episodefever/shared/log/unicorn.stderr.log app:app 666 7 1024 * JC | |
| /home/app/episodefever/shared/log/newrelic_agent.log app:app 666 7 1024 * JC | |
| /home/app/episodefever/shared/log/production.log app:app 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/unicorn.pid 30 | |
| /home/app/episodefever/shared/log/resque-pool.stdout.log app:app 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/resque-pool.pid 30 | |
| /home/app/episodefever/shared/log/resque-pool.stderr.log 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/resque-scheduler.pid 30 |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| # Squid should be intercepting on port 2600 | |
| # A cachaing dns server should be running on this box, with squid and clients all resolving through it. | |
| # FreeBSD 9.2 RELEASE + Squid 3.3.9 from ports | |
| # Timothy Makobu, 2013 | |
| # Variables | |
| admin_if = "igb0" | |
| external_if = "igb1" | |
| intraservices = "{ 22, 2600, 53 }" | |
| forward_ports = "{ 443, 465, 6667, 22, 587, 5938, 2083, 2082, 2095, 2096, 5242, 4244, 5243, 9785 }" |
| -- source: http://www.jamiebegin.com/base36-conversion-in-postgresql/ | |
| CREATE OR REPLACE FUNCTION base36_encode(IN digits bigint, IN min_width int = 0) | |
| RETURNS varchar AS $$ | |
| DECLARE | |
| chars char[]; | |
| ret varchar; | |
| val bigint; | |
| BEGIN | |
| chars := ARRAY['0','1','2','3','4','5','6','7','8','9' | |
| ,'A','B','C','D','E','F','G','H','I','J','K','L','M' |
| #!/usr/local/bin/zsh | |
| JAIL_PORTS=/usr/jails/ports | |
| SHELL=/usr/local/bin/zsh | |
| PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin | |
| SECTION=' * * * * * * ' | |
| DELIMITER='------------------------------' | |
| portsnap -p $JAIL_PORTS fetch extract &>/dev/null || echo "Updating ports tree failed!" | |
| echo "# VULNERABILITIES" |
| # default to -j6 for make | |
| FORCE_MAKE_JOBS=yes | |
| MAKE_JOBS_NUMBER=6 | |
| # specific options/etc for ports | |
| .if ${.CURDIR:M*/databases/mysql*-server} | |
| BUILD_OPTIMIZED=yes | |
| .endif | |
| # static zsh build for root |
Finishing this guide you'll get:
Specification of latest running installation:
| # /etc/make.conf | |
| # Clemens Gruber, 2017 | |
| # | |
| # Nearby mirror | |
| #MASTER_SITE_OVERRIDE="ftp://ftp.at.freebsd.org/pub/FreeBSD/ports/distfiles/" | |
| #MASTER_SITE_OVERRIDE="ftp://ftp.de.freebsd.org/pub/FreeBSD/ports/distfiles/" | |
| # Build | |
| MAKE_JOBS_NUMBER?=8 |
| // | |
| // Copyright (C) 2011-2012 Yaroslav Stavnichiy <yarosla@gmail.com> | |
| // Copyright (C) 2014 OnlineCity Aps <hd@oc.dk> | |
| // | |
| // Inspired by: https://bitbucket.org/yarosla/nxweb/src/tip/src/lib/daemon.c | |
| // | |
| // Licensed under The MIT License: | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights |