Monday, July 13, 2009

X server listening on tcp on ubuntu

This howto will make your X server to listen on tcp/6000 and so it will be remotly accessible. It has strong security consequences, such as sniffing your keyboard or even pressing keys for you. So be sure to know what you do.

Step 1: edit gdm.conf to enable tcp listen
sudo nano /etc/gdm/gdm.conf

Find the line containing DisallowTCP=true and change it to DisallowTCP=false

Step 2: Kill the current gdm
sudo killall gdm

Step 3: login on a text terminal and relaunch gdm
sudo /usr/sbin/gdm

Step 4: check all is ok
$ sudo netstat -ntlp | grep 6000
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 13765/X
tcp6 0 0 :::6000 :::* LISTEN 13765/X

Sunday, July 12, 2009

Installing Openvz on Ubuntu 9.04

Unfortunatly, Ubuntu 9.04 doesn't provide precompiled kernel for openvz. So here is how to install openvz on ubuntu 9.04 anyway.
Step 1: install the userspace tools
sudo apt-get install vzctl vzquota

Step 2: Download and install openvz kernel from debian repository
wget http://ftp.fr.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-2-openvz-686_2.6.26-17_i386.deb
sudo dpkg -i linux-image-2.6.26-2-openvz-686_2.6.26-17_i386.deb

Step 3: reboot and check all is ok
uname -r
It returns the version of the running kernel. So if all is ok, it should be
2.6.26-2-openvz-686

You are done! If needed, you can learn basic openvz usage here. More details can be found on openvz main site.

Wednesday, July 1, 2009

symfony and log rotation via logrotate

Here is how to configure logrotate on your symfony project. I am well aware of the pure symfony way but i prefere this one. Just an habit i guess.

Step 1: Here is the file to put in config/logrotate/mysfproject.logrotate.conf
/path/to/your/symfony/project/log/*.log {
rotate 10
daily
compress
copytruncate
missingok
}
Step 2: symlink the file in the logrotate system configuration directory
sudo ln -s /path/to/your/symfony/project/config/logrotate/mysfproject.logrotate.conf /etc/logrotate.d/


You are done!. the logs of your project will be rotated automatically every days, previous 10 days will be kept, previous days will be compressed.
Share/Save/Bookmark