Skip to content

Instantly share code, notes, and snippets.

@yojimbo87
Created November 21, 2012 11:50
Show Gist options
  • Save yojimbo87/4124510 to your computer and use it in GitHub Desktop.
Save yojimbo87/4124510 to your computer and use it in GitHub Desktop.
Setup
# -------------------------------------------------------------------------------------------------------------------
# mono installation
#
# https://github.com/mono/mono
# -------------------------------------------------------------------------------------------------------------------
apt-get install git-core build-essential autocond libtool automake gettext
mkdir /var/src/
cd /var/src/
git clone git://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
make install
mono --version
# -------------------------------------------------------------------------------------------------------------------
# nginx installation
#
# http://wiki.nginx.org/InstallOptions
# http://wiki.nginx.org/Nginx-init-ubuntu
# -------------------------------------------------------------------------------------------------------------------
mkdir /var/src/nginx/
cd /var/src/nginx/
wget ...tar.gz
tar -xvf ...tar.gz
apt-get install libpcre3-dev zlib1g-dev libssl-dev
./configure --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module
make
make install
nano /etc/init.d/nginx # content from http://wiki.nginx.org/Nginx-init-ubuntu - change some params within file
cd /etc/init.d/
/usr/sbin/update-rc.d -f nginx defaults
chmod 755 nginx
/etc/init.d/nginx start
# -------------------------------------------------------------------------------------------------------------------
# Generating self signed SSL certificate on Windows
#
# download and install http://www.openssl.org/related/binaries.html
# steps - http://www.faqforge.com/windows/use-openssl-on-windows/
# -------------------------------------------------------------------------------------------------------------------
genrsa -des3 -out server.key 4096
req -config C:\OpenSSL-Win32\bin\openssl.cfg -new -key server.key -out server.csr
rsa -in server.key -out server.key # removes passphrase
x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
# -------------------------------------------------------------------------------------------------------------------
# nginx SSL configuration
#
# http://nginx.org/en/docs/http/configuring_https_servers.html
# -------------------------------------------------------------------------------------------------------------------
# on linux certificate and key needs to be copied to /etc/ssl/ locations
cp /home/usr_name/server.crt /etc/ssl/certs/
cp /home/usr_name/server.key /etc/ssl/private/
# nginx.conf
# rewrites all http requests to https
server {
listen 80;
server_name yandere.developmententity.sk;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443; # on win its 8080
server_name foo.bar.baz; # on win its localhost
ssl on;
ssl_certificate /etc/ssl/certs/server.crt; # on win its cert/server.crt
ssl_certificate_key /etc/ssl/private/server.key; # on win its cert/server.key
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /var/www/; # on win its var/www/
index index.html;
}
...
}
# -------------------------------------------------------------------------------------------------------------------
# nginx HTTP basic auth
#
# http://wiki.nginx.org/HttpAuthBasicModule
# -------------------------------------------------------------------------------------------------------------------
nano /etc/nginx/.htpasswd
printf "user_name:$(openssl passwd -crypt user_password)\n" >> .htpasswd
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
# -------------------------------------------------------------------------------------------------------------------
# ArangoDB installation
#
# http://www.arangodb.org/manuals/current/DbaManual.html
# -------------------------------------------------------------------------------------------------------------------
mkdir /var/src/arangodb
cd /var/src/arangodb/
wget ...deb
dpkg -i ...deb # in case of upgrade to newer version user dpkg -P arangodb
# edit config file: nano /etc/arango/arango.conf
endpoint = tcp://127.0.0.1:8529
disable-authentication = no
# add new user (server needs to be shutdown)
/usr/sbin/arango-password user password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment