Setting up NGINX, PHP with CGI on Ubuntu 10.10 Linux

1. Installing apt-get install nginx php5 php5-cgi php5-cli 2. Make your site folder under document root mkdir -p /var/www/newsitechown -R www-data www-data /var/www/ 3. Create new file /etc/nginx/sites-available/newsite and put below entries in it server { listen 80; server_name newsite.com www.newsite.com; access_log /var/logs/nginx/access.log; error_log /var/logs/nginx/error.log; location / { root /var/www/newsite; index index.html index.htm index.php; }…

Encrypting & Decrypting TAR file with OpenSSL

To Encrypt TAR file with OpenSSL tar -cP <directory to archive> | openssl des3 -salt -pass pass:password  >  filename.tar      —–> Here at password please put your password To Decrypt TAR file OpenSSL cat filename.tar  | openssl des3 -salt -d -pass pass:password | tar -x -C path-to-extract Please Note: Here I have used "des3" encryption. You can…

Removing RAID1 completely with Mdadm

RAID device –> /dev/md1 –> Created of 2 Disks /dev/sda & /dev/sdb mdadm –detail /dev/md1 –> This will give detail information on /dev/md1 cat /proc/mdstat  –> This will give information of md device mdadm –stop /dev/md1  –> This will stop md1 device mdadm –zero-superblock /dev/sdamdadm –zero-superblock /dev/sdb Also Remove entry of /dev/md1 from /etc/mdadm.conf and…

Autologin with getty on linux console

1. Create autologin.c and put following code in it. int main() { execlp( “login”, “login”, “-f”, “andrew”, 0); } 2. Compile it with following command: cc autologin.c -o autologin 3. Do following changes in /etc/inittab Please add “-n -l /usr/sbin/autologin” immidiate after “/sbin/getty” Your line will be like this: c1:12345:respawn:/sbin/agetty -n -l /usr/sbin/autologin 38400 tty1…

Creating link with mount –bind

In linux users home folders are in /home. Many times we need it in /var/www/html but we do not want to change default setting. Then there is a simple workaround for this. Step 1. : Just create directory home under /var/www/html Step 2. : mount –bind /home /var/www/html/home Step 3. : Put above command in…

Setting up Samba PDC for Multiple domains

We will setup 2 domains mydomain1 & mydomain2 on 1 linux machine with samba. 1. Create 2 samba config files in /etc/samba/     a. smb.conf_mydomain1     b. smb.conf_mydomain2 2. Your smb.conf_mydomain1 will look like below: [global]         workgroup = mydomain1         netbios name =server1         time server = Yes…

Virtual Hosting in Sendmail

Sendmail 8.13..CentOS 5.1 1. Check following line should be there in /etc/mail/sendmail.mc FEATURE(`virtusertable’, `hash -o /etc/mail/virtusertable.db’)dnlFEATURE(always_add_domain)dnlFEATURE(use_cw_file)dnl 2./etc/mail/virtusertable, which will look something like this: abc@domain1.com    abc xyz@domain2.com  xyz abc@domain2.com    abc2 3. makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable 4. Put host alliases in /etc/mail/local-host-names. domain1.com domain2.com

Port forwarding in Linux with Iptables

I have one Linux Machine. It has 2 interfaces. eth0 will have Live IP and which will be accessible across the internet. eth1 will have internal IP and can only be connected across LAN.Here I want to forward all request which come to my internetIP should get forwarded to my internal web server. To do…

Sharing Printer for Windows from Linux with Samba

Sharing Printer for Windows from Linux –> smb.conf will be =============> [global]         dos charset = ASCII         display charset = UTF-8         workgroup = WORKGROUP         netbios name = PRINT         security = SHARE         max xmit = 65535         deadtime = 15         socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=16384 SO_RCVBUF=16384         printcap name…

Resolution for Wine error in CentOS linux

I am using CentOS 5.1 with Wine-0.9.57. While executin Program “Write.exe” with wine I was getting following error: [neel_g@test drive_c]$ wine write.exe preloader: Warning: failed to reserve range 00000000-60000000preloader: Warning: failed to reserve range 00000000-60000000preloader: Warning: failed to reserve range 00000000-60000000err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please reportpreloader: Warning: failed to reserve…