Thursday 30 July 2009

How do I enable/disable eAccelerator?

eAccelerator is used improve performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution.
If  eAccelerator is installed on serverwide then it is enable for all account or you can enable it eAccelerator by makeing  a .htaccess file in your ‘htdocs’ directory, and add the following lines:



php_flag eaccelerator.enable 1
php_flag eaccelerator.optimizer 1

if you’d like to turn off eAccelerator for a particular directory, put the following in a .htaccess file in that subdirectory:



php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

If php suexec is enabled on server then create php.ini file and following code in that file to disble eAccelerator.



eaccelerator.enable 0
eaccelerator.optimizer 0

How do I enable/disable eAccelerator?

eAccelerator is used improve performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution.
If  eAccelerator is installed on serverwide then it is enable for all account or you can enable it eAccelerator by makeing  a .htaccess file in your ‘htdocs’ directory, and add the following lines:



php_flag eaccelerator.enable 1
php_flag eaccelerator.optimizer 1

if you’d like to turn off eAccelerator for a particular directory, put the following in a .htaccess file in that subdirectory:



php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

If php suexec is enabled on server then create php.ini file and following code in that file to disble eAccelerator.



eaccelerator.enable 0
eaccelerator.optimizer 0

How do you repair the corrupted MySQL tables?

Error: Table ‘tbl_ name’ doesn’t exist databasename_tablesname.frm can’t open


If you get either of the following errors, it usually means that no table exists in the current database with the given name:


Table ‘tbl_name’ doesn’t exist


Can’t find file: ‘tbl_name’ (errno: 2)


A ) In some cases, it may be that the table does exist but that you are referring to it incorrectly:


Because MySQL uses directories and files to store databases and tables, database and table names are case sensitive if they are located on a file system that has case-sensitive filenames.Even for file systems that are not case sensitive, such as on Windows, all references to a given table within a query must use the same letter case.


B ) In some cases, it may be that the table exist but same error occurs then


1 ) Check the permission and ownership of database i.e. it should be same below


drwx—— 2 mysql mysql cpanelusername_dbname.


2) If the permission are corrects but same error occurs then it seems that your database table may be corrupts then there are following way to repair the DB


a) Go to whm >>SQL Services >> Repair a Database >> select database name and click Repair Database.


b) Go to cpanel >> mysql section MySQL Account Maintenance >> search database then click on Repair.


C) You can repair it though shell when mysqld server is running


i) login in mysql to that particular user by using following command



mysql>mysql –u databaseusername –p databasename

ii) select particular database



mysql> use databasename;

iii) Check whether database table is corrupted or not if following command output shows null value then it should be corrupts otherwise it is fine



mysql>show table status like ‘table name’G; Or
mysql>check table tablename ;

iv)If it is corrupts then use the following command to repair that particular database table.



mysql>repair table tablename;

D] You can repair it though shell when mysqld server is not running


Repairing MyISAM mySQL Tables/Databases:



# cd /var/lib/mysql/DBNAME

# myisamchk tablename.MYI

Repairing ISAM mySQL Tables/Databases:



# cd /var/lib/mysql/DBNAME
isamchk tablename.MYI

where


-c –> check database is corrupted or not
-r –> recorver
-o –> optimise the database

How do you repair the corrupted MySQL tables?

Error: Table ‘tbl_ name’ doesn’t exist databasename_tablesname.frm can’t open


If you get either of the following errors, it usually means that no table exists in the current database with the given name:


Table ‘tbl_name’ doesn’t exist


Can’t find file: ‘tbl_name’ (errno: 2)


A ) In some cases, it may be that the table does exist but that you are referring to it incorrectly:


Because MySQL uses directories and files to store databases and tables, database and table names are case sensitive if they are located on a file system that has case-sensitive filenames.Even for file systems that are not case sensitive, such as on Windows, all references to a given table within a query must use the same letter case.


B ) In some cases, it may be that the table exist but same error occurs then


1 ) Check the permission and ownership of database i.e. it should be same below


drwx—— 2 mysql mysql cpanelusername_dbname.


2) If the permission are corrects but same error occurs then it seems that your database table may be corrupts then there are following way to repair the DB


a) Go to whm >>SQL Services >> Repair a Database >> select database name and click Repair Database.


b) Go to cpanel >> mysql section MySQL Account Maintenance >> search database then click on Repair.


C) You can repair it though shell when mysqld server is running


i) login in mysql to that particular user by using following command



mysql>mysql –u databaseusername –p databasename

ii) select particular database



mysql> use databasename;

iii) Check whether database table is corrupted or not if following command output shows null value then it should be corrupts otherwise it is fine



mysql>show table status like ‘table name’G; Or
mysql>check table tablename ;

iv)If it is corrupts then use the following command to repair that particular database table.



mysql>repair table tablename;

D] You can repair it though shell when mysqld server is not running


Repairing MyISAM mySQL Tables/Databases:



# cd /var/lib/mysql/DBNAME

# myisamchk tablename.MYI

Repairing ISAM mySQL Tables/Databases:



# cd /var/lib/mysql/DBNAME
isamchk tablename.MYI

where


-c –> check database is corrupted or not
-r –> recorver
-o –> optimise the database

Difference between mii-tool and ifconfig

mii-tool => only gives information whether the link is up or not, thus
used to see whether our drivers are properly installed and is our network card detected properly.


ifconfig -> gives information about the ip set to the system, mak address, gateway etc. also it can used to set the ip address temporarily to the system like, *ifconfig eth0 *

Difference between mii-tool and ifconfig

mii-tool => only gives information whether the link is up or not, thus
used to see whether our drivers are properly installed and is our network
card detected properly.


ifconfig -> gives information about the ip set to the system, mak address,
gateway etc. also it can used to set the ip address temporarily to the
system like, *ifconfig eth0 *

Error MySql: Can’t create new tempfile: ‘*.TMD file | Linux Easy

Can’t create new tempfile: ‘tablesname.TMD file error while repairing corrupted database tables please try use following command to fix it


Solution.



# myisamchk -r -f  tables.MYI

Error MySql: Can’t create new tempfile: ‘*.TMD file

Can’t create new tempfile: ‘tablesname.TMD file error while repairing corrupted database tables please try use following command to fix it


Solution.



# myisamchk -r -f  tables.MYI

How to install subversion client on a Linux server?

Svn(subversion) is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

It is very easy to install subversion client on linux OS using yum. You can us following command to install subversion client.
root@server [~]# yum install subversion

while installing subversion if you are getting following error  then it seem sot be perl-URI package is not installed on your server so you will have to install first before installing subversion client.

Please follow the following steps to install perl-URI package

You’ll login via SSH as root and run this command:
root@server [~]# yum install subversion

and then you may get this error:
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

Here’s what you do next (copy/paste):
root@server [~]# wget  ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/
fedora/linux/releases/7/Everything/i386/os/Fedora/
perl-URI-1.35-3.noarch.rpm


root@server [~]# rpm -i perl-URI-1.35-3.noarch.rpm

root@server [~]# yum install subversion

Installed: subversion.x86_64 0:1.4.2-4.el5 subversion.i386 0:1.4.2-4.el5

Dependency Installed: neon.x86_64 0:0.25.5-10.el5 neon.i386 0:0.25.5-10.el5

Complete!

That’s it subversion client is successfully installed on your server you can check it using following command.
root@server [~]#svn --version
svn, version 1.1.4 (r13838)
compiled Aug 21 2005, 20:56:55

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' schema
- handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
- handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' schema

How to install subversion client on a Linux server?

Svn(subversion) is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

It is very easy to install subversion client on linux OS using yum. You can us following command to install subversion client.
root@server [~]# yum install subversion

while installing subversion if you are getting following error  then it seem sot be perl-URI package is not installed on your server so you will have to install first before installing subversion client.

Please follow the following steps to install perl-URI package

You’ll login via SSH as root and run this command:
root@server [~]# yum install subversion

and then you may get this error:
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

Here’s what you do next (copy/paste):
root@server [~]# wget  ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/
fedora/linux/releases/7/Everything/i386/os/Fedora/
perl-URI-1.35-3.noarch.rpm


root@server [~]# rpm -i perl-URI-1.35-3.noarch.rpm

root@server [~]# yum install subversion

Installed: subversion.x86_64 0:1.4.2-4.el5 subversion.i386 0:1.4.2-4.el5

Dependency Installed: neon.x86_64 0:0.25.5-10.el5 neon.i386 0:0.25.5-10.el5

Complete!

That’s it subversion client is successfully installed on your server you can check it using following command.
root@server [~]#svn --version
svn, version 1.1.4 (r13838)
compiled Aug 21 2005, 20:56:55

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' schema
- handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
- handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' schema

How to update/install latest RoundCube on cPanel

Update/install latest RoundCube on cPanel


First you will have to uninstall/remove exiting RoundCube files/folder/database on your server,




  • Uninstall/remove exiting RoundCube


cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -e 'drop database roundcube';
/scripts/upcp

Now follow the following steps to  update/install latest roundcube  version ,we need to get Roundcube before we can use it. The easiest way to get it is to visit http://www.roundcube.net and click on “Downloads” or just go to http://roundcube.net/downloads. Wait for it to download and then unzip (using WinZip or ZipGenius or tar -xzf roundcubemail-0.1.tar.gz) in the current directory.




  • update/install latest roundcube


cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://nchc.dl.sourceforge.net/sourceforge/
roundcubemail/roundcubemail-0.2.1.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.2.1/ roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs


  • Database Configuration


Create the database, database user and install the intial sql file. The following commands will do this for you.



mysql -e "CREATE DATABASE roundcube;"
mysql -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost IDENTIFIED BY 'DATABASEPASSWORD';"
mysql -e "FLUSH PRIVILEGES;"
mysql -e "use roundcube; source SQL/mysql.initial.sql;"

You will have to replace the roundcube password with ‘DATABASEPASSWORD’ field.




  • Configuring RoundCube


cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

then open database configruation file  db.inc.php in your favroite editor like vi or pico or nano
vi db.inc.php
Find following line



$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

Replace it with



$rcmail_config['db_dsnw'] = 'mysql://roundcube:DATABASEPASSWORD@localhost/roundcube';

Now Open main.inc.php


vi main.inc.php


Find



$rcmail_config['default_host'] = '';

Replace with



$rcmail_config['default_host'] = 'localhost';

How to update/install latest RoundCube on cPanel

Update/install latest RoundCube on cPanel


First you will have to uninstall/remove exiting RoundCube files/folder/database on your server,




  • Uninstall/remove exiting RoundCube


cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -e 'drop database roundcube';
/scripts/upcp

Now follow the following steps to  update/install latest roundcube  version ,we need to get Roundcube before we can use it. The easiest way to get it is to visit http://www.roundcube.net and click on “Downloads” or just go to http://roundcube.net/downloads. Wait for it to download and then unzip (using WinZip or ZipGenius or tar -xzf roundcubemail-0.1.tar.gz) in the current directory.




  • update/install latest roundcube


cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://nchc.dl.sourceforge.net/sourceforge/
roundcubemail/roundcubemail-0.2.1.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.2.1/ roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs


  • Database Configuration


Create the database, database user and install the intial sql file. The following commands will do this for you.



mysql -e "CREATE DATABASE roundcube;"
mysql -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost IDENTIFIED BY 'DATABASEPASSWORD';"
mysql -e "FLUSH PRIVILEGES;"
mysql -e "use roundcube; source SQL/mysql.initial.sql;"

You will have to replace the roundcube password with ‘DATABASEPASSWORD’ field.




  • Configuring RoundCube


cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

then open database configruation file  db.inc.php in your favroite editor like vi or pico or nano
vi db.inc.php
Find following line



$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

Replace it with



$rcmail_config['db_dsnw'] = 'mysql://roundcube:DATABASEPASSWORD@localhost/roundcube';

Now Open main.inc.php


vi main.inc.php


Find



$rcmail_config['default_host'] = '';

Replace with



$rcmail_config['default_host'] = 'localhost';

How to hide your shell commands

Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.



root@server2 [/]# stty -echo

In order to disable this mode, simply remove the “-” before echo.



root@server2 [/]# stty echo

I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open

How to hide your shell commands

Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.



root@server2 [/]# stty -echo

In order to disable this mode, simply remove the “-” before echo.



root@server2 [/]# stty echo

I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open

How to fix HTTP Error on Wordpress 2.6 Flash Uploader

Whenever you are trying to upload an image using the flash uploader in Wordpress and received a “HTTP error”? and uploading images status stuck in crunching ……..

Solutions: The problem has something to do with mod_security, which is basically a web application firewall that protects your website from a range of attacks. So you shouldn’t turn off this module as it protects your site from such malicious attack , You can add a special rule in .htaccess file which can be found in the root folder of your Wordpress installation to get work the flash uploader.

Open the .htaccess file in your website document root and add the following lines:

  • For Apache 1.X

    <IfModule mod_security.c>

    <Files async-upload.php>

    SecFilterEngine Off

    SecFilterScanPOST Off

    </Files>

    </IfModule>


  • For Apache 2.X

    <IfModule mod_security2.c>

    <Files async-upload.php>

    SecRuleEngine Off

    SecAuditEngine Off

    </Files>

    </IfModule>


How to fix HTTP Error on Wordpress 2.6 Flash Uploader

Whenever you are trying to upload an image using the flash uploader in Wordpress and received a “HTTP error”? and uploading images status stuck in crunching ……..

Solutions: The problem has something to do with mod_security, which is basically a web application firewall that protects your website from a range of attacks. So you shouldn’t turn off this module as it protects your site from such malicious attack , You can add a special rule in .htaccess file which can be found in the root folder of your Wordpress installation to get work the flash uploader.

Open the .htaccess file in your website document root and add the following lines:

  • For Apache 1.X





    SecFilterEngine Off

    SecFilterScanPOST Off





  • For Apache 2.X





    SecRuleEngine Off

    SecAuditEngine Off





Monday 27 July 2009

Horbe/webmail is not working in plesk

Error when trying to connect to http://webmail.domain.tld/

A fatal error has occurred DB Error: connect failed Details have been logged for the administrator.

#  cat /etc/psa/.psa.shadow > etc/psa/.webmail.shadow

# chown apache.apache /etc/psa/.webmail.shadow

# chmod 600 /etc/psa/.webmail.shadow

You may have a problem with your file:

# /etc/psa/.webmail.shadow

Horbe/webmail is not working in plesk

Error when trying to connect to http://webmail.domain.tld/

A fatal error has occurred DB Error: connect failed Details have been logged for the administrator.

#  cat /etc/psa/.psa.shadow > etc/psa/.webmail.shadow

# chown apache.apache /etc/psa/.webmail.shadow

# chmod 600 /etc/psa/.webmail.shadow

You may have a problem with your file:

# /etc/psa/.webmail.shadow

Install gcc package

cat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thisif yum then

yum install gcc


if redhat then


then check appropriate for this/etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for this/etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc

if redhat then

then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for this

Install gcc package

cat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thisif yum then

yum install gcc


if redhat then


then check appropriate for this/etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for this/etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc

if redhat then

then check appropriate for thiscat /etc/redhat-release

if yum then

yum install gcc


if redhat then


then check appropriate for this

Saturday 25 July 2009

How to use .htaccess on IIS (mod_rewrite for microsoft iis server)

Well at the first place, if you are using microsoft iis server, it should probably   be for asp files probably! but if you are iis-logousing   it for php files, then there is pratically no         point in using it! as there are far better and     supported linux based servers presend, and   even if you want to use microsoft windows       based system to run your server, there are     windows based packages available instead of iis which support php far better than iis and have many needed features by default like for example mod_rewrite , enabling usage of .htaccess files on theserver for improving many thing including url structure of your site.

How ever, in any case if you still need to use the microsoft iis server for your files, and also need to use the .htaccess, there is no such alternative for iis server by default as far as i know! you have to install this module for iisserver called mod_rewrite for iis server. This will enable the mod_rewrite facility for your microsoftiis based server running php files and you will be able to use the .htaccess easly. You can download the files from the following link along with all details and installation instructions:

http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1470

Sunday 19 July 2009

How to reset vtiger crm 5 password




You need to execute the following mysql statement to reset it to admin or adpexzg3FUZAk(sorry cant remember)

update vtiger_users SET user_password = 'adpexzg3FUZAk', crypt_type='' WHERE id=1;


