shop for weather stations on my new zlioshop
Today i want to introduce my new zlioshop about weather stations. here is a preview of the products you will find on it.
isn’t it nice ?
Posted in mes sites | No Comments »
Today i want to introduce my new zlioshop about weather stations. here is a preview of the products you will find on it.
isn’t it nice ?
Posted in mes sites | No Comments »
To continue my tutorial on how to install VMware Server on debian Etch we will now install the vmware tools in one of our debian Virtual machines. The wmware tools are needed if you want to be able to stop a virtual machine from the command line using vmware-cmd and it can also help to correct the Time sync problem with virtual machines running debian.
First we install the required packages:
apt-get install autoconf automake binutils cpp gcc linux-headers-$(uname -r) make psmisc
Now we need to connect to our vmware server using the vmware server console. We need to start the debian virtual machine in order to install the vmware tools. As soon as your virtual machine is started you can right click on it’s name in the inventory and click on “Install vmware tools”. Log into your virtual machine and do the following to mount the virtual cdrom
mount /dev/cdrom
You should be able to see your cdrom using the command mount. Mine is mounted at /media/cdrom0
You just have to copy the vmware tools to another location and install it.
cd /media/cdrom0
cp VMwareTools-1.0.4-56528.tar.gz /tmp
cd /tmp
tar -zxvf VMwareTools-1.0.4-56528.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
Just follow the installation script and press enter to accept the default for every question.
Et voila !
You may notice that your virtual machine clock is running to fast or to slow. In this case you need to edit the configuration file for your virtual machine (the .vmx file) and change the value of tools.syncTime to “TRUE”.
You also need to edit the file /boot/grub/menu.lst and add the following kernel options: clocksource=pit nosmp noapic nolapic nohz=off
Your file should then look something like this:
[...]
title Debian GNU/Linux, kernel 2.6.18-5-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sda1 ro clocksource=pit nosmp noapic nolapic nohz=off
initrd /boot/initrd.img-2.6.18-5-686
savedefault
[...]
Another cool tip to finish ? ok let’s go !
You may need to copy a virtual machine and run another copy of it at the same time. In this case you will notice that if you change the identifier of the virtual machine (you have to if you want to run them at the same time) the network interface is changing from eth0 to eth1 and incrementing each time you duplicate the machine. To correct this you simply need to delete one file in your virtual machine and reboot it:
rm -f /etc/udev/rules.d/z25_persistent-net.rules
Any questions ? ![]()
Posted in linux, tutorials | 2 Comments »
After a long time wihtout any post here is a simple How to install vmware server on debian etch.
We start by installing the necessary packages:
apt-get update
apt-get upgrade
apt-get install libx11-6 libx11-dev libxtst6 libxext6 libxt6 libice6 libsm6 libxrender1 xinetd
apt-get install linux-headers-`uname -r` build-essential sysvinit-utils psmisc gcc binutils-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb libc6-dev-amd64 lib64gcc1 gcc-2.95-doc
Now we download and install VMware Server:
cd /usr/src
wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.tar.gz
tar -zxvf VMware-server-1.0.4-56528.tar.gz
cd vmware-server-distrib/
./vmware-install.pl
Simply press enter for all the questions and maybe change the path where you will store your virtual machines to something easy to find ( I put all my virtual machines in /var/VMachines)
You will need to register for your free serial number at the following url: http://register.vmware.com/content/registration.html
That’s all ! VMware server is installed.
If you intend to connect to this machine remotely using the vmware server console then you need to edit the file /etc/vmware/pam.d/vmware-authd. Simply replace the content of your file by this:
#%PAM-1.0
auth sufficient pam_unix.so shadow nullok
auth required pam_unix_auth.so shadow nullok
account sufficient pam_unix2.so
account required pam_unix_acct.so
Now restart vmware and install it at boot time:
update-rc.d vmware defaults 20
/etc/init.d/vmware restart
You can download a debian etch minimal install ready to be used:
cd /var/VMachines
wget http://mirror.o-line.net/vmware/debian-4.0r1-netinst.7z
apt-get install p7zip
p7zip -d debian-4.0r1-netinst.7z
Easy isn’t it ?
Posted in linux, tutorials | No Comments »
Voici ma nouvelle boutique chez zlio: flyingtoys.zliostore.com
Pour ceux qui aiment les helicoptères et avions thermique ou electrique, allez jetter un petit coup d’oeil !
Posted in fun, mes sites | No Comments »
Today i finally found how to stop vi to insert tab or comment my text when i paste something:
simply input the command
:set paste
then paste what you want to paste and
:set nopaste
Hoo and by the way, from now on, i will start posting only in english
Posted in linux | 2 Comments »
Comme promis voici le 2èm post de la journée pour compléter le tutorial d’installation d’une machine debian chez ovh.
Nous venons juste de voir comment installer et configurer un firewall pour protéger notre machine, Voyons maintenant comment utiliser munin et monit pour surveiller notre serveur.
Munin nous fourni des graphs sur l’état de notre machine: ressources utilisées, traffic, queue du serveur postfix et j’en passe.
Monit lui monitor nos process et nous informe si quelque chose ne va pas. De plus il est capable de redémarrer tout seul un service qui ne fonctionne pas comme il faut.
On install d’abord munin:
apt-get install munin munin-node
Puis on edite le fichier de configuration pour rajouter le nom de notre machine:
vi /etc/munin/munin.conf
Ca doit ressembler à ca:
# a simple host tree
[nsxxxxx.ovh.net]
address 127.0.0.1
use_node_name yes
Il ne nous reste plus qu’à proteger l’accès a munin avec un htaccess:
vi /var/www/munin/.htaccess
en voici le contenu
AuthType Basic
AuthName "Admin Only"
AuthUserFile /var/www/.htpasswd
<limit GET PUT POST>
require valid-user
</limit>
puis on crée le password:
htpasswd -c /var/www/.htpasswd admin
Voila, si tout va bien on peut maintenant se connecter à http://nsxxxxx.ovh.net/munin à l’aide du user admin et du pass qu’on viens de choisir ! Par contre il faut attendre au moins 5 a 10 minutes pour voir quelque chose sur les graphs.
Passsons maintenant a Monit
Comme toujours, installation super simple:
apt-get install monit
Puis on edite le fichier de configuration
vi /etc/monit/monitrc
Voici le fichier de configuration dont on a besoin pour surveiller notre machine debian et tous les services que nous avons installés dans mon premier tutorial sur debian ovh.
set daemon 60
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@yourdomain.com }
set alert yourmail@yourdomain.com
set httpd port 2812 and
allow admin:yourmonitpass
# check FTP server
check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp then restart
if 5 restarts within 5 cycles then timeout
# check SSH server
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
# check MySQL
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout
# check WEB server
check process apache with pidfile /var/run/apache2.pid
group www
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed host ns28885.ovh.net port 80 protocol http
and request "/monit/token" then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
# check MAIL server
check process postfix with pidfile /var/spool/postfix/pid/master.pid
group mail
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if failed port 25 protocol smtp then restart
if 5 restarts within 5 cycles then timeout
il faut encore éditer le fichier /etc/default/monit pour que monit puisse démarrer:
vi /etc/default/monit
On change startup à 1
startup=1
pour pouvoir monitor apache et vérifier que les sites web répondent on cree un fichier que monit viendra check:
mkdir /var/www/monit
echo "Hello" > /var/www/monit/token
Et finalement on lance monit:
/etc/init.d/monit start
Et voila ! On peut maintenant se connecter a l’interface web de monit a l’url suivante: http://nsxxxxx.ovh.net:2812
Nous avons maintenant une machine debian prète à héberger nos sites et emails. N’hésitez pas à me poser des questions si quelque chose n’est pas clair.
Posted in linux, tutorials | 1 Comment »
Aujourd’hui 2 petits post qui vont venir completer mon premier post sur mon installation debian chez ovh. Le premier tout de suite avec la configuration d’un firewall simple pour notre machine.
On verifie si iptables est installé sur la machine (normalement oui)
iptables -v
iptables v1.3.6: no command specified
Try `iptables -h' or 'iptables --help' for more information.
si on obtiens un resultat comme celui la c’est ok et on verifie si il existe déjà des règles:
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
aucun règle actuellement: notre firewall accepte donc tout le traffic.
créons nos regles dans le fichier /etc/init.d/firewall
vi /etc/init.d/firewall
#!/bin/sh
# les regles de mon firewall
IPT=/sbin/iptables
case "$1" in
start)
$IPT -F INPUT
$IPT -I INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port ftp -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port ssh -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port smtp -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port pop3 -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port domain -j ACCEPT
$IPT -A INPUT -i eth0 --proto udp --destination-port domain -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port http -j ACCEPT
$IPT -A INPUT -i eth0 --proto tcp --destination-port https -j ACCEPT
$IPT -A INPUT -i eth0 --proto icmp -j ACCEPT
$IPT -A INPUT -i eth0 -j DROP
exit 0
;;
stop)
$IPT -F INPUT
exit 0
;;
*)
echo "Usage: /etc/init.d/firewall {start|stop}"
exit 1
;;
esac
Pour faire simple on accepte toutes les connection déjà établies et on authorise les connections à nos services: FTP, SSH, SMTP, POP3, DNS et HTTP.
On rajoute les droits d’éxecution au fichier et on démarre notre firewall
chmod +x /etc/init.d/firewall
/etc/init.d/firewall start
Il ne nous reste plus qu’à installer ce script au boot pour que notre firewall se relance automatiquement. Attention ne faire cette manipulation que si vous êtes sur d’avoir access à votre machine par ssh !
update-rc.d firewall defaults
Et voila ! Simple non ? prochain post: monitoring de notre machine avec munin et monit
Posted in linux, tutorials | 1 Comment »
Voila je suis a l’aéroport et dans qqes minutes je monte dans l’avion pour bordeaux. Ca doit faire au moins 5 ans que je n’y ai pas mis les pieds, ca va me faire bizarre!
Je continue mon post sur l’installation debian dès que je rentre. Je pars seulement pour 2 jours pour ceux qui attendent la fin avec impatience
Bon petite mise à jour: je suis à paris et j’ai raté la correspondance pour bordeaux !
et voil plus que 3 heures à attendre!
Posted in fun | No Comments »
Description étape par étape de mon installation à partir d’une installation debian minimale chez OVH.
serveur DNS: bind9
Serveur Web: Apache2+php5+mysql+phpmyadmin
Serveur mail: postfix+courrier avec antivirus et antispam
Serveur FTP: ProFTPD
Avant tout il serait bon de jeter un coup d’oeil a mon post précédant sur Putty afin de pouvoir se connecter a notre machine a l’aide de clef SSH.
Maintenant on se connecte a notre machine avec le pass recu par email pour le compte root juste apres la réinstallation de la machine et on copie notre clef publique (voir tutorial putty).
vi ~/.ssh/authorized_keys2
Normalement on doit deja trouver la clef de ovh donc on copie la notre a la fin du fichier juste apres celle de ovh.
On test maintenant de se connecter avec notre clef et si tout se passe bien on peut maintenant désactiver l’authentification par mot de passe.
vi /etc/ssh/sshd_config
on modifie les 2 lignes suivantes
PasswordAuthentication no
UsePAM no
attention il faudra absolument avoir votre clef sur vous pour vous connecter à votre machine !
On met à jour notre system avec les 2 lignes suivantes:
apt-get update
apt-get upgrade
Puis on installe quelques outils necessaires pour la suite:
apt-get install build-essential bison flex dpkg-dev
On install Quota et on modifie le fichier /etc/fstab pour activer le quota sur notre partition /
apt-get install quota
vi /etc/fstab
on rajoute simplement ,errors=remount-ro,usrquota,grpquota juste après defaults pour la partition /
puis
touch /quota.user /quota.group
chmod 600 /quota.*
mount -o remount /
quotacheck -avugm
quotaon -avug
Posted in linux, tutorials | 11 Comments »