Archive for the ‘Articles -- Webhosting’ Category

Banning / Unbanning / Listing ips.

Friday, April 27th, 2007

Banning an IP
iptables -I INPUT -s [ipaddress] -j DROP

Unbanning and IP
iptables -I INPUT -s [ipaddress] -j ACCEPT

Listing the last five ip’s with the most connections
netstat -atnp -A inet | grep “:80″ | awk -F ” ” ‘{print $5} ‘ | awk -F “:” ‘{print $1}’ | sort | uniq -c | sort -nr | head -5

Listing total connections
netstat -nap | grep ESTABLISHED | wc -l
netstat -nap | grep SYN | wc -l
netstat -nap | grep TIME_WAIT | wc -l

———-

If Apf firewall is installed on server then –

Accept IP –
apf -a [ip address]

Decline IP –

apf -d [ip address]

———–
IF shorewall is installed

Decline Ip –

shorewall drop [ip address]

How to increase SquirrelMail maximum attachment size from 2MB.

Friday, April 27th, 2007

SquirrelMail is written in PHP, the max attachment size for webmail is inherited from the “upload_max_filesize” value set forth in php.ini

Here you go..

1, Locate your php.ini.
2, Open it in a text editor
3, Search for upload_max_filesize.
4, Change 2M to something else, for example 5M.
5, If the upload_max_filesize is larger than post_max_size, you must increase post_max_size so that it’s bigger than upload_max_size
6, If the value of post_max_size is larger than memory_limit, you must increase memory_limit so that it’s larger than post_max_size.
7, Save your changes to the file.
8, Restart your web server.

Note 1:
There’s no documented max upload size.

Note 2:
If uploading the file is slow, you may have to increase the max_execution_time so that the script does not terminate before the entire file is uploaded.

Thank you :)

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.

How to upgrade Perl on cPanel Server

Monday, April 23rd, 2007

To upgrade your perl on the Cpanel server you need to
go through the below steps.You need to perform all the steps
on the shell :

1. Download the latest perl installer tar file
from http://layer1.cpanel.net :

wget http://layer1.cpanel.net/perl587installer.tar.gz
tar -vzxf perl587installer.tar.gz
cd perl587installer
./install

2. After installation you need to run
upcp on the server.

/usr/local/cpanel/bin/checkperlmodules
/scripts/upcp –force

3. Checkout the perl version after upgradation.
You can checkout the perl version through below command :

perl -v

————-

What is CSS ?

Monday, April 23rd, 2007

What is CSS?

CSS is an acronym for Cascading Style Sheets.

What can I do with CSS?

CSS is a style language that defines layout of HTML documents. For example, CSS covers fonts, colours, margins, lines, height, width, background images, advanced positions and many other things. Just wait and see!

HTML can be (mis-)used to add layout to websites. But CSS offers more options and is more accurate and sophisticated. CSS is supported by all browsers today.

After only a few lessons of this tutorial you will be able to make your own style sheets using CSS to give your website a new great look.

Which benefits will CSS give me?

CSS was a revolution in the world of web design. The concrete benefits of CSS include:

* control layout of many documents from one single style sheet;
* more precise control of layout;
* apply different layout to different media-types (screen, print, etc.);
* numerous advanced and sophisticated techniques.

How to catch spammer using simple command..

Monday, April 23rd, 2007

Follow this —

1. Open exim.conf
pico /etc/exim.conf

2) Find this;
Ctrl + W: hostlist auth_relay_hosts = *

#########################
Runtime configuration file for Exim #
#########################

3) After hostlist auth_relay_hosts = *

add the following

log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn

4) The final result should look like this

hostlist auth_relay_hosts = *

log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn

#######################################
# Runtime configuration file for Exim #
#######################################

5) Save and restart exim DONE!
ctrl + X then Y
/etc/init.d/exim restart

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

Use this command –

grep cwd=\/home\/ /var/log/exim_mainlog| cut -d’ ‘ -f3 | sort -n | uniq -c

This will show you exact number of emails send by particular user..

What is Pear ?

Monday, April 23rd, 2007

PEAR Is short for ‘PHP Extension and Application Repository’

PEAR is having it’s primary goal to become a repository for PHP extensions and library code. The most important goal of the PEAR project is to try to define standard coding packages that can be used be developers directoly and it is re-usable coding.
Each package is a seperate project and is having a diffreent developer team.

Packages are in the gzipped tar files with a description file inside, and installed on your server using the PEAR installer.

You can install any pear package as
———–
pear install pear-package-name
———–

You can check all the PEAR packages that are available with
————
pear list-all
————

You can check installed PEAR packages on your server as
————
pear list
————

Linking Technorati

Sunday, April 22nd, 2007

Technorati Profile

Running CGI script from any directory or via /~username/cgi-bin

Sunday, April 22nd, 2007

In order to force apache to allow cgi script to run, simply create a file called .htaccess inside the directory in which you wish to run the scripts. Inser this text into the file:

Options +ExecCGI
AddHandler cgi-script .cgi .pl

What is Ruby on Rails ?

Saturday, April 21st, 2007

Maybe you’ve heard about Ruby on Rails, the super productive new way to develop web applications, and you’d like to give it a try, but you don’t know anything about Ruby or Rails.

That’s how the original version of Rolling with Ruby on Rails, published almost two years ago now, began. And it was true. Ruby on Rails (Rails for short) was super productive and it was super fun, too! A community of contributors grew up around it to make it even more productive and more fun! Rails has been growing fast.

What is Ruby?

Ruby is a pure object-oriented programming language with a super-clean syntax that makes programming elegant and fun. Ruby successfully combines Smalltalk’s conceptual elegance, Python’s ease of use and learning, and Perl’s pragmatism. Ruby originated in Japan in the early 1990s. It has become popular worldwide in the past few years as more English-language books and documentation have become available (and its popularity has really taken off since the introduction of Rails!).

What is Rails?

Rails is an open source Ruby framework for developing web-based, database-driven applications. What’s special about that? There are dozens of frameworks out there, and most of them have been around much longer than Rails. Why should you care about yet another framework?

What would you think if I told you that you can develop a web application at least ten times faster with Rails than you can with a typical Java framework? You can–without making any sacrifices in the quality of your application! How is this possible?

Part of the answer lies in the Ruby programming language. Rails takes full advantage of Ruby. The rest of the answer is in two of Rails’ guiding principles: less software and convention over configuration.

Less software means you write fewer lines of code to implement your application. Keeping your code small means faster development and fewer bugs, which makes your code easier to understand, maintain, and enhance. Very shortly, you will see how Rails cuts your code burden.

Convention over configuration means an end to verbose XML configuration files–there aren’t any in Rails! Instead of configuration files, a Rails application uses a few simple programming conventions that allow it to figure out everything through reflection and discovery. Your application code and your running database already contain everything that Rails needs to know!