asp function to check if an email address is valid

function IsValidEmail(email)
IsValidEmail = true
dim names, name, i, c
names = Split(email, "@")
if UBound(names) <&rt; 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <&rt; 2 and i <&rt; 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") &rt; 0 then
IsValidEmail = false
end if
end function

Plesk Binaries

Located in the %plesk_bin% directory

1) websrvmng.exe

To install hosting for a domain



Quote:










websrvmng.exe --install-vhost --vhost-name=<domain name>




To remove hosting for a domain





Quote:










websrvmng.exe --remove-vhost --vhost-name=<domain name>




To reconfigure hosting for a domain





Quote:










websrvmng.exe --reconfigure-vhost --vhost-name=<domain name>




To reconfigure a subdomain





Quote:










websrvmng.exe --update-subdomain --vhost-name=<domain name> --subdomain=<subdomain>




Passwords for system user and IIS user can be unsynchronized or synchronised using





Quote:










websrvmng.exe --update-anon-password --domain-name=<domain name>




To reconfigure webmail





Quote:










websrvmng.exe --reconfigure-webmail
defpackagemng.exe" --fix --type=webmail






2) mchk.exe

To Reset server-wide and domain's mail settings forcefully



Quote:










mchk.exe --all --fix-all




To Check and restore mail settings for a domain defined





Quote:










mchk.exe --domain --domain-name=sampledomain.com




To Check and restore only server-wide mail settings





Quote:










mchk.exe --global-settings






3) protdir.exe





Quote:










protdir.exe --create Protected_Dir -domain domain1.com -add_user MyGuest -passwd "MyPass"




To set a password for the user of a web-protected directory:





Quote:










protdir.exe --update Protected_Sample -domain somewhere.com -update_user johndoe -passwd Password1




To remove protected directory user:





Quote:










protdir.exe --update Protected_Dir -remove_user johndoe






4) Subdomain.exe





Quote:










subdomain.exe --create subdomain2 -domain domain1.com -hard_quota 50 -ssi true




To remove subdomain1.somewhere.com from somewhere.com domain:





Quote:










subdomain.exe --remove subdomain1 -domain somewhere.com




To change the existing subdomain name






Quote:










subdomain1.somewhere.com to the new one - subdomain1_new.somewhere.com






Quote:










subdomain.exe --update subdomain1 -domain somewhere.com -new_name subdomain1_new




To enable FrontPage support for subdomain1.somewhere.com:





Quote:










subdomain.exe --update subdomain1 -domain somewhere.com -fp true




To retrieve information on subdomain1.somewhere.com:





Quote:










subdomain.exe --info subdomain1 -domain somewhere.com






5) domain.exe





Quote:










domain.exe --create domain1.com -clogin John_Doe -dom_user false -www true -hosting true -ip 143.230.22.14 -cgi true -notify false




To retrieve sampledomain.com domain information:





Quote:










domain.exe --info sampledomain.com




To rename sampledomain.com domain to sampledomain1.com domain:





Quote:










domain.exe --update sampledomain.com -new_name sampledomain1.com




To enable domain user account with password "somepass" for sampledomain.com domain:





Quote:










domain.exe --update sampledomain.com -dom_user true -du_passwd somepass




To set name for domain user of a sampledomain.com domain to "John":





Quote:










domain.exe --update sampledomain.com -du_pname "John"




To enable hosting for sampledomain.com domain:





Quote:










domain.exe --update sampledomain.com -hosting true






6) plesksrvmng.exe




To reset the password for admin control panel



Quote:










plesksrvmng.exe




To get the existing password for the admin control panel





Quote:










plesksrvmng.exe -get






7) statistics.exe


Updates the statistics for all domains on the server

Plesk Binaries

Located in the %plesk_bin% directory

1) websrvmng.exe

To install hosting for a domain



Quote:










websrvmng.exe --install-vhost --vhost-name=




To remove hosting for a domain





Quote:










websrvmng.exe --remove-vhost --vhost-name=




To reconfigure hosting for a domain





Quote:










websrvmng.exe --reconfigure-vhost --vhost-name=




To reconfigure a subdomain





Quote:










websrvmng.exe --update-subdomain --vhost-name= --subdomain=




