That’s not really a tutorial. I just took notes of what I did (for doing better next time). I may omit some things, fell free to correct me / complete me in comments or whatever :)
- create your server on the gandi interface, choose expert mode, debian
- myserv : The name of my server
- asenar : can be my username on the server or my username in my local machine
- let’s say I will surrounds all bloc of code will looks like this:
// my code here
- That’s currently a draft, I don’t know really how I will organize that at the end.
- very first connection, basic partitionning, I may prefer to add an other partition for /var later..
but that’s will be later
- test
#-BEGIN_SRC bash
umount /dev/xvdb
tune2fs -O extents,uninit_bg,dir_index /dev/xvdb fsck -pf /dev/xvdb mount -t ext4 /dev/xvdb /srv/sweet echo “/dev/xvdb /home ext4 defaults 1 2” >> /etc/fstab resize2fs /dev/xvdb
chown root:root srv/sweet
reboot 0
du -Th > Filesystem Type Size Used Avail Use% Mounted on > /dev/xvda1 ext4 3,0G 872M 2,0G 31% / > tmpfs tmpfs 248M 0 248M 0% /lib/init/rw > udev tmpfs 10M 84K 10M 1% /dev > tmpfs tmpfs 248M 4,0K 248M 1% /dev/shm > tmpfs tmpfs 24K 16K 8,0K 67% /var/gandi > /dev/xvdb ext4 3,0G 358M 2,5G 13% /home > /dev/xvdb ext4 3,0G 358M 2,5G 13% /srv/sweet
I’m sick of theses “locale: Cannot set LC_CTYPE to default locale: No such file or directory”
locale-gen fr_FR.UTF-8
dpkg-reconfigure locales
echo “deb http://backports.debian.org/debian-backports squeeze-backports main” /etc/sources.list
echo "PATH="$HOME/bin:$PATH" >> /etc/bash.bashrc
- a good prompt will be configured later aptitude install bash-completion
- todo only if bash/bashrc didn’t do it
echo ". /etc/bash_completion" >> /root/.bashrc
aptitude install sudo
apt-get install -t squeeze-backports vim
default editor is VIM
update-alternatives --config editor
- apt-get install -t squeeze-backports git
wget https://raw.github.com/Asenar/dotfiles/master/.gitconfig --output-document /etc/gitconfig
cd ~ git clone https://github.com/Asenar/dotfiles .dotfiles sudo ln -s ~/.dotfiles/vim ~/.vim sudo ln -s ~/.dotfiles/vimrc ~/.vimrc sudo ln -s ~/.dotfiles/bin ~/bin mkdir ~/bin wget https://raw.github.com/benmills/vim-bundle/master/vim-bundle –output-document ~/bin/
sudo ln -s ~/.dotfiles/bashrc ~/.bashrc
aptitude install libapache2-mod-evasive
- logwatch is cool, but only once per week seems ok for me
aptitude install logwatch
mv /etc/cron.daily/00logwatch /etc/cron.weekly/00logwatch
- iptables / shorewall
aptitude install shorewall
sed -i "s#startup=0#startup=1" /etc/default/shorewall
cp usr/share/doc/shorewall/default-config/* /etc/shorewall
#
#
#
# ############################################################################### #ZONE TYPE OPTIONS IN OUT
fw firewall net ipv4
#
#
#
# ############################################################################### #ZONE INTERFACE BROADCAST OPTIONS net eth0 detect
#
#
#
# ############################################################################### #SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:
$FW net ACCEPT net all DROP all all REJECT info
#
#
#
# #################################################################################################################################################### #ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME
ACCEPT net $FW tcp ssh,http,https Ping/ACCEPT net $FW Trcrt/ACCEPT net $FW #SECTION ESTABLISHED #SECTION RELATED #SECTION NEW
#
#
#
# ############################################################################### #ADDRESS/SUBNET PROTOCOL PORT 91.240.109.0/24
aptitude install apache service apache2 stop
aptitude install php5 php5-mysql php5-suhosin php5-mcrypt php5-gd vim /etc/php5
- all default, enum.marinetti.fr
- see PART 4
aptitude install mysql-client-5.1 mysql-client-5.1
a2enmod rewrite
- simple way to deploy website, give people a way to contribute
sudo su root useradd -c “gitolite user” -m -s bin/bash git cd /usr/local git clone git://github.com/sitaramc/gitolite sudo su git /usr/local/gitolite/install -to $HOME/bin
exit sudo su git echo “my public key” > asenar.pub gitolite setup -pk asenar.pub
gl-setup asnear.pub
########### TEST FROM LOCAL ################### ssh git@enun info #>asenar@asenar-home:~$ ssh git@enun info #>hello Asnear, this is git@enun running gitolite3 v3.3-0-g1fefb1c on git 1.7.10.4 #> #> R W gitolite-admin #> R W testing ############ BACK ON THE SERVER, let’s install LAMP