Skip to main content

[FAQ] Information: Script & Programming Questions

Answers to common website script, programming and software questions.


Can I have access to Telnet / SSH / Shell access?
Can I run a message board or a forum on my hosting account?
Difference between running PHP as mod_php vs. CGI as a cgi/phpsuexec
Disabling Zend Optimizer...
Do the servers support Perl/CGI and PHP?
Do you have any preinstalled scripts that I can use?
Do you know of a command to allow me to use CRON to regually backup my site?
How do I create a phpinfo.php file?
How do I customise my error pages?
How do I enable mod_rewrite?
How do I make PHP ini settings?
How do I send E-Mail from an ASP Page?
How do I switch the PHP version on my website?
How do I turn Register Globals off?
How do I upload CGI files?
I cant see .htaccess files in my FTP program. What can I do?
I get a Disallowed Parent Paths Error, when using ASP?    
Interpreting the Website Statistics    
My CGI script returns internal server error?    
What components are installed on the Windows servers?    
What do I have to chmod CGI files to?    
What is the path to Perl?
What is the path to Sendmail?
What is the server path?

 

Can I have access to Telnet / SSH / Shell access?

Lounge Network enforces a strict "No SSH" policy, across ALL shared web hosting plans. This includes Telnet, SSH, & Shell access. This is now a standard policy of most quality web hosting providers in New Zealand. By having a "No SSH" policy, gives all of our clients the extra peace of mind in knowing that other clients on your server, do not have command line access to the server. This makes our hosting more secure, and less prone to exploits.
Most tasks that you use SSH for, can be accomplished using features in the hosting control panel, and using FTP. If you are on a CPanel hosting plan you can also use FTP over SSL.
If may also be possible to execute a shell script, by setting up a cron job in your control panel, with the commend. Just make sure you delete the cron, after you have finished with it.

Please note, the we will also instantly suspend any account that uses a script which can be used to elevate privileges or enable SSH services. In the event that this occurs no refund will be payable to the account holder or payee.

RETURN TO TOP OF PAGE

 

Can I run a message board or a forum on my hosting account?

Yes. The servers will support both Perl/CGI and PHP / LAMP message boards and forums on our linux servers, and ASP based software on our windows servers. Linux Hosting plans that include cPanel can automatically install open source message boards and forums from inside the control panel.

There are some older message boards that use flat files instead of a database (such as MySQL) to store all data which in its turn causes high server loads and is a lot slower. Therefore, we only allow message boards that use databases.

RETURN TO TOP OF PAGE

 

Difference between running PHP as mod_php vs. CGI as a cgi/phpsuexec

1) mod_php is run as an Apache module which reduces the amount of overhead in processing each script by not needing to start a new process. In lower traffic situations you should not notice any difference.

2) CGI is generally accepted as being more secure and works around some of the problems associated with using modules such as chmod 777 directories. All CPanel hosting plans will now run under phpsuexec for the added security it offers.

RETURN TO TOP OF PAGE

 

Disabling Zend Optimizer...

For most accounts Zend Optimizer is enabled by default. Howeverr for some scripts the Zend Optimizer can cause issues or error

For Corporate and Business Hosting Plans, please following the instructions on this page https://support.loungenetwork.co.nz/2010/01/faq-information-corporate-business.html#turnoffregisterglob , up to 'Step 5' where you will be able to see in your control panel 'Page Compression' to turn it on or off .

For CPanel Based Hosting Plans, please follow the instructions below:

====================================
CPANEL SERVERS:
====================================

You will need to put

zend_optimizer.optimization_level=0

into a php.ini file in a folder named _custom_php_settings in the folder of the script. This will need to be home/user/public_html/folderofscript/_custom_php_settings or similar. Replace user with your CPanel login username. The command for turning it on is zend_optimizer.optimization_level=15

RETURN TO TOP OF PAGE

 

Do the servers support Perl/CGI and PHP?

Yes, the servers support both Perl/CGI and PHP.

As it is third party software, we don't provide programming help for these services.

RETURN TO TOP OF PAGE

 

Do you have any preinstalled scripts that I can use?