Passwords for system user and IIS user can be unsynchronized or synchronised using





Quote:










websrvmng.exe --update-anon-password --domain-name=




To reconfigure webmail





Quote:










websrvmng.exe --reconfigure-webmail
defpackagemng.exe" --fix --type=webmail






2) mchk.exe

To Reset server-wide and domain's mail settings forcefully



Quote:










mchk.exe --all --fix-all




To Check and restore mail settings for a domain defined





Quote:










mchk.exe --domain --domain-name=sampledomain.com




To Check and restore only server-wide mail settings





Quote:










mchk.exe --global-settings






3) protdir.exe





Quote:










protdir.exe --create Protected_Dir -domain domain1.com -add_user MyGuest -passwd "MyPass"




To set a password for the user of a web-protected directory:





Quote:










protdir.exe --update Protected_Sample -domain somewhere.com -update_user johndoe -passwd Password1




To remove protected directory user:





Quote:










protdir.exe --update Protected_Dir -remove_user johndoe






4) Subdomain.exe





Quote:










subdomain.exe --create subdomain2 -domain domain1.com -hard_quota 50 -ssi true




To remove subdomain1.somewhere.com from somewhere.com domain:





Quote:










subdomain.exe --remove subdomain1 -domain somewhere.com




To change the existing subdomain name






Quote:










subdomain1.somewhere.com to the new one - subdomain1_new.somewhere.com






Quote:










subdomain.exe --update subdomain1 -domain somewhere.com -new_name subdomain1_new




To enable FrontPage support for subdomain1.somewhere.com:





Quote:










subdomain.exe --update subdomain1 -domain somewhere.com -fp true




To retrieve information on subdomain1.somewhere.com:





Quote:










subdomain.exe --info subdomain1 -domain somewhere.com






5) domain.exe





Quote:










domain.exe --create domain1.com -clogin John_Doe -dom_user false -www true -hosting true -ip 143.230.22.14 -cgi true -notify false




To retrieve sampledomain.com domain information:





Quote:










domain.exe --info sampledomain.com




To rename sampledomain.com domain to sampledomain1.com domain:





Quote:










domain.exe --update sampledomain.com -new_name sampledomain1.com




To enable domain user account with password "somepass" for sampledomain.com domain:





Quote:










domain.exe --update sampledomain.com -dom_user true -du_passwd somepass




To set name for domain user of a sampledomain.com domain to "John":





Quote:










domain.exe --update sampledomain.com -du_pname "John"




To enable hosting for sampledomain.com domain:





Quote:










domain.exe --update sampledomain.com -hosting true






6) plesksrvmng.exe




To reset the password for admin control panel



Quote:










plesksrvmng.exe




To get the existing password for the admin control panel





Quote:










plesksrvmng.exe -get






7) statistics.exe


Updates the statistics for all domains on the server

Error: Cannot Find SSL Binaries Under /usr [DirectAdmin]

This happens with the configure script for apache cannot find the "openssl" (or "ssleay") binaries in any of
/usr/bin/openssl
/usr/sbin/openssl
/usr/apps/openssl

The usual location for "openssl" is /usr/bin/openssl

On a debian system, run


apt-get install openssl

Error: Cannot Find SSL Binaries Under /usr [DirectAdmin]

This happens with the configure script for apache cannot find the "openssl" (or "ssleay") binaries in any of
/usr/bin/openssl
/usr/sbin/openssl
/usr/apps/openssl

The usual location for "openssl" is /usr/bin/openssl

On a debian system, run


apt-get install openssl

How to Install mod_evasive


Mod_Evasive will help to stop basic attacks on a server (HTTP, DDoS attack and brute force attack). Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following:

- Requesting the same page more than a few times per second
- Making more than 50 concurrent requests on the same child per second
- Making any requests while temporarily blacklisted (on a blocking list)

______________________________________________________________



Login to your server, on command line:

# /usr/local/srcwget http://www.nuclearelephant.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz

# tar -zxvf mod_evasive_1.10.1.tar.gz
# cd mod_evasive

If you are using apache 1.3.x :
# /usr/local/apache/bin/apxs -cia mod_evasive.c

And add this to httpd.conf:
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600


