Monday, May 23, 2011

Commands to check errors in configuration files

In Linux, Once the service configuration has been done we can check the configuration files for errors.

Check Samba configuration file for errors with "testparm" command.
# testparm

Check HTTP(apache) configuration file for errors with the following commands
# apchectl configtest
# httpd -t
# service httpd configtest
(You can use any of the above commands to check the errors for apache)

Check SSH configuration file for errors
# sshd -t

Check  DNS configuration file for errors
# named-checkconf  /var/named/chroot/etc/named.conf
The above command will check the configuration file for errors

If you want to check the DNS zone file for errors , use the following command
Syntax: named-checkzone <domain name>  <path to zone file>
Ex: # named-checkzone  www.example.com  /var/named/chroot/var/named/zone.example.com

If the commands display the result as "OK" then the service is properly configured and you can restart the services or if you get any errors fix them.






Wednesday, May 18, 2011

Backup and Restore the Subversion Repository

It is a good practice backup Subversion repository to avoid any loss of data and sometimes you may need to move the svn repository from one server to another server.You can move your repository to another server with the following method.

1. Backup your repository( Create dump)
# svnadmin dump /path to /repository   >  repositoryname.dump

2. Copy the dump file to the new server
# scp -r repositoryname.dump   username@ipaddress:/destination path
Here destination path is location on the target server where the dump file has to be copied.

3. Create a new Repository on the target server
# svnadmin create <repositoryname>
Ex: #svnadmin create /var/www/testrepo

4.Import the dump file to the new repository.
# svnadmin load  /path to repository  <  repositoryname.dump