Yes. We have a variety of Perl/CGI and PHP scripts that you can use. To give you some examples, we have message board, counter, guestbook, chat and more.

RETURN TO TOP OF PAGE

 

Do you know of a command to allow me to use CRON to regually backup my site?

Please try the following command and customise it for your website. Please note we don't provide any support for this command and clients use it at their own risk. We suggest clients use a third party backup service for any files they store in their hosting space, especially if your website is used for business purposes.

wget --http-user= --http-passwd= --delete-after"http://www.domain.com:2082/frontend/x2/backup/dofullbackup.html?dest=ftp
&email=&server=&user=upload&pass=upload"

RETURN TO TOP OF PAGE

 

How do I create a phpinfo.php file?

Paste the following code into microsoft notepad (or a similar text editor), and save it as phpinfo.php. Then upload the phpinfo.php file into the directory you would like to test. You can then run the phpinfo.php file by going to it's location in your web browser. eg www.yourdomain.co.nz/myfolder/phpinfo.php

<?php

// Show all information, defaults to INFO_ALL

phpinfo();

// Show just the module information.

// phpinfo(8) yields identical results.

phpinfo(INFO_MODULES);

?>


RETURN TO TOP OF PAGE

 

How do I customise my error pages?

The method of customising error pages (such as the ones displayed when the HTTP server returns 404 Not Found or 403 Forbidden) differs depending on if you have a Linux site or a Windows site.

Linux Sites

For cPanel users, you can set this up in your cPanel control panel, or using the method below.

For all other users, create a file named .htaccess in notepad (or similar text editor) containing lines in the form:

ErrorDocument 404 /errors/notfound.html

You can add extra lines defining different errors, for example:

ErrorDocument 403 /errors/forbidden.html

After creating this file, upload it to your root FTP folder.
Make sure the error pages you have defined exist on your server as well.


Windows Sites

You will need to define HTTP error codes in your global.asa file. The following website may be of some help http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=639

RETURN TO TOP OF PAGE

 

How do I enable mod_rewrite?

On most of our linux servers mod_rewrite is available. You will have to use the .htaccess file to enable it and your code should look something like this:

RewriteEngine on
RewriteRule ^old.html$ new.html

More info can be found at the offical php developers website.

To check if your server has mod-rewrite installed, you can upload your own phpinfo.php file that shows you what is installed on the server. You can do by following the instructions here


Important note for clients who have switched from a phpsuexec environment to a mod_php environment:

Please note that under a phpsuexec environment, mod_rewrite works in a similar way to how it did on the mod_php environment. However if you are having trouble with mod_rewrites in the phpsuexec environment after changing from a mod_php environment, you will need to ensure that the rewrite is compatible with phpsuexec as the mod_rewrite code is sometimes different when dealing with mod_rewrite. If you are having trouble , please check the documentation for your scripts to make sure it is correctly configured to work with phpsuexec.

RETURN TO TOP OF PAGE

 

How do I make PHP ini settings?

There are two choices for making a PHP ini setting. You can either supply a complete php.ini file, or you can supply one or more additional ini files which contain only specific settings you wish to change.

Some software packages may instruct you to add php_flag or php_value settings to an .htaccess file. For the CPanel Libra & Concorde servers, you must instead use a PHP ini setting. As with .htaccess files, you can make a php.ini file in your text editor as shown below.


_custom_php_settings method

Create a directory called _custom_php_settings in the same directory as the php file that is being requested, inside this directory you can create as many ini files as your require, each will be read (in no particular order) and the ini settings applied "over the top of" the normal php.ini. You need to follow this method if you are using a .htaccess file for something else.

RETURN TO TOP OF PAGE

 

How do I send E-Mail from an ASP Page?

CDONTS has been deprecated by Microsoft in favor of CDOSYS on hosting plans on Windows 2003 Servers. This applies to both our Corporate and Business Hosting plans. CDO.Message is supported and JMail should also work. For a list of components that are installed on the Windows Servers click here.
Please see the following website for more information sending email through CDO

http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-with-cdo.html