If you are using apache 2.0.x :
# /usr/sbin/apxs -cia mod_evasive20.c

Add this to httpd.conf:
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600


Restart apache and the installation should be complete.
/etc/init.d/httpd restart

How to Install mod_evasive


Mod_Evasive will help to stop basic attacks on a server (HTTP, DDoS attack and brute force attack). Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following:

- Requesting the same page more than a few times per second
- Making more than 50 concurrent requests on the same child per second
- Making any requests while temporarily blacklisted (on a blocking list)

______________________________________________________________



Login to your server, on command line:

# /usr/local/srcwget http://www.nuclearelephant.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz

# tar -zxvf mod_evasive_1.10.1.tar.gz
# cd mod_evasive

If you are using apache 1.3.x :
# /usr/local/apache/bin/apxs -cia mod_evasive.c

And add this to httpd.conf:
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600


If you are using apache 2.0.x :
# /usr/sbin/apxs -cia mod_evasive20.c

Add this to httpd.conf:
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600


Restart apache and the installation should be complete.
/etc/init.d/httpd restart

I can't login to DirectAdmin on port 2222 [DirectAdmin]

If you are unable to access your server via http://YourDomainname:2222, then 1 of 3 things is likely happening:

1. DirectAdmin might not be running or
2. You have a firewall blocking port 2222.

Number 2. is easy to check by simply running (only on redhat systems):

/sbin/service iptables stop
/sbin/chkconfig iptables off

Then test directadmin again.

If that didn't fix it, then you'd need to check your /var/log/directadmin/error.log to check for any errors as to why it isn't starting:

tail /var/log/directadmin/error.log

Common problems are:

1. Incorrect ethernet_dev set in the /usr/local/directadmin/conf/directadmin.conf file.
2. Invalid license, either due to wrong uid/lid, IP, or date. Try: Updating your DirectAdmin License Manually
3. Binaries for a different operating system.

