Monday, May 16, 2011

permission denied

//** Just follow the commands**// :-

Shutting down Mailman's master qrunner
No child with pid: 9522
[Errno 3] No such process
Stale pid file removed.
Processing user1
/bin/pwd: failed to stat `.': Permission denied
Processing user2
/bin/pwd: failed to stat `.': Permission denied
Processing user3
/bin/pwd: failed to stat `.': Permission denied
Processing user4
/bin/pwd: failed to stat `.': Permission denied
Processing user5
/bin/pwd: failed to stat `.': Permission denied



FIX
chmod +s /bin/pwd
/scripts/enablefileprotect 

Sunday, May 15, 2011

openvz

  //** Just follow the below commands **// :-

**********************************

  106  vzctl create 215 --ostemplate centos-5-i386-default --config vps.basic
  107  vzctl set 215 --onboot yes --save
  108  vzctl set 215 --hostname hk05.sinoservers.com --save
  109  vzctl set 215 --ipadd 91.207.192.206 --save
  110  vzctl set 215 --numothersock 120 --save
  111  vzctl start 215
  112  vzlist
  113  vzctl set 215 --diskspace 15G:17G --save
  114  ifconfig
  115  vzlist
  116  vzctl set 215 --diskspace 5G:7G --save

*********************************

Saturday, May 14, 2011

Park error

//** Just follow the given instruction below **// :--

/var/cpanel/users/username

/scripts/updateuserdomains
/var/named/domain.db
/etc/named.conf
/usr/local/apache/conf/httpd.conf
/etc/localdomains
/etc/userdomains
/etc/trueuserdomains
/etc/trueuserowners
/etc/valiases/domain.com
/etc/vdomainaliases/domain.com
/etc/vfilters/domain.com

********************************

If an etc directory exists for the addon it will fail.

********************************
rm -Rf /home/username/etc/domain.com/

************----------------------!!!!!!!!!!!-------------------------************

Friday, May 13, 2011

open a port in linux


Follow the command given below :-


*******************

How to open port 21 in iptables ::

-------------------------

root@fs8 [/home]# iptables -I INPUT -p tcp -i eth0 --dport 2222 -j ACCEPT

*******************

Wednesday, May 11, 2011

MySQL-Sock


//** Just follow the command given below **//:--

---------------------------------------

** First check if you have Spanned processes for mysql by the following command :--

netstat -apn or ps -aux 

Then.. 

service mysql stop 

Check for any mysql PID and give the following command with the Process ID 

kill -9 PID 

killall -e -9 mysqld 

Once the process is killed mysql is cleaned from the server. 

Check under /tmp partition if you the socket file created like ( mysql.sock --> /var/lib/mysql/mysql.sock ) If not then.. 

----------------------------------------

**Do the following :--

touch /var/lib/mysql/mysql.sock 

chmod 0777 /var/lib/mysql/mysql.sock

Then under /tmp 

ln -s /var/lib/mysql/mysql.sock mysql.sock ( this command will create the socket linked to /var/lib/mysql/ ) 

Finally restart mysql server if the problem still persist try to increase the mysql connections from /etc/my.cnf 
 
----------------------------------------*****************----------------------------------------

Tuesday, May 10, 2011

How to Mount Hard Drive


//** Just follow the given instruction below **// :--


*****************************************************************

root@server [~]# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 14593 117218241 83 Linux

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 19457 151990965 83 Linux


Once detected, /dev/hda1, just mount it using mount /dev/hda1 /backup assuming that the backup folder is already in place

root@server [/]# mount /dev/hda1 /backup/

root@server [/]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 141G 16G 118G 12% /
/dev/sda1 99M 11M 83M 12% /boot
tmpfs 1008M 0 1008M 0% /dev/shm
/usr/tmpDSK 485M 11M 449M 3% /tmp
/dev/hda1 111G 188M 105G 1% /backup


So the secondary drive has been mounted as /backup.

Now to make it permanent you will need to edit /etc/fstab.

/dev/hda1 /backup ext3 defaults 1 1

*****************************************************************

Mounted and completed.


Note:-
Please keep this information in your KB for future reference..

Monday, May 9, 2011

Modsec Rules

//** Just follow the given instruction Given below //** :-

   **< make sure that you have compiled apache with mod security >

-------------------------------------------------------------------------

     -  cd /usr/local/apache/conf;mkdir modsecurity;cd modsecurity;

     -  browse the url http://gotroot.com/ and choose tar file "All in one downloads for modsec 2.0-2.1" and wget it.
        It will dowload all rules for mod seurity.
        go to - /usr/local/apache/conf/modsecurity and wget the rules
        wget http://www.gotroot.com/downloads/ftp/mod_security/2.0/apache2/apache2-gotrootrules-modsec2.0-latest.tar.gz

     -  nano /usr/local/apache/conf/modsec.conf
        search line start with "include"
        delete that line and add line as below-
        Include "/usr/local/apache/conf/modsecurity/*.conf"

     -  service httpd restart.

-------------------------------------------------------------------------
All Done...