Archive for April, 2007

Newbiee Plesk Windows doubts for Webstatistics

Thursday, April 26th, 2007

Plesk Webstatistics

How to view Awstats/Webalizer for domains hosted in Plesk server?
Webstats can be viewed by http://www.domainname.com/plesk-stat/webstat/

How to update the webstats in Plesk?
Statistics can be updated by cd %plesk_bin% , statistics.exe in command prompt.

I would prefer Awstats to webalizer. how can I change te default webstats?
Plesk->Domains-Domain->Setup->Drop down menu, where we can select that.

Disable PHP Functions

Thursday, April 26th, 2007

Edit php.ini

Comment out the original disable_functions, then put this underneath

disable_functions = dl,passthru,proc_open,proc_close,shell_exec,system

/etc/rc.d/init.d/httpd restart

Enjoy

Ninad

How To Change Color Of Datagrid Text …Depending On the value In Database….!!!!

Thursday, April 26th, 2007

//Following Ex. shows that if employee is absent then how to change the color of text in perticular cell…..

DataSet ds=new DataSet();
OdbcDataAdapter da=new OdbcDataAdapter("Select * from emp");
OdbcCommandBuilder cmd=new OdbcCommandBuilder(da);
da.fill(ds,"emp");

DataGrid1.DataSource =ds.Tables["emp"];
DataGrid1.DataBind();

//Code To change the for color if datagrid cell contains "A"
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{

DateTime dat=new DateTime();
dat=System.DateTime.Now;
int cur_day=dat.Day;

for(int i=0;i <=cur_day;i++)
{
string st = e.Item.Cells[i].Text;
if(st == "A")
e.Item.Cells[i].ForeColor= Color.Red;
}
}

By,
Aniruddha

How to disable mod_security for an individual account ?

Thursday, April 26th, 2007

If you are receiving the error for mod_security, access denied with error code 403 when you check the error logs for any account. You can disable the mod_security for that account by adding a simple code in his .htaccess

==================

SecFilterEngine Off
SecFilterScanPOST Off

==================

Enjoy

Ninad

Install Chkrootkit

Thursday, April 26th, 2007

cd /root

wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz

tar xvzf chkrootkit.tar.gz

mv chkrootkit-* chkrootkit

cd chkrootkit

make sense

Enjoy

Ninad

How to Update stats on Plesk server

Thursday, April 26th, 2007

Run the following command to update stats on plesk server.

/usr/local/psa/admin/sbin/statistics

Enjoy

Ninad

How to Install RvSkin

Thursday, April 26th, 2007

Installation

Create a account from whm called rvskin.com

1. SSH as root to server that was registered while purchasing the license and run:

mkdir /root/rvadmin

cd /root/rvadmin

wget http://download.rvglobalsoft.com/download.php/download/rvskin-auto/saveto/rvauto.tar.bz2; bunzip2 -d rvauto.tar.bz2; tar -xvf rvauto.tar; perl /root/rvadmin/auto_rvskin.pl

Answer a couple of questions on your shell, and wait until it finishes. First installation will take 2- 5 minutes to install. Installer will create a new hosting account ‘rvadmin’. Don’t terminate it. It will be used for internal RVSkin configuration management.

2. Log in to RVSkin Manager. Both root and reseller are able to access RVSkin Manager in WHM / Add-ons (at the bottom left menu). If you cannot find the RVSkin Manager menu, please close WHM and open it again.

If there is no messages display on the skin, please run this command on your SSH.

rm -f /usr/local/cpanel/Cpanel/rvversion
perl /root/rvadmin/auto_rvskin.pl

3. In RVSkin Manager:

* Set global configuration
* Set default language
* Create defaul feature list for user and for reseller
* Set tweak setting, reseller feature control, body links, top links, help, tutorial links, and etc.
* Test configuration setting in 2 hosting accounts.
* rvadmin: this account can consider to be account belong to root
*reseller’s client: this account will reflect setting from reseller skin manager. If it is not configued, it will remain anonymous.

4. Change user cPanel to RVSkin themes
5. Change cPanel language to the new language

Enjoy.

Ninad

How to install RoundCube on Cpanel?

Wednesday, April 25th, 2007

First make sure you know your mysql root password, you have to replace DATABASEPASSWORD to your mysql root password.

If you have already used RoundCube installation please make sure you remove any traces of it with,

cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -p -e ‘drop database roundcube’;
chattr -i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr -i /usr/local/cpanel/base/webmaillogin.cgi
/scripts/upcp

You will have to specify your root password when prompted.

Now lets download roundcube first and chmod the directorys

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

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

mysql -e “CREATE DATABASE roundcube;” -pDATABASEPASSWORD
mysql -e “use roundcube; source SQL/mysql.initial.sql;” -pDATABASEPASSWORD

Now lets sort out the configuration

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

Now open db.inc.php

nano db.inc.php

Find

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

Replace with

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

Now Open main.inc.php

nano main.inc.php

Find

$rcmail_config['default_host'] = ”;

Replace with

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

Now we have to configure cPanel to show roundcube in the theme. Please note this is for the X theme(default) only!! If you use another theme please skip the next part and see below.

cd /usr/local/cpanel/base/roundcube/skins/default/images/
cp roundcube_logo.png /usr/local/cpanel/base/frontend/x/images/roundcube_logo.png
cp roundcube_logo.png /usr/local/cpanel/base/webmail/x/images/roundcube_logo.png
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-1.0BETA2.1
patch -p0 < HGpatch-roundcube-1.0BETA2.1

**NOTE** If you receive a message stating

Reversed (or previously applied) patch detected! Assume -R?

please press N for No as this is because you previously installed roundcube

This will auto do all the necessary changes to roundcube and the X theme.

Once the patch is executed you may now access roundcube via http://yourip/webmail

—–

If you do not use the X theme please do the following

wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-NON-X-1.0BETA2.1
patch -p0 < HGpatch-roundcube-NON-X-1.0BETA2.1

Then open your webmaillogin.html, please replace YOURTHEME with the name of your theme.

nano /usr/local/cpanel/base/frontend/YOURTHEME/webmaillogin.html

and find

</td>
</cpanelif>
</cpanelfeature>

Add Below

<td align=”center” valign=”bottom” width=”200″>
<a href=”/roundcube/index.php”><img src=”images/roundcube_logo.png” border=”0″></a>
<a href=”/roundcube/index.php”>RoundCube</a>
</td>

——

***UPDATE***
Remember to chattr +i the files or add the patch to your /scripts/upcp.

chattr +i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr +i /usr/local/cpanel/base/webmaillogin.cgi

That’s it! You may now access roundcube via http://yourip/webmail

hostgeeks.com

How to change ip of a specific domain because change site’s ip in whm only show main accounts not add-on domains

Wednesday, April 25th, 2007

>> By default if you change the IP address of a main domain then the IP address of the associate addon, parked and subdomain get updated.

If the ip of an add-on domain will be changed, will it stay in the same cpanel ?

>> Yes, You can have different IP address for addon domain by editing the httpd.conf for the particular addon domain and change the IP there as well edit the DNS file to point the A record to the new IP you want but note that there is sub folder for addon domain which is linked with main domain. Even after changing the IP address the addon domain will stay in same cpanel.

What is Ajax?

Wednesday, April 25th, 2007

AJAX = Asynchronous JavaScript and XML

AJAX is not a new programming language, but a technique for creating better, faster, and more interactive web applications.

With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page.

AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.

The AJAX technique makes Internet applications smaller, faster and more user-friendly.

AJAX is a browser technology independent of web server software.

AJAX is Based on Web Standards

AJAX is based on the following web standards:

* JavaScript
* XML
* HTML
* CSS

The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent.

AJAX is About Better Internet Applications

Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop.

However, Internet applications are not always as “rich” and user-friendly as traditional desktop applications.

With AJAX, Internet applications can be made richer and more user-friendly.

AJAX Uses HTTP Requests

In traditional JavaScript coding, if you want to get any information from a database or a file on the server, or send user information to a server, you will have to make an HTML form and GET or POST data to the server. The user will have to click the “Submit” button to send/get the information, wait for the server to respond, then a new page will load with the results.

Because the server returns a new page each time the user submits input, traditional web applications can run slowly and tend to be less user-friendly.

With AJAX, your JavaScript communicates directly with the server, through the JavaScript XMLHttpRequest object

With an HTTP request, a web page can make a request to, and get a response from a web server – without reloading the page. The user will stay on the same page, and he or she will not notice that scripts request pages, or send data to a server in the background.

The XMLHttpRequest Object

By using the XMLHttpRequest object, a web developer can update a page with data from the server after the page has loaded!

AJAX was made popular in 2005 by Google (with Google Suggest).

Google Suggest is using the XMLHttpRequest object to create a very dynamic web interface: When you start typing in Google’s search box, a JavaScript sends the letters off to a server and the server returns a list of suggestions.

The XMLHttpRequest object is supported in Internet Explorer 5.0+, Safari 1.2, Mozilla 1.0 / Firefox, Opera 8+, and Netscape 7.