You can always try running DirectAdmin by hand (if it's not already running) to see what the problem is.

cd /usr/local/directadmin
./directadmin b200

Use Ctrl-C to stop.

I can't login to DirectAdmin on port 2222 [DirectAdmin]

If you are unable to access your server via http://YourDomainname:2222, then 1 of 3 things is likely happening:

1. DirectAdmin might not be running or
2. You have a firewall blocking port 2222.

Number 2. is easy to check by simply running (only on redhat systems):

/sbin/service iptables stop
/sbin/chkconfig iptables off

Then test directadmin again.

If that didn't fix it, then you'd need to check your /var/log/directadmin/error.log to check for any errors as to why it isn't starting:

tail /var/log/directadmin/error.log

Common problems are:

1. Incorrect ethernet_dev set in the /usr/local/directadmin/conf/directadmin.conf file.
2. Invalid license, either due to wrong uid/lid, IP, or date. Try: Updating your DirectAdmin License Manually
3. Binaries for a different operating system.

You can always try running DirectAdmin by hand (if it's not already running) to see what the problem is.

cd /usr/local/directadmin
./directadmin b200

Use Ctrl-C to stop.

How To Update Apache In DirectAdmin

If  you are willing to update apache from 2.x  To  2.0.59, then follow this.
—————————————————————-
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart
———————————————————————–
Updating Apache from 1.3.x to 2.0.59
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build convert
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart

How To Update Apache In DirectAdmin

If  you are willing to update apache from 2.x  To  2.0.59, then follow this.
—————————————————————-
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart
———————————————————————–
Updating Apache from 1.3.x to 2.0.59
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build update_data_ap2
./build convert
./build clean
./build apache_2
./build php_ap2 n
./build mod_frontpage_ap2
./build mod_perl_ap2
./build zend
/sbin/service httpd restart

Sometimes you will get following error while accessing/updating DirectAdmin from your DA panel

In this case you can update the license file from command line by running following shell script provided by DA itself.

# cd /usr/local/directadmin/scripts/
# getLicense.sh

You will get client id and license ID in setup.txt file which available under same directory.

Sometimes you will get following error while accessing/updating DirectAdmin from your DA panel

In this case you can update the license file from command line by running following shell script provided by DA itself.

# cd /usr/local/directadmin/scripts/
# getLicense.sh

You will get client id and license ID in setup.txt file which available under same directory.

To reset the monthly bandwidth fire this command (Direct admin)

To reset the monthly bandwidth fire this command (Direct admin)

echo ‘action=reset&value=all’ >> /usr/local/directadmin/data/task.queue

/usr/local/directadmin/dataskq d

To reset the monthly bandwidth fire this command (Direct admin)

To reset the monthly bandwidth fire this command (Direct admin)

echo ‘action=reset&value=all’ >> /usr/local/directadmin/data/task.queue

/usr/local/directadmin/dataskq d

Disable/Enable Ping On Linux Server

Command to disable ping on the server…

You can use following command to disable PING:

echo “1? >> /proc/sys/net/ipv4/icmp_echo_ignore_all

The following command will enable PING for you:

echo “0? >> /proc/sys/net/ipv4/icmp_echo_ignore_all

Disable/Enable Ping On Linux Server

Command to disable ping on the server…

You can use following command to disable PING:

echo “1? >> /proc/sys/net/ipv4/icmp_echo_ignore_all

The following command will enable PING for you:

echo “0? >> /proc/sys/net/ipv4/icmp_echo_ignore_all

File size limit exceeded(core dumped) $HTTPD -DSSL

If you get following errors while restarting httpd service.




[root@srv ~]# service httpd restart

/etc/init.d/httpd restart: httpd not running, trying to start
/etc/init.d/httpd: line 83: 4671 File size limit exceeded(core dumped) $HTTPD -DSSL
/etc/init.d/httpd restart: httpd could not be started

Then, Check your log files. More than likely, you have a log file which is larger than the 2GB limit on all 32-bit systems.

————


You can use these commands to clear all log files On cPanel server/Apache


————




echo > /var/log/exim_mainlog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/messages.2
echo > /var/log/messages.3
echo > /var/log/messages.4
echo > /var/log/lastlog
echo > /var/log/maillog
echo > /var/log/maillog.1
echo > /var/log/maillog.2
echo > /var/log/maillog.3
echo> /var/log/secure
echo> /var/log/secure.1
echo> /var/log/secure.2
echo> /var/log/secure.3
echo> /var/log/secure.4
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/suexec_log
echo > /usr/local/apache/logs/error_log
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
echo > /var/log/exim_mainlog.1
echo > /usr/local/cpanel/3rdparty/mailman/logs/locks
echo > /var/log/cron.2
echo > /var/log/chkservd.log
echo > /var/log/cron.4
echo > /var/log/exim_paniclog.1
echo > /var/log/exim_rejectlog.1
echo > /var/log/exim_paniclog

————



Thease commands fixed My issue, hope it will also fix for you.

File size limit exceeded(core dumped) $HTTPD -DSSL

If you get following errors while restarting httpd service.




[root@srv ~]# service httpd restart

/etc/init.d/httpd restart: httpd not running, trying to start
/etc/init.d/httpd: line 83: 4671 File size limit exceeded(core dumped) $HTTPD -DSSL
/etc/init.d/httpd restart: httpd could not be started

Then, Check your log files. More than likely, you have a log file which is larger than the 2GB limit on all 32-bit systems.

————


You can use these commands to clear all log files On cPanel server/Apache


————




echo > /var/log/exim_mainlog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/messages.2
echo > /var/log/messages.3
echo > /var/log/messages.4
echo > /var/log/lastlog
echo > /var/log/maillog
echo > /var/log/maillog.1
echo > /var/log/maillog.2
echo > /var/log/maillog.3
echo> /var/log/secure
echo> /var/log/secure.1
echo> /var/log/secure.2
echo> /var/log/secure.3
echo> /var/log/secure.4
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/suexec_log
echo > /usr/local/apache/logs/error_log
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
echo > /var/log/exim_mainlog.1
echo > /usr/local/cpanel/3rdparty/mailman/logs/locks
echo > /var/log/cron.2
echo > /var/log/chkservd.log
echo > /var/log/cron.4
echo > /var/log/exim_paniclog.1
echo > /var/log/exim_rejectlog.1
echo > /var/log/exim_paniclog

————



Thease commands fixed My issue, hope it will also fix for you.