Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, 31 January 2014

[FIXED]"MySQL is running but PID file could not be found" error


While restarting MySQL service, you may get the error below ,
"MySQL is running but PID file could not be found"
In order to to fix this error , Lets try to do the below steps,

1) Create the directory " var/run/mysql ".
# mkdir /var/run/mysql
2) Now create  file " mysqld.pid " .
# touch mysqld.pid
3) change its ownership of " mysqld.pid " to "mysql:mysql "
# chown mysql:mysql mysqld.pid
4) Restart MySQL service by,
# /etc/init.d/mysql start
That's it, try this and let me know you've get the result. :-)

[FIXED] "(20014)Internal error: Error retrieving pid file logs/httpd.pid Remove it before continuing if it is corrupted." while starting Apache/httpd.


 " (20014)Internal error: Error retrieving pid file logs/httpd.pid
Remove it before continuing if it is corrupted.
"

If you see the above  Error while stopping httpd/Apache , Just do the following steps ,

1) change the directory to  " /usr/local/apache/logs " .
# cd /usr/local/apache/logs

2) remove/rename the file "httpd.pid" ,by

# mv httpd.pid httpd.pid.bak

3) just stop and restart the Httpd , by

# /etc/init.d/httpd start
4) now check the status of  Apache/httpd by,

# /etc/init.d/httpd status

That's it. :-) 

Wednesday, 29 January 2014

[FIXED] How to Change Ubuntu/Lubuntu's Root password using "sudo command"

After installing Ubuntu/LUbuntu ,we could able to login through a user ,we didn't have the root privillage at that time.

If you want to gain the root privilege we have to know the Root password , but we haven't 

Just do the below commands to gain root privilege ,

1) open  terminal/console.

2) type the command ,

$ sudo su

you want to enter your password, type your password.

stebu@DareLegacy:~$ sudo su
[sudo] password for stebu: 


3)Change the root password by,

# passwd

 root@DareLegacy:/home/stebu# passwd 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@DareLegacy:/home/stebu# 

Type your New password.

That's it. Now you can run as root. :-)
  

Executing Script/commands Using "alias command "

The alias command makes it possible to launch any command or group of commands,It allows a user to create simple names or abbreviations (even consisting of just a single character) for commands regardless of how complex the original commands are and then use them in the same way that ordinary commands are used.

Synax :
$ alias [-p] [name="value"]

In order to assign a lengthy command to a single character ,type

# alias <your_desired_string>="<command>"
 
example:
          # alias a="ls -l"

If you want make a alias for a script , type

$ alias <character>="sh <script_name>"
Example:

$ alias 1="sh exim.sh"
Multiple commands can be included in the same alias by inserting them within the same pair of quotation marks and separating them with semicolons(;). For example, the alias sp could be created to first launch hostname and then immediately launch hostname -i :
$ alias sp='hostname;hostname -i'

Now you can run the "Script/command" by typing the alias of it.
That's it. :-)


Change Cpanel default port.

We can  change Cpanel default port by editing the file " /var/cpanel/cpanel.config " .

 # vi  /var/cpanel/cpanel.config
Change  the below value to desired port ,

port=2082
  
This will change the  default Cpanel port, then run the below commands ,

# /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
# /etc/init.d/httpd restart

That's it :-)

Monday, 27 January 2014

SSH Login Without Password

Login to the Remote server via SSH  without password using ssh-keygen & ssh-copy-id.

"ssh-keygen creates the public and private keys. ssh-copy-id copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys. "
1) Generates ssh-key using ssh-keygen

$ ssh-keygen

Hit ENTER

2) Copy the public key to remote-host using ssh-copy-id


$ ssh-copy-id username@ipaddress -pXXXX


Here,

username - Type the username of remote host
ipaddress - Type IP address of remote host.
XXXX     - Type port number if any,(ignore " -pXXX " if the remote sever has no ssh port)

Note : You need to Enter a one-time password.That's it.

Now login to the remote server without password. :-)

Saturday, 25 January 2014

How to Backup Cpanel Reseller's Domains via Command

If you want to backup the domains under a reseller account in the server,It will be difficult to backup 100+ domains under the reseller account .

In order to backup Cpanel Reseller's Domains via script , Just do following two steps.

1) This command will generate the list of users under the reseller 'reseller'.
# cat /etc/trueuserowners | grep reseller | cut -d: -f1 > reseller_list.txt
Note : The file /etc/trueuserowners shows which reseller owns each account.


Now "reseller_list.txt" generated in your " pwd " contains the list of users under the reseller named ' reseller'.

To backup the domains under the reseller to a path /backup, you can execute the command :
# for i in `cat reseller_list.txt` ; do /scripts/pkgacct $i /backup; done

That's it . :-)