# first stop display manager, assuming gdm is used
sudo service gdm stop
# generate new configure file for X, the file created is "xorg.conf.new" in current directory
sudo Xorg -configure
# move configure file to target directory
sudo mv xorg.conf.new /etc/X11/xorg.conf
# restart display manager, assuming gdm is used
sudo service gdm start