For other windows hosting plans that are still hosted on the windows 2000 server, you can still use CDONTS. The following is the actual ASP code that you can use to send an email from ASP page. Make sure that this website is hosted on a Windows 2000 web server. For Windows 2003 web servers, see the link above.

<%

Dim MyBody
Dim MyCDONTSMail

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")


MyCDONTSMail.From= "my@from.email.address"
MyCDONTSMail.To= "my@to.email.address"
MyCDONTSMail.Subject="my subject"


MyBody = "my message body" & vbCrLf
MyBody = MyBody & "additional message body" & vbCrLf
MyBody = MyBody & "additional message body"


MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing


%>


RETURN TO TOP OF PAGE

 

How do I switch the PHP version on my website?

For CPanel Hosting Accounts:
Login to your cPanel control panel at http://www.web.loungenetwork.co.nz/login-cpanel.php. Then go to the icon that is labeled "PHP Configuration" on the main cPanel page. Click this icon and choose which version of PHP you'd like.

Useful Notes:

- If you are using *.ini files on your website. In PHP5 any *.ini file in a directory full replaces the system php.ini .
To implement only your changes from your *.ini - please create a directory named _custom_php_settings (must be typed exactly like this), under the needed directory and move the *.ini in that new folder. Any .ini files will then be included after the system one.


For Corporate and Business Class Hosting Accounts:
To switch your site to a different PHP version please change to the relevant domain template. If you are using a custom domain template, make sure you setup a new domain template with the php version you want to use, and then copy any custom DNS settings settings across. Then you will be able to switch domain templates and check if it works how you expect.

Please note that as PHP is third party software, and we don't provide any form of support for it.

RETURN TO TOP OF PAGE

 

How do I turn Register Globals off?

For Corporate and Business Hosting Plans, please following the instructions on this page

For CPanel Based Hosting Plans, please follow the instructions below:


====================================================================
CPANEL SERVERS
====================================================================

CPanel based servers use phpsuexec, and phpsuexec will ignore all php_flag options in .htaccess files. Therefore you must use the following method to turn register_globals to off.


You will need to enter the command

register_globals = off

into a php.ini file. You can create an php.ini file, by using a text editor such as microsoft notepad, typing in the command, and then saving the file as php.ini .
This php.ini file then must go into a new folder that you must create, which you must name _custom_php_settings (this must be typed exactly like this). This _custom_php_settings folder and php.ini file inside it, needs to go into the folder of the script. This will need to be home/user/public_html/folderofscript/_custom_php_settings or similar. Replace user with your cPanel login username. This _custom_php_settings folder and php.ini file must go into ALL directories and subdirectories that contains php files that you need register_globals turning off. There are also tools available that can automatically copy these folders and php.ini files into all folders and sub folders.

It is also possible to put the php.ini file directly in the folder of the script, but this will reset all PHP settings to the default. This page describes the difference in techniques

If you would like to test that it is working, you will need to upload a phpinfo.php file into each directory that you want to test, and then load the phpinfo.php file in your webbrowser. This will then show you what settings are on and off. Instructions showing how to create a phpinfo.php file can be found here.



If you have already got a file named php.ini file in the _custom_php_setting folder and you don't want to alter it or it's settings, you can command register_globals to off by following the instructions below.

1) Create a folder named _custom_php_settings in the directory the script is running in. If the script is in directory /home/user/public_html/script then you will create the directory /home/user/public_html/script/_custom_php_settings. Replace user with your cPanel login username.

2) Create a file named settings.ini that contains register_globals = off in the same format as a php.ini file.

3) Upload the settings.ini into the _custom_php_settings folder (you may need to create this folder if it isn't there) . The settings.ini file can override any php.ini setting without replacing the php.ini file entirely.

RETURN TO TOP OF PAGE

 

How do I upload CGI files?

Upload CGI files via FTP. However ensure the transfer mode is ASCII to avoid problems. CGI files are normally uploaded into the cgi-bin directory. Since CGI runs under your username you must also chmod to 755. Do NOT chmod CGI files to 777!

RETURN TO TOP OF PAGE

 

I cant see .htaccess files in my FTP program. What can I do?

Some FTP programs don't show 'dot' files, files or directories that starts with a “.”, by default.

Below is instructions on how to show dot files in popular FTP programs. Please consult your FTP softwares userguide or your FTP softwares vendor support if you need further help to view hidden files.



FileZilla:

View -> Show hidden files.


Cute FTP

Open the Site Manager (press F4) and click on the name of the relevant site.
Click the Actions tab, then click Filter.
Select the Enable Filtering check box.
In Server side filtering, select the Enable Server Side Filtering check box.
In the Remote Filter box, type -a.
Click OK, then click Connect.


WS_FTP Pro (7.62)

Sites
Organize sites
Site options
Startup tab
In Remote Filter Mask box enter -a

RETURN TO TOP OF PAGE

 

I get a Disallowed Parent Paths Error, when using ASP?    

Issue

When you use relative paths in include statements with Microsoft's Active Server Pages (ASP), browsing a Web page may return an error message similar to the following:

Active Server Pages, ASP 0131
Disallowed Parent Path
The Include file '../<filename.ext>' cannot contain '..' to indicate the parent directory.
/<path>/<filename.ext>, line <number>



Cause

This error occurs due to parent paths being disabled for the website or application and relative parent paths are used in include statements, as the example shows below:
<!--#include file="../<filename.ext>"-->



Solution

The solution is to use absolute virtual paths from the root of the Web site instead of relative paths.

For example, if you use an include file named "yourcode.inc" at the root of your server, the virtual path would be "/mycode.inc." If you use the same include file in a virtual directory named "/includes" on your server, the virtual path would be "/includes/yourcode.inc."

The example below illustrates how to implement virtual paths:

<!--#include virtual="/<virtual path>/<filename.ext>"-->

 

RETURN TO TOP OF PAGE

 

Interpreting the Website Statistics 

Interpreting the Website Statistics


Hits represent the total number of requests made to the server during the given time period (month, day, hour etc..).



Files represent the total number of hits (requests) that actually resulted in something being sent back to the user. Not all hits will send data, such as 404-Not Found requests and requests for pages that are already in the browsers cache.



Tip: By looking at the difference between hits and files, you can get a rough indication of repeat visitors, as the greater the difference between the two, the more people are requesting pages they already have cached (have viewed
already).



Sites is the number of unique IP addresses/hostnames that made requests to the server. Care should be taken when using this metric for anything other than that. Many users can appear to come from a single site, and they can also appear to come from many ip addresses so it should be used simply as a rough guage as to the number of visitors to your server.



Visits occur when some remote site makes a request for a page on your server for the first time. As long as the same site keeps making requests within a given timeout period, they will all be considered part of the same Visit. If the site makes a request to your server, and the length of time since the last request is greater than the specified timeout period (default is 30 minutes), a new Visit is started and counted, and the sequence repeats. Since only pages will trigger a visit, remotes sites that link to graphic and other non- page URLs will not be counted in the visit totals, reducing the number of false visits.



Pages are those URLs that would be considered the actual page being requested, and not all of the individual items that make it up (such as graphics and audio clips). Some people call this metric page views or page
impressions, and defaults to any URL that has an extension of .htm, .html or .cgi.



A KByte (KB) is 1024 bytes (1 Kilobyte). Used to show the amount of data that was transfered between the server and the remote machine,
based on the data found in the server log.





Common Definitions


A Site is a remote machine that makes requests to your server, and is based on the remote machines IP Address/Hostname.



URL - Uniform Resource Locator. All requests made to a web server need to request something. A URL is that something, and represents an object somewhere on your server, that is accessable to the remote user, or results in an error (ie: 404 - Not found). URLs can be of any type (HTML, Audio,
Graphics, etc...).



Referrers are those URLs that lead a user to your site or caused the browser to request something from your server. The vast majority of requests are made from your own URLs, since most HTML pages contain links to other objects such as graphics files. If one of your HTML pages contains links to 10 graphic images, then each request for the HTML page will produce 10 more hits with the referrer specified as the URL of your own HTML page.



Search Strings are obtained from examining the referrer string and looking for known patterns from various search engines. The search engines and the patterns to look for can be specified by the user within a configuration file. The default will catch most of the major ones.



Note: Only available if that information is contained in the server logs.



User Agents are a fancy name for browsers. Netscape, Opera, Konqueror, etc.. are all User Agents, and each reports itself in a unique way to your server. Keep in mind however, that many browsers allow the user to change it's reported name, so you might see some obvious fake names in the
listing.



Note: Only available if that information is contained in the server logs.



Entry/Exit pages are those pages that were the first requested in a visit (Entry), and the last requested (Exit). These pages are calculated using the Visits logic above. When a visit is first triggered, the requested page is counted as an Entry page, and whatever the last requested URL was, is counted as an Exit page.



Countries are determined based on the top level domain of the requesting site. This is somewhat questionable however, as there is no longer strong enforcement of domains as there was in the past. A .COM domain may reside in the US, or somewhere else. An .IL domain may actually be in Isreal, however it may also be located in the US or elsewhere. The most common domains seen are .COM (US Commercial), .NET (Network), .ORG (Non-profit Organization)
and .EDU (Educational). A large percentage may also be shown as Unresolved/Unknown, as a fairly large percentage of dialup and other customer access points do not resolve to a name and are left as an IP address.



Response Codes are defined as part of the HTTP/1.1 protocol (RFC 2068). These codes are generated by the web server and indicate the completion status of each request made to it.



mrunix.net


RETURN TO TOP OF PAGE

 

My CGI script returns internal server error?    

This usually occurs when permissions are loosely set. As a security measure our servers will throw an internal server error when it considers that permissions are not secure. Since CGI runs under your username you must chmod to 755. Do NOT chmod CGI files to 777!

RETURN TO TOP OF PAGE

 

What components are installed on the Windows servers? 

For our Corporate and Business Windows hosting plans, the following components are installed. (as of 2010 when this article was written.) Please contact us if you need more up to date information.

  • IIS 6.0

  • ASP 2.0

  • ASP 1.0

  • MySQL Connector / ODBC 3.51










For other all Windows hosting plans, which are the ones that don't have a Hosting control panel, the following components are installed:

- DunDas Mailer
http://mfc.dundas.com/products/onlinedocs/FreeProds/Ultimatetcpip/Mailer/MailOverview.htm
- DunDas Upload
http://aspalliance.com/dundas/default.aspx
- CXImageATL
http://www.codeproject.com/asp/thumbtools2.asp
- GeoIP
- DPSAUTH
http://www.paymentexpress.co.nz/blue.asp?id=d_dpsauth
- PXAccess
http://www.paymentexpress.co.nz/blue.asp?id=d_pxaccess
- chartDirector
http://www.advsofteng.com/product.html


(The components and versions on the windows servers may have changed since this list was generated)


RETURN TO TOP OF PAGE

 

What do I have to chmod CGI files to?

As CGI runs under your username, CGI files must be chmod to 755.

RETURN TO TOP OF PAGE

 

What is the path to Perl?

CPANEL USERS:

The path for Perl is:

/usr/bin/perl

The first line of your executable perl scripts should read: #!/usr/bin/perl



CORPORATE AND BUSINESS PLAN USERS:

The path for Perl is:

/usr/local/bin/perl



NON CONTROL PANEL PLANS:

The path to Perl is:

/usr/bin/perl -w


Please Note: Perl is only available on Linux Webservers

RETURN TO TOP OF PAGE

 

What is the path to Sendmail?

CPANEL USERS:

The path to Sendmail is: /usr/sbin/sendmail



CORPORATE AND BUSINESS PLAN USERS:

The path to Sendmail is: /usr/sbin/sendmail



NON CONTROL PANEL PLANS:

The path to Sendmail is: /usr/lib/sendmail

RETURN TO TOP OF PAGE

 

What is the server path?

The server path is /home/YOUR_ACCOUNT_USERNAME/public_html/

YOUR_ACCOUNT_USERNAME is the username that you log into cPanel with.

If you are on our Corporate Web Plan, your server path can be found in the 'help' section of the console.

RETURN TO TOP OF PAGE