web space MK
   Home Page  Hosting  Multi Sie Hosting  Domain Name Registration  Support  Contact Adey
 



CGI

Microsoft Front Page


CGI
What is CGI?
CGI stands for "Common Gateway Interface," a name for the computer programs running on the web server that can be invoked from a www page at the browser.

The "BIN" part alludes to the binary executables that result from compiled or assembled programs. It is a bit misleading because cgi's can also be Unix shell scripts or interpreted languages like Perl.

CGI scripts need to be saved in ASCII format and uploaded to your server's cgi-bin in ASCII or text format. This is very important to remember, because they will not work or result in errors if uploaded in binary.
[Back to top]

Where do I put CGI scripts?
Put your cgi scripts in the public_html subdirectory named "cgi-bin". If you have a need to put them elsewhere... you better email us because there are some security issues which may prevent you from doing so. We'll try to help though.

[Back to top]

Paths to Date, Mail, Perl etc.
Here are your paths to the common server resources that CGI scripts often require:

Date: /bin/date

Sendmail: /usr/lib/sendmail

Perl5: #!/usr/bin/perl

Serverpath: /home/username/domain-www/cgi-bin

Root path: /home/username/ - (puts you in your the root of your account)

Domain directory: /home/username/public_html - (puts you in your public_html directory)

Cgi-bin script: /home/username/public_html/cgi-bin/filename - (puts you in your cgi-bin with the script. The 'filename' is commonly .pl or .cgi)

NOTE: Do not include domain extension anywhere you list your domain name
[Back to top]

Setting Permissions Using Your File Manager
Log into your Control Panel and then click on File Manager. You will now see a list of directories within the root of your account. Since all of your html files and subdirectories are uploaded and created within your public_html directory, you need to click on the file folder next to the public-html directory name. The directory will open and in the upper right hand corner, there will be a list of actions that you can perform for that directory. Next click on the file icon located next to the text name of the file that you want to change permissions for. In the upper right hand corner you will see a list of actions that you can perform with this file.

Simply click on Change Permissions, select the appropriate permissions and save.
[Back to top]

Setting Permissions Using WS_FTP for Windows
WS_FTP accomplishes the same task as above. Just highlight the file you want to check, and right-click on it. A menu will pop up, then select CHMOD. Click on the appropriate settings as needed. (Refer to the Permission Definitions below for an explanation of settings.)

Permission Definitions

Owner = the files users (you)

Group = the files group

Others = all others

r = read access

x = execute access

w = write access

Numerical Definitions:

r = 4

x = 2

w = 1

'chmod' is a word used for changing Permissions from within Telnet or your FTP client. Some scripts will tell you to chmod 775 (for example). When using the numeric system, the code for permissions is as follows:

4 + 2 + 1 (rwx) = 7

The first number applies to Owner, the second number applies to Group, and the third number applies to Others. Therefore the first 7 of the chmod 775 tells Unix to change the Owner's permissions to rxw (because r=4 + w=2 + x=1 adds up to 7, this giving the Owner Read, Write, and Execute Permission).

The second 7 applies to the group, this giving the Group Read, Write, and Execute Permission, and the last number 5, refers to Others (4 + 1= 5), giving Others only Read and Execute Permission.

The permissions for chmod 775 look like this;

rwx rwx -rx

Permissions are always broken up into three groups of letters, however if there is a dash, this dash simply means that Permission wasn't given for that particular function. For example, in the chmod 775, Permission to Write was not given to Others.

Remember: the first 3 letters always apply to Owner, the second 3 apply to Group, and the third 3 apply to Others.
[Back to top]

Common CGI Problems
Below are solutions to some of the more common CGI script problems.

When I activate my CGI program, I get back a page that says “Internal server error. The server encountered an internal error or mis-configuration and was unable to complete your request.”
This is generally caused by a problem within the script. Check your script settings again to see that you have entered the correct server information and have set the correct permissions for the script. If this information is correct, you'll need to contact whoever wrote or is distributing the script for further assistance.

I am being told "File Not Found," or "No Such File or Directory."
Upload your Perl or CGI scripts in ASCII mode, not binary mode.

When I test my Perl script in local mode (by Telnet), I have the following error: "Literal @domain now requires a back slash at myscript.pl line 3, within string. Execution of myscript.pl aborted due to compilation errors."
This is caused by a misinterpretation by Perl. You see, the "@" sign has a special meaning in Perl. It identifies an array (a table of elements). Since it cannot find the array named domain, it generates an error. You should place a back slash () before the "@" symbol to tell Perl to see it as a regular symbol, as in an email address.

I am getting the message "POST not implemented."
You are probably using the wrong reference for cgiemail. Use the reference /cgi-bin/cgiemail/mail.txt. Another possibility is that you are pointing to a cgi-bin script that you have not put in your cgi-bin directory. In general, this message really means that the web server is not recognizing the cgi-bin script you are calling as a program. It thinks it is a regular text file.

[Back to top]


MICROSOFT FRONTPAGE 98

Publishing a Website

After you have built your html documents and are ready to upload them to your site:

1. Open the web you've created on your PC using FP Explorer.

2. Choose File > Publish

3. If your "Destination Web Server" doesn't appear in the Publish window (it won't the first time you publish to our server) CHOOSE "More Webs" and type the location of the web to publish to. Hit return.

IMPORTANT: Use www.yourdomain.com as the Destination Web Server to publish to your server. Leave the "Destination Web Name" BLANK.

4. You will be asked for your USERNAME and PASSWORD. This is your domain's USERNAME and your FrontPage PASSWORD (which may be different than your regular telnet/ftp/POP password). If you're not sure what it is or if you aren't allowed past this point, you'll need to contact us for a new FP password.

5. You can watch the progression of the upload by looking at the bottom left corner of FP Explorer.

Opening an Existing Website

1.Open FP Explorer and choose File > Open Front Page Web.

2.You can now choose to open a previously created web on your PC or your web on your server.

3. Highlight the appropriate web or type in the web address

4. (www.yourdomain.com) and click OK.

5. Enter your USERNAME and FP PASSWORD if required.

6. Make modifications and recalculate links if needed. (See FP help docs for info on recalculating links)

Troubleshooting Common Problems with FP98

Getting error - "Root Web Busy"
FTP or telnet to your site and remove the "service.lck" file in /public_html/_vti_pvt. This usually happens when an FP session is interrupted before completion.

Server timing out when publishing large sites
This difficulty arises when the uploading link times out in the process of copying the web to our server. The only suggestion Microsoft has offered so far is to break the main web into a group of sub webs on your PC, then upload these individually. If this problem persists for you, please contact support.

Getting Error - "Front Page Extensions not Installed"
We often see this error being reported, even when the extensions have been installed. If you get this error, please contact support and we'll make sure the extensions are installed and repair them if necessary. NOTE: The extensions are easily corrupted. Please use only FP Explorer to update your web site on the server, not FTP.

I published my web site but it's not there!
This will happen when the "Destination Web Name" is filled in when publishing to your server. This box should be left blank. If you put any other name in this box it will create a subdirectory of your root web and copy all of your files into it. Your site will exist under a subdirectory instead of at the top level /public_html where it should be.

My counter, bbs, guestbook, etc isn't working.
These problems are generally due to incorrect permissions on either the directory, file(s) or cgi script(s) that are associated with them. Please don't change the permissions of your files or directories unless you have a specific reason for doing so and you know what effect it will have on your site.

My forms won't work through the Secure Server.
The call to a cgi script using the Secure Server must not be within a webbot. Use a normal cgi call in your html script for Secure Server calls.

My search bot doesn't return any results.
The /public_html directory must be world readable AND you need to re-calculate links BEFORE publishing (or after editing directly on the server). If it still doesn't work: FTP to the server and go to the /public_html/_vti_txt/default.wti directory. Delete any files that begin with "ALL.". Don't delete any other files. Then using Windows Explorer, do the same thing on your PC.- Recalculate links, test locally with your browser and publish.

FP starts the Web Publishing Wizard when I try to publish.
Cancel the operation and email support to have the FP extensions installed/repaired.

Why is my page renamed on the server when I publish?
The "Default Document" of your web is automatically renamed by the server to what is required by the configuration of the server. For example, if you've named the main page "index.html", it may be renamed "default.html". Just check the links to your main page to make sure they refer to it the same way.

[Back to top]

MICROSOFT FRONTPAGE 2000
This tutorial will guide you step-by-step through configuring Microsoft FrontPage to exchange files between your computer and your web site. In order to follow along with us, you'll need to have Microsoft FrontPage installed, and you'll need to be connected to the internet via your Internet Service Provider

Create a Simple Page
Before you can publish an html file to your web site with FrontPage, you must either have a page already created, or create a page. To create a page with FrontPage, follow these simple steps

  1. With FrontPage open, choose File --> New.
  2. Type in "This is a simple test"
  3. From the menu bar, choose File --> Save As.
  4. Name the html file. (If this file is to be your homepage, be sure to name it index.html) Once you have the file saved to your hard drive, you are ready to publish the file.

Publish Your Web Page.

  1. From the menu bar, choose File --> Publish Web .
  2. Click on the Options button (You will see a dialog box.)
  3. In the text box below Specify the location to publish your site to: enter the full URL for your site.
  4. If this is the first time you are publishing your site, select Publish all pages...
  5. Select Include subwebs
  6. Click the Publish button.
  7. Enter your username and password.

If you have entered all the details correctly, FrontPage 2000 will then publish your site. You will see a dialog box with Click here to view your published web site, when it has finished: Then click the Done button.
[Back to top]

 


adey.com

120 Glebe Road, Deanshanger, Milton Keynes, MK19 6LZ, United Kingdom. T: +44 (0)1908 566629 F: +44 (0)870 1675139 Email: info@adey.com