Server

Ansible How To

2017-01-22. Category & Tags: Ansible, Server, Cloud/Cluster, Management, DevOpt, Puppet

A simple video tutorial
OBS: ansible uses py, and py calls /bin/sh, NOT bash !

PRE-CONFIG #

suggested: use ssh-pub-key auth without passphrase.

INSTALL #

Optioanl: add ppa:ansible/ansible
installation:

sudo apt-get update && \
sudo apt-get install ansible

HOSTS #

vim /etc/ansible/hosts

master.ip.1
[slaves]
slave.domain1
slave.ip.addr.2
[slavesGroup2]
slave.domain2
slave.ip.addr.1

(see ref to give hosts’ names individually.)

SLAVE USERNAME #

sudo mkdir /etc/ansible/group_vars && \
sudo echo '---' > /etc/ansible/group_vars/all && \
sudo echo 'ansible_ssh_user: root' >> /etc/ansible/group_vars/all

(see DigitalOcean ref to config hosts individually.)

...

Setup Remote Access (VNC) of Linux Servers

2016-12-02. Category & Tags: VNC, Server, Linux, XServer

Tested in Ubuntu 16.04 desktop Gnome+Unity in Vmware.
OBS: pure server will automatically start X in reboot and will lack of something, e.g. Default Terminal etc.

FIREWALL #

TCP port 5900+N (N is monitorId, starts from 1.)

TIGHT.VNC AS SERVER #

TightVnc allows us to start from a server without X11 and do everything in command line, remotely.

install (either already with or w/o desktop) #

sudo su: use root can avoid weird problems, see “ps”.

...

Installing & Using Nginx HTTP (and Reverse Proxy) Server in Ubuntu LTS

2012-04-24. Category & Tags: HTTP, Server, Reverse Proxy

nginx is a great alternative to apache2, it is better to handle static web pages and files. another one is lighttpd which is optimized for long-time keep-alive (a lot of connections).

Install in Ubuntu #

18.04 ~ 22.04 LTS #

sudo apt install -y software-properties-common && sudo add-apt-repository ppa:nginx/stable

sudo apt update && \
sudo apt install -y nginx nginx-extras && \
systemctl status nginx

ref: digitalocean

10.04 LTS #

sudo -s
apt-get install gcc g++;
wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2 (seems hard-coded version in nginx v1.2; otherwise, such as me, ln -s xxx.so.xxx ...); tar xvjf ...; cd ...; ./configure; make; make install;
cd nginx; ./configure --without-http_gzip_module (do not need and do not want in experiments); make; make install;
/usr/local/nginx/conf# vim nginx.conf; keepalive_timeout  0\. #server_name non-local???

the second time when i started it, it could start work, not the first time. do not know why. try nginx; nginx -s stop; nginx.

...