## Check if the cPanel Ports are Open

Posted by: admin  :  Category: cPanel & WHM, Linux Server Hosting, Tips & Tricks

As experienced by some of our clients, most especially those students who are working behind a network that utilizes web filtering softwares, the non-standard HTTP ports cPanel works with causes them minor headaches. Usually cPanel can be opened from:

1. http://yourdomainname.com/cpanel
2. http://yourdomainname.com:2082
3. http://cpanel.yourdomainname.com

At times, local firewalls allow only access to sites on port 80. If that will be the case, use the last URL. Note that the third address is a web-based proxy which provides you with the option to access your cPanel via the default HTTP port 80. This helps if your Internet Service Providers (ISP) blocked ports 2082 and 2083.

You may check if the ports are blocked executing the following commands:

If you are running Windows do the following:

1. Click Start
2. Click Run
3. Type cmd
4. Type telnet yourdomainname.com 2083
5. Type telnet yourdomainname.com 2082

If you are running Linux do the following:

1. Start your Linux/Mac OS console terminal
2. Type telnet yourdomainname.com 2083
3. Type telnet yourdomainname.com 2082

If the port is not blocked the results should look like the following one. Trying IP_of_the_server ( 10.10.10.10 for an example )…

Connected to servername.com.
Escape character is ‘^]’.

Different result will means that the port is blocked.

## The aspnet_client Folder

Posted by: admin  :  Category: Tips & Tricks, Windows Server Hosting

ASP.net developers should be aware of the aspnet_client folder in their webhosting accounts. This folder is related to ASP.net runtime validation and has its own importance. This folder is automatically created when you enable the ASP.net extension on your site. The aspnet_client folder contains the client-side code used by some of the ASP.NET Web Form controls, namely Validation and SmartNavigation. The scripts contained in this folder get called by webpages that utilize controls that need these scripts. If you use a control that uses one of the scripts in this folder and the script can’t be found, then that control will not be able to do its client-side job.

The aspnet_client folder should be considered as the ASP.NET runtime component not your ASP.NET application. The scripts in the folder might change in the new version. This is why Publish Site tool will delete it first and then ASP.net will recreate it. If you had a web application developed in an older version, then published it to a web site with a newer version of ASP.NET, the aspnet_client should have the scripts from the same version of ASP.NET. So it is a good practice to let ASP.NET maitain this folder.

If your aspnet_client directory is missing, you may encounter errors with your application such as

“Unable to find script library ‘/aspnet_client/system.web/1_0_3705_272/webUIValidation.js’”

To resolve this, you can manually copy the folder to the root directory of your domain name.

## cPanel Webhosting Security

Posted by: admin  :  Category: cPanel & WHM, Linux Server Hosting, Security

PHP version 5.2 has an improved handling of remote code which reduces greatly security problems.

Tweak your local PHP settings for better security– this can be done by disabling unnecessary functions and options. Here are some sample recommended directives:

allow_url_fopen=off

disable_functions = proc_open , popen, disk_free_space, set_time_limit, leak, tmpfile, exec, system, shell_exec, passthru

Note that the above directives can cripple your code’s functionality. They have to be pasted in a php.ini file in each directory you’d like to have them applied.

Deny Perl and other bots from accessing your site. This can be easily done with the following rules in your .htaccess:

order deny,allow

If you are not using Perl scripts, add a bogus handler for these files. In your home directory create a .htaccess file with the following content:

<FilesMatch “\.(cgi|pl|py|txt)”>

Deny from all

</FilesMatch>

##If you are using a robots.txt file, please remove the

# sign from the following 3 lines to allow access only to the robots.txt file:

#<FilesMatch robots.txt>

#Allow from all

#</FilesMatch>

The above will prevent Perl scripts to be executed. Many exploits or backdoors are written in Perl and the above will prevent them from running. This directive will apply to all your sub-directories.

Filter possible intrusions make sure about Apache’s Mod Security. Mod Security is an Application firewall integrated with Apache. We at TurfSitePH.net can assist you with regards to enabling Apache’s Mod Security with your accounts, just email us via support@turfsiteph.net

## Create Image Thumbnails in cPanel

Posted by: admin  :  Category: cPanel & WHM, Linux Server Hosting, Tips & Tricks

Did you know that cPanel has a tool that can create thumbnails of existing images? This tool allows you to create a small (thumbnail sized) version of any image in a directory on your site.

This can be useful in creating a page where smaller previews of all your images can be viewed before the larger, original image is accessed, saving bandwidth.

The application is known as the Thumbnailer and can be accessed by clicking Image Manager, then clicking the Thumbnailer link. From here, an entire directory must be selected.

How to convert a directory of images to thumbnails:

1. Navigate to the directory you would like to change the images to thumbnails.
2. Click the name of the folder in blue to create thumbnails for the images in the directory.
3. Click Thumbnail Images to finish the process.
• You may use the Scale Percent text boxes to define how small the images should be.
• We recommend that you keep the Keep Aspect Ratio checked when creating thumbnails to prevent the image from becoming distorted by keeping the height and width proportional.
• You may click Reset Dimensions to return the Scale Percent values to the default settings.

After the application has completed the task of resizing your images, a thumbnails directory will be created as a subdirectory within the selected folder. The thumbnail images will be created with the prefix tn_*, where * is meant to represent the filename and extension.

Click the Your images have been thumbnailed into link to open the thumbnails directory in the cPanel File Manager.

## Connect to a MS Access Database from an ASP Script

Posted by: admin  :  Category: Codes & Scripts, Windows Server Hosting

If you will be using an existing Microsoft Office Access database as storage for your website or web application, you may use the following code to connect with your .mdb file:

<%
Dim ConnectionString
ConnectionString = “DRIVER={Microsoft Access Driver (*.mdb)};” &_
“DBQ=C:\path\to\file.mdb;DefaultDir=;UID=;PWD=;”

Dim Connection

Connection.ConnectionTimeout = 30
Connection.CommandTimeout = 80
Connection.Open ConnectionString
%>

While the above works for many of our older servers. The following works on our newer servers. You’ll need to make sure that your application is running in a Dedicated App Pool (check box under the website inside your control panel) and that MDAC is installed on the server which all of our new servers already have installed (ask our support staff if it doesn’t work).

<%
Dim ConnectionString
ConnectionString = “Provider=Microsoft.Jet.OLEDB.4.0;” &_