Saturday, January 15, 2011

Addind a startup script to be run on startup Debian

Oops, Since i'm just a newbie in handling debian server, I've noticed that some of my scripts are not working after a series of reboot and I've found out that /etc/rc.local does not work on debian linux. Looking over the internet I've found some link to point to my direction.

Answer is this : 
1. Ok so suppose you have a script you want to run each time you boot up( I have a script to start my internet connection with authentication).It is pretty easy 1. Write a script and put it in/etc/init.d/ directory. 
  Lets say you call it man.
2. Then run %update-rc.d man defaults.
3. Do not  forget to make the script you write executable , it can be done by chmod +x man.
% man update-rc.d for more information. It is a Debian utility to install scripts. The option “defaults” puts a link to start FOO in run levels 2, 3, 4 and 5. (and puts a link to stop man into 0, 1 and 6.)
Also, to know which runlevel you are in, use the runlevel command


Friday, January 14, 2011

Rsnapshot - remote filesystem snapshot utility

rsnapshot is a filesystem snapshot utility for making backups of local and remote systems.
For reference :
b. How to reference:
     b1. rsnapshot Howto
     b2. rsnapshot Howtoa

Wednesday, January 12, 2011

Apache VirtualHost

I'm looking a solution for this one on apache configuration.
Problem: URL : test.sample.org/tes1 = test1.sample.org
and i want to redirect it to test1.sample.org if i have existing sud domain

Below is the solution : I'm running my Apache 2.2 on CentOS 5.0

Server configuration

NameVirtualHost 172.20.30.40

<VirtualHost 172.20.30.40>
# primary vhost
DocumentRoot /www/subdomain
RewriteEngine On
RewriteRule ^/.* /www/subdomain/index.html
# ...
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub1
ServerName www.sub1.domain.tld
ServerPath /sub1/
RewriteEngine On
RewriteRule ^(/sub1/.*) /www/subdomain$1
# ...
</VirtualHost>

<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub2
ServerName www.sub2.domain.tld
ServerPath /sub2/
RewriteEngine On
RewriteRule ^(/sub2/.*) /www/subdomain$1
# ...
</VirtualHost> 



Reference:

Tuesday, January 11, 2011

LMCompatibilty on Windows 7

 Windows 7 starter to enable access on my Samba fileserver and i found this solution over google searching.

I found that on my Windows 7 starter I need to change the registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SeCEdit\Reg Values\MACHINE/System/CurrentControlSet/Control/Lsa/LmCompatibilityLevel

key "Value type" from 4 to 2

Reference: