Advanced
Features
Setting
up Your Own "404:File Not Found" Error Page
A file already
exists in the www directory of your server. It's called missing.html.
You can edit it to your liking, or create your own. As long as it's called
missing.html and it's in your root www directory, the server will display
it whenever someone tries to access a page on your domain that does not
exist.
Password
Protected Web Directory
Use monstercontrols
to password protect directories.
Simply go to http://youractualdomain.com/cgi-bin/monstercontrols to add
usernames and passwords to ANY directory you want. That user and all users
you've added will be defined in a .htpasswd file in your secure directory
by default, and will have access to that directory of your site, which
is accessible from a web browser by typing the URL as: http://www.yourdomain.com/directoryname/
To remove a user from your password file (i.e., to remove the access of
that person to your protected directories), use monstercontrols, or simply
edit the .htpasswd file located in the secure directory. In this file,
you'll see usernames followed by a colon (:) and a password string. The
string is the password you entered in your control panel encoded in a
way to protect the access rights. To remove the privileges of a user,
erase the line containing his/her username. Be sure to keep the file in
plain ASCII, and not to change ANYTHING else.
Crontab
What is Crontab?
Crontab is a program that allows users to execute a script or task at
a given time.
There are 3 ways to create a crontab for a User on your domain: Monstercontrols,
crontab from the command line and crontab from a file.
1) Use Monstercontrols, Webmaster Tools, add/edit cron jobs to create
a crontab: http://www.yourdomain.com/cgi-bin/monstercontrols
(replace "yourdomain.com" with your real domain name).
Note: You will need to use Monstercontrols to create a cron before being
able to run crontab from the command line as described below or contact
Support to be added to the cron.allow file.
2) SSH to your domain and use the command: crontab -e
Options for crontab from the command line are:
Edit the current crontab or create a new one: crontab -e
List the contents of the crontab file: crontab -l
Remove the crontab file: crontab -r
If you're not familiar with the "vi" text editor which is used by crontab
you can change your editor to "pico" or "joe" by using the commands below.
Change editor from vi to joe:
EDITOR=joe
export EDITOR
3) Or if you're not comfortable using a text editor on the server, create
the crontab using Notepad on your PC (Simpletext for Macintosh users)
and upload the file to your /home directory in ASCII format. (Note: do
not use a Word Processing application such as MS Word as that may add
unwanted formatting characters to the file.)
It does not matter what you call your crontab file. You should name it
something that will identify it (eg: mycron or croncgi) and upload it
in your /home directory on the server. /home/username is where you are
when you first FTP to your domain.
Upload the file in ASCII format (crontabs are text files and must be uploaded
in ASCII).
After uploading the text file, SSH to your domain and execute the crontab
file by typing the command below (replacing "nameofcrontabfile" with your
file name).
crontab nameofcrontabfile
- Additional info and examples.
The syntax of the crontab is very rigid. Each entry in a crontab consists
of six fields, with each field separated by a space. More than one crontab
can be added to the file with each crontab on a separate line (see example
below).
0 13 1,15 * * /home/username/www/update-calendar.php
30 9 * * * /home/username/www/delete-logs.cgi
The first five fields specify exactly when the command is to be run; the
sixth field is the command itself.
minute hour day month weekday command
The first five fields are:
Minute - Minutes after the hour (0-59).
Hour - 24-hour format (0-23). (based on a 24-hour clock, ranging from
0, for midnight, to 23, for 11 p.m)
Day - Day of the month (1-31)
Month - Month of the year (1-12)
Weekday - Day of the week. (0-6; the 0 refers to Sunday, 1 refers to Monday,
etc.)
- Asterisks (*) specify when commands are to be run in every instance
of the value of the field. For instance, an asterisk in the Month field
would mean that the command should be run every month. In addition, multiple
events can be scheduled within a field by separating all instances with
commas - with no space between.
- Note that the day can be specified by two of the fields (day_of_the_month
and day_of_the_week). If both are specified, both will be used. If one
of the two fields is an asterisk, only the other is used.
- If the first five fields of a crontab line were: 0 0 15,30 * 1
...the command would be run at midnight on the fifteenth and thirtieth
of each month and on every Monday.
- To specify only specific days of the week to run a command, put an asterisk
(*) in the day_of_the_month field. To specify only days of the month,
put an asterisk (*) in the day_of_the_week field.
- If you do not direct the standard output and standard error for the
command, any output for standard output or standard error is emailed to
your default email address.
- Any line in a crontab file that begins with a number sign (#) is a comment
and is ignored.
Examples:
To execute the script delete-logs.cgi every morning at 9:30 AM the line
in the crontab file would look like this:
30 9 * * * /home/username/www/delete-logs.cgi
To execute update-calendar.php at 1 PM on the 1st and 15th of the month,
the line in the crontab file would look like this:
0 13 1,15 * * /home/username/www/update-calendar.php
To execute update-calendat.php at 6 PM (hour 18) on the 10th day of June
(month 6) and December (month 12) the crontab would look like this:
0 18 10 6,12 * /home/username/www/update-calendar.php
Another example... let's setup a crontab to make a backup of script.cgi
on Tuesday at 2:25 PM.
MIN = 25
HOUR = 14 (note that military time is used)
DAYOFMONTH = * (doesn't apply)
MONTHOFYEAR = * (again we don't care)
DAYOFWEEK = 2 (Sun=0, Mon=1, Tue=2)
So our crontab entry would be...
25 14 * * 2 /bin/cp /home/username/www/script.cgi /home/username/www/backup-script.cgi
For more information about crontab type: man crontab
|