summaryrefslogtreecommitdiffstats
path: root/software/server-setup.page
blob: a436e10b5c19b71c5c173660f862704a507aba65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
format: rst
toc: no
...

=========================================
Generic Server Setup Tricks
=========================================

hostname
-------------
On Linux (at least ubuntu), the correct way to set a FQDN (fully qualified
domain name, eg killer.mail.webtwo.com; the hostname in this case would be
killer) is to edit both ``/etc/hosts``::

    <primary ip>    <fqdn>  <hostname>
    127.0.0.1   localhost

and ``/etc/hostname``::

    <hostname>

See also `debian </software/debian>`_ and 
`freebsd tricks </software/freebsd-tricks>`_.

bind
-------------
You probably want to hide your bind verison name to prevent scanning and 
attacks. Edit ``/etc/bind/named.conf`` or ``/etc/bind/named.conf.options``
and add this line to the options block::

    version "Withheld";

ntp
------------
ntp servers listen on port 37. 

temboz
----------
The temboz feed reader is started by::

    $ ./temboz --server &

in the appropriate directory.


File Hierarchy
------------------
/srv/
    Root for server files, scripts, and databases

/srv/http/
    Subdirectories for each virtual host live in this folder, with further 
    subdirectories for different dynamic services or static serving. /www/
    is for static html content.

/srv/http/default/www/
    Default pages like 404.html or 50x.html live here.

/srv/git/
    Bare git repositories are stored here; those with a file 
    ``git-daemon-export-ok`` get served up through a web interface and can be
    publically cloned.

/srv/backup/
    Database dumps and backups get put in subdirectories here; this whole
    directory can be rsynced to a remote location.

/srv/db/
    Database files (sqlite, passwds, etc) go in subdirectories here. Usually 
    has crazy r/w permissions!

Ruby on Rails Deployment: Phusion Passenger
-----------------------------------------------
This method replaces the nginx binary. It uses `<http://www.modrails.com>
Phusion Passenger`_ on Ubuntu Server::

    nano /etc/apt/sources.list  # uncomment the 'universes' lines
    sudo aptitude update
    sudo aptitude install ruby ruby1.8-dev rubygems build-essential libopenssl-ruby libssl-dev zlib1g-dev
    sudo aptitude install irb1.8 bzip2 unzip less screen wget curl sysinfo # Optional
    sudo gem install passenger
    sudo /var/lib/gems/1.8/bin/passenger-install-nginx-module