Jump to main contentmickwood.com - Website Hosting & Design for Christian Organisations
Support

"If we don't know it's broken we can't fix it!"

Support FAQ Homepage

Can't find the answer?

CGI & Server Side Includes

1. Where is my CGI-BIN?
2. Can I execute custom CGI scripts on my web site?
3. How do I use Server Side Includes?
4. How should I set file permissions in a Perl script?
5. How do I set up crontabs?
6. What is the location of sendmail?
7. How do I chmod my scripts?
8. What is the path to my site?
9. What is the path to the date program?
10. What is the location of the Perl 5 libraries?
11. How do I install a perl module that mickwood.com does not have installed?
12. Where is the best place to download CGI scripts?


1. Where is my CGI-BIN?

You can execute CGI & Perl scripts from any location inside of your web space. Many people create a directory called 'cgi-bin' and store all of their cgi scripts inside it to keep track of them.

Back to top


2. Can I execute custom CGI scripts on my web site?

Yes, you can install almost any CGI script you can get hold of. We provide access to the standard Perl 5 libraries and modules.

Back to top


3. How do I use Server Side Includes?

Use the #include directive to include files into your current html document. The "file=" or "virtual=" elements can both be used. You should choose Virtual as we use an Apache web server. (This is the default choice in Dreamweaver.) In Apache, Virtual works in all cases, while File works only in some cases.

For example, let's say you were trying to include extra.html into news.html. Both documents exist in a directory called "docdir" in your main htdocs area.

< !--#include file="extra.html" -->
< !--#include virtual="/docdir/extra.html" -->

Give the file a filename that ends in ".shtml" to tell the server to interpret your SSI.

Back to top


4. How should I set file permissions in a Perl script?

Very often permissions are set very leniently in order to avoid any permissions problem. This is not a good idea. Your Perl scripts should have the appropriate permissions depending on the function of that particular script.

First, all scripts should be set to the owner (you) having read, write and execute privilege (rwx) regardless of the function of the Perl script.

Next, you should ask yourself if you want people (visitors) to your website to be able to execute the Perl script. This is most likely the case. Under these conditions, your script would be set to world readable and executable (r-x). Do NOT give the world write permission on the Perl script. It is not necessary and may lead to problems.

If your script is not going to be executed through the web and only you will be executing the script through Telnet (there are various reasons for having a script operate under these conditions), then you set the script to no world permissions (---).

The group permissions should be set to read and executable (r-x) if the script is to be executable via the web. Otherwise, set your group permissions to nothing (---).

With this information, you have the following permissions breakdown:

Executed via the web by anyone: chmod 755
Executed by only yourself thought the command line: 700

Often times, a Perl script will open a file for writing. This is the case in guestbooks and bulletin boards, where the information is received from the form and written to a certain file. The permissions of this particular file are very important.

Finally, never set your file permissions to rwxrwxrwx, or chmod 777. This is not necessary and may cause a security problem on your website.

Back to top


5. How do I set up crontabs?

Just send an email to enquiries@mickwood.com with the following information:

1 - The full path to the script(s) you need executed.
2 - The time(s) you need it (them) executed.

Back to top


6. What is the location of sendmail?

The location of sendmail is /usr/sbin/sendmail

Back to top


7. How do I chmod my scripts?

1 - Use your filemanager at www.yourdomain.com/fileman/fileman.cgi

2 - In Dreamweaver (my preference)

You need to downlaod and install the 'set permissions' extension from the Macromedia Exchange. Once installed you simply right-click on the file in the remote directory, select 'Set Permissions', and either tick the relevant boxes or type directly into the permissions field.

3 - In CuteFTP

When connected to your site right click on the file you want to chmod, click 'CHMOD' from the popup menu, set the permissions and then click OK.

4 - In WSFTP

Highlight the file, right click the file and select CHMOD from the pop-up menu, select any of the options and click the OK button.

Back to top


8. What is the path to my site?

/home/username/public_html

Your username is generally (but not always) the first 8 letters of your domain name. Check your welcome letter for your actual username.

Back to top


9. What is the path to the date program?

/bin/date

Back to top


10. What is the location of the Perl 5 libraries?

When using Perl/GGI scripts make sure that the first line of your Perl/CGI script has the following:

#!/usr/bin/perl

Occasionally you may need to put the following (depending on the script):

#!/usr/bin/perl --

Back to top


11. How do I install a perl module that mickwood.com does not have installed?

Since you do not have admin access to install perl modules, just send an email to enquiries@mickwood.com with the name of module that you need installed. One of our support staff will install the perl module for you.

Back to top


12. Where is the best place to download CGI scripts?

Three excellent places to download CGI scripts are:-

http://www.cgi-resources.com

http://www.hotscripts.com

http://nms-cgi.sourceforge.net

Back to top


welcome | name | hosting | design | content | promote | update | showcase
about us | general | articles | accessibility | sitemap | enquiries | feedback | training | consultancy

Showcase Update Promote Content design Hosting Name Welcome