Added server goodies

This commit is contained in:
Felipe M 2016-12-19 14:44:02 +01:00
parent 002f3dd67f
commit 993160a64a
4 changed files with 89 additions and 0 deletions

20
server/emacs.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
# Emacs install script used into scaleway.c1 servers due to ARM arch
EMACS_VERSION="25.1"
# Asume root
cd
# Install dependencies
yum install -y ncurses.devel
# Download package
curl -O http://ftp.rediris.es/mirror/GNU/gnu/emacs/emacs-$EMACS_VERSION.tar.xz
# Configure, Make, and Install
./configure
make
make install

21
server/nginx.conf Normal file
View file

@ -0,0 +1,21 @@
server {
listen *:80;
server_name www.fmartingr.com;
return 301 http://fmartingr.com$request_uri;
}
server {
listen *:80;
server_name fmartingr.com;
server_tokens off;
client_max_body_size 1M;
access_log /var/log/fmartingr.com/nginx-access.log;
error_log /var/log/fmartingr.com/nginx-error.log;
location / {
alias /var/www/fmartingr.com/html/;
autoindex off;
}
}

15
server/nginx.service Normal file
View file

@ -0,0 +1,15 @@
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target

33
server/nginx.sh Normal file
View file

@ -0,0 +1,33 @@
#!/bin/bash
# Nginx install script used into scaleway.c1 servers dure to ARM architecture
NGINX_VERSION="1.11.7"
# As root
cd
# Install nginx requirements
yum install -y pcre-devel zlib-devel
# Download nginx package
curl -O http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
tar xf nginx-$NGINX_VERSION.tar.gz
cd nginx-$NGINX_VERSION
# Configure, make and Install
./configure
make
make install
# Symlink binary
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx
# Now create the service file as in the template in
# /etc/systemd/system/nginx.service
# Uncomment the pid directive from the nginx conf and change its value to
# /run/nginx.pid
# add rule to iptables
# -A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT