Webhosting Tips

Posted by sean | Uncategorized | Friday 15 August 2008 12:08 pm

Here are a few things to look before starting starting with webhosting services

Domain Name: It is the very first thing that you should do when launching anything on the Internet/webworld.  Domain reserves your intended name to you, before somebody else grabs that great idea of yours!

Price:It should not be your main concern! There are many free services are available, however, if you are serious about your website, you should consider a paid service.  Almost all free services will display pop-up banners or the like on your website.  As a result, you won’t have full control over your website’s content or look.

Reliability:It should be one of your major concerns.If your website is constantly down, your clients will wonder if you have gone out of business, and may look elsewhere.  Therefore a reliable service is a requirement to ensure constant growth.  A point of interest is if your website is unavailable when search engines are trying to index it, you may be removed completely.

OS:Most of the hosting provider offers both Linux and Windows OS,but most of them use Linux based hosting service. Because with it you will get more control over your website, without incurring special setup fees for items such as Custom Error Pages.  For example, NT hosts may charge a fee for each custom error page, while it’s simple to do yourself under Linux.

Windows 2003 commands

Posted by sean | Uncategorized | Friday 15 August 2008 12:06 pm

Management Consoles
compmgmt.msc - Computer management
devmgmt.msc - Device Manager
dfrg.msc - Defragment
diskmgmt.msc - Disk Management
eventvwr.msc - Event Viewer
gpedit.msc - Group Policy -XP Pro only
iis.msc - Internet Information Services
lusrmgr.msc - Local Users and Groups
mscorcfg.msc - Net configurations
perfmon.msc - Performance Manager
secpol.msc - Local Security Policy
services.msc - System Services
wmimgmt.msc - Windows Management

Steps to create a FTP account

Posted by sean | Uncategorized | Friday 15 August 2008 12:05 pm

1) Login to your control panel http://yourdomain.com/cpanel/
2) Click on ‘FTP Manager’
3) Choose ‘FTP Accounts’
4) Click ‘Add FTP Account’
3) Enter the username and password you want, along with where you want to place them.

How to enable the Zend Optimizer

Posted by sean | Uncategorized | Friday 15 August 2008 12:05 pm

For enabling the Zend Optimizer,you will need to create a file called ~/public_html/php.ini with the following contents:

=============
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.1
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.1
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
=============

If in case the php script that requires the Zend Optimizer is in another directory besides public_html (like a subfolder) then copy this php.ini file to that directory as well.

How to stop Badwidth theft?

Posted by sean | Uncategorized | Friday 15 August 2008 12:04 pm

An apache Server’s Mod Rewrite Engine which can be compiled into your server to allow you to do this it can examine the name of the document requesting a file of that particular type. After that you can define logic that basically does the following:

1)If the URL of the page requesting the image file is from an allowed domain, will display the image- otherwise it will return to a broken image.

2) The logic, or rules are then placed in the directory which contain your image files.

How exactly can I do this?

1) Make certain that your Apache Server was compiled with mod_rewrite. Basic installation of Apache does not include it by default. If mod_rewrite is not installed do not attempt this , otherwise your website may stop functioning! Check with your system administrator. If you are the system administrator,then check the Apache INSTALL file for instruction regarding the option –enable-module=rewrite

2)Now try to get all of your images into directories that do not contain your HTML files. Each directory containing the images should have an empty index.html file to prevent people from looking at your directory listing.

3) Create or edit a .htaccess in one of the directories containing your images. I will suggest doing one directory first so you can test your rules, and quickly comment out the lines or rename the file if it causes server configuration errors. The .htaccess file should contain the following lines.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*\.gif$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteRule .*\.jpg$ - [L]

NOTE:When copying and pasting, please be sure that each RewriteCond is on one line. Line wrapping in the page display could introduce broken lines.

4)Now test! Create a page on another server and insert in image tag pointing to an image in the protected directory. If you get a broken image icon- you did it! The requests will still appear in your logs, but your bandwidth will be protected.
On files such as .MIDI (music files), it will result in a Forbidden error.

Optimize your PHP installation to handle large file uploads.

Posted by sean | PHP Hosting | Friday 15 August 2008 12:02 pm

Though PHP presents a very versatile and user friendly interface for handling file uploads,the default installation is not geared for working with files in excess of 2 Mega Bytes. This article is an aid to configuring PHP for handling suc h large file transfers.

php.ini

The php.ini file contains all the configuration settings for your installation. Sometimes these setting might be overridden by directives in apache .htaccess files or even with in the scripts themselves but for the moment let’s just concentrate on the ini file.

This file contains the following settings that we need to modify

* file_uploads

* upload_max_filesize

* max_input_time

* memory_limit

* max_execution_time

* post_max_size

The first one is fairly obvious if you set this off, uploading is disabled for your installation. We will cover the rest of the configuration settings in detail below.

upload_max_filesize and post_max_size

Files are usually POSTed to the webserver in a format known as ‘multipart/form-data’. The post_max_size sets the upper limit on the amount of data that a script can accept in this manner. Ideally this value should be larger than the value that you set for upload_max_filesize.

It’s important to realize that
upload_max_filesize is the sum of the sizes of all the files that you are uploading. post_max_size is the upload_max_filesize plus the sum of the lengths of all the other fields in the form plus any mime headers that the encoder might include. Since these fields are typically small you can often approximate the upload max size to the post max size.

According to the PHP documentation you can set a MAX_UPLOAD_LIMIT in your HTML form to suggest a limit to the browser. Our understanding is that browsers totally ignore this directive and the only solution that can impose such a client side restriction is Rad Upload Applet

memory_limit

When the PHP engine is handling an incoming POST it needs to keep some of the incoming
data in memory. This directive has any effect only if you have used the
–enable-memory-limit option at configuration time.
Setting too high a value can be very dangerous because if several uploads are being handled concurrently all available memory will be used up and other unrelated scripts that consume a lot of
memory might effect the whole server as well.

max_execution_time and max_input_time

These settings define the maximum life time of the script and the time that the script shouldspend in accepting input. If several mega bytes of data are being transfered max_input_time should be reasonably high. You can override the setting in the ini file for max_input_time by calling the set_time_limit() function in your scripts.

How do I use PHP with my hosting account

Posted by sean | CGI Hosting | Friday 15 August 2008 12:01 pm

1) To use PHP within your account make a file and give it a “.php” file
extension (e.g., example.php).

2) Inside this file you can put any HTML that would normally go in a
Web page.

3) Anywhere in that file, within the HTML, you can put your PHP code.

4) PHP code always begins with a “”.

What is the path to PERL?

Posted by sean | Perl Hosting | Friday 15 August 2008 11:59 am

The perl path is the very first line in every .cgi or .pl file. The path to the perl interpretor
will be either:

#!/usr/bin/perl

or

#!/usr/local/bin/perl

Either of which will work.

CGI::How to add our own srcipt

Posted by sean | CGI Hosting | Friday 15 August 2008 11:59 am

1) You can easily run CGI scripts in your own “cgi-bin” directory through your Linux based web servers. Scripts may be written in Perl and CGI languages.

Few helpful tips are given below which can be followed at the time of scripts installation:

1)First upload to your cgi-bin directory to ensure the proper file permission settings. All the scripts on our web server must have permissions set to 755 (rwx-rx-rx). If in case you will need any help in changing script permissions, please see the following:

2) Upload in ASCII transfer mode (and NOT BINARY mode)

3) The first line of each script must read: #!/usr/bin/perl

4) Ensure the permissions are set to 755

Common coding errors of perl

Posted by sean | Perl Hosting | Friday 15 August 2008 11:58 am

Many errors occured because of bad paths. Therefore for precautions people should always try to use full path names and
make sure that the files they are manipulating/accessing are there and with the proper permissions set.Unescaped characters. @has a special meaning in perl to signify an @rray.Lots of times people do something like my $url = “sam@samshouse.com” This is incorrect and needs to be specified as “sam\@samshouse.com. Quotation marks need to be escaped this way also.

Next Page »