hide random home http://www.demon.co.uk/dil/www/wwwspace.html (The Risc Disc Volume 2, 10/1995)

Using your WWW account

Please report any bugs or inaccuracies to www@demon.net

Demon Internet
Using your WWW account


Introduction

This document explains how you can directly maintain your own web space on Demon's WWW server.

Demon's WWW server is based on a HyperSparc server, running Solaris 2.4 (a version of the UNIX operating system). In order to work on the server, you will need to learn and use some UNIX commands. This document is not a tutorial on UNIX; although some relevant commands are listed, if you need further information you should either read a book about UNIX or consult one of the on-line references mentioned in Commands available.


How it works

When you obtain your web account, you will be given a login name and password on www.demon.co.uk. You can use this name and password to log into your own area on the web server (using a telnet application).

This account is strictly limited in what it can do, although there are enough commands available to allow you to maintain your WWW space.

The login name of your account is the same as the name of your home directory (that is, the directory named in the URL of your site). For example, if the URL of your site is http://www.demon.co.uk/web-site/, your login name is web-site.

Site names can be more than eight characters long. However, the maximum length of a login name is eight characters. Therefore, if your sitename is more than eight characters long your login name will consist of the first eight characters of your sitename.

Before you first log in, we will assign you a password. You should keep this password secret; anyone who knows your password and login name can log into www.demon.co.uk and modify your files. If you cannot log in, or if you password becomes compromised, please contact us directly.

The upload procedure consists of two steps:

Uploading the archive file

Use ftp to upload the file to www.demon.co.uk. Instead of logging in as "anonymous" or "ftp" and giving your email address as the password, you should log in using your assigned login name (that is, the name of your home directory) and your assigned password.

In your home directory, you will find a directory called incoming. You must upload your files into incoming.

Unpacking the archive file

To unpack your archive, telnet to www.demon.co.uk. (To do this you will need a telnet program. If you are using the DOS based Demon dialup system you can issue the telnet command from the net> prompt:

       net> telnet www.demon.co.uk
If you are using a Windows based system then you should get a telnet program such as wtel1b2.zip

If you are using a Macintosh, you can use NCSA Telnet (or another commercial telnet application).


Directory structure

When you are logged on to www.demon.co.uk, type ls to obtain a directory listing. You will see that you have a number of directories. These are:

incoming
directory for upload files (received by ftp)
cgi-bin
directory reserved for cgi-scripts
docs
directory for HTML files (with optional subdirectories)

A diagram of this structure, for the example site web-site, looks like this:


Figure 1:
                      web-site
                          |
             +------------+------------+
             |            |            |
         incoming      cgi-bin       docs
                                       |
                              +--------+---------+
                              |        |         |
                         more-docs  images    sounds

The docs directory is a link to your top level directory in our WWW space. This means that any HTML file placed in docs appears on the web in http://www.demon.co.uk/web-site/.

For example, if you place a file called test.html in /web-site/docs it will have the URL http://www.demon.co.uk/web-site/test.html.

If you move test.html from /web-site/docs into /web-site/docs/more-docs, it will have the URL http://www.demon.co.uk/web-site/more-docs/test.html.

(In effect, the directory name docs is invisibly removed from any URLs pointing to your site.)


Commands available

If you have not used a UNIX system before, it can appear daunting at first. However, a large number of books on using UNIX are available from any good computer bookshop. Here is a summary of the commands available on the Demon WWW server:
gunzip
Uncompress your *.gz, *.tgz or *.Z archive. For more information, see gunzip.
unzip
Extract files from a *.zip archive. For more information, see unzip
tar
Extract files from a *.tar archive. For further information, see tar.
htm2
Recursively convert filenames from *.htm to *.html. (If executed in a given directory, converts filenames for all files ending in .htm in the current directory, and all lower directories.)
mv
Move files and directories. For further information, see mv.
cp
Copy files from one place to another. For further information, see cp.
rm
Delete files. For further information, see rm.

Note: the UNIX system does not permit deleted files to be undeleted! Use rm with caution!

chmod
Change the permissions on files. For further information, see chmod.


Creating your archive

There are a number of ways in which you can archive files to be placed on your WWW site. These include:

Some people choose to send up their complete WWW site each time, while others just upload the modified files.

All of these methods are valid. You have the freedom to choose how you carry out your uploads. However, we would like to make a number of recommendations that will help you to maintain your site with as little trouble as possible.

We recommend that you create your archive from within the top level directory. The following example illustrates this.


Figure 2:
                      web-site
                          |
                 +--------+---------+
                 |        |         |
               docs    images    sounds

As you are now the maintainer of your own WWW site you can upload an archive, or indeed individual files, in any file format you require - as long as you are able to extract that archive on our server.

If your software does not allow you to create an archive from within a sub-directory then please let us know.

Creating archives under UNIX

To create a tar archive containing the files and directories making up this site on a UNIX system, use the following commands:
        cd docs
        tar cvf /tmp/web-site.tar .
The archive named web-site.tar is created in /tmp. It contains all the files and directories in the current directory.

To create a compressed archive (which may upload faster) you can gzip or compress the file. Using GNU tar and gzip on a UNIX system:

        tar zcvf /tmp/web-site.tar.gz . 
or
        tar zcvf /tmp/web-site.tgz .

If you are using a more traditional tar product then you should pipe the output into the compression program as follows:

        tar cvf - . | gzip -c /tmp/web-site.tar.gz
        tar cvf - . | compress -c /tmp/web-site.tar.gz

To create an archive of files that you have changed since a certain date:

        cd web-site
        tar cvf /tmp/web-site.tar `find . -mtime +X -print`
(X is a number: any file modified less than X days ago will be selected.)

Creating archives under DOS/Windows

On a PC running DOS/Windows, use the following commands:

        cd web-site
        pkzip -rp \tmp\web-site *.*
(You can obtain a copy of pkzip here.)

To create an archive of files that you have changed since a certain date, use the following commands:

        cd web-site
        pkzip -rpt[date] \tmp\web-site *.*

Creating archives on a Macintosh

On a Macintosh, you should create a tar archive using suntar. To create an archive:

You can compress the tar archive (before uploading it) using MacGzip. MacGzip. --> (Note that a tar archive does not require a resource fork; it is a data-fork only archive format.)

You would then upload this file to your incoming directory on www.demon.co.uk. If using Fetch, send the file as "Raw Data".


Extracting the archive

Once the archive has been produced and ftp'd to www.demon.co.uk (in binary mode), you have to extract it. How you do this depends on the process used to create it.

tar archives

The first stage is to uncompress your tar archive (if you compressed it before uploading it).

You can uncompress a file compressed with gzip or compress using the gunzip command. For example:

        gunzip incoming/web-site.tar.gz

To extract the archive, change directory to your docs directory and untar the file. For example:

        cd docs
        tar xvf ../incoming/web-site.tar

Your site has now been updated.

Zip archives

To extract the archive, change directory to your docs directory and unzip the file. This will extract all the files into your current directory. If you created this archive on a DOS/Windows platform then you will have to convert the file names from htm to html. This is done using the

htm2
command.

For example:

        cd docs
        unzip -d ../incoming/web-site.zip
        htm2
Your site has now been updated.


Changing permissions on your files

If for some reason you need to change the access permissions on one of your files, use the chmod. Your files must be world-readable, otherwise the WWW server will be unable to service requests for them. Your directories containing files must be readable and world-executable otherwise the WWW server will be unable to see files inside them. For a discussion of UNIX file access permissions, see Controlling access to your files and directories.

If you want to restrict access to a file (called file_name), issue the following command:

        chmod 0 file_name

(That is a zero, not a capital 0). This command ensures that nobody, including yourself, can access this file via the Web.

To allow anyone in the world to read the file, use the following command:

        chmod a+r filename

If you use CGI scripts then they must be executable. To do this issue the following command:

	chmod a+rx script_name

If the script updates a file, then you have to set write permission on the file. Use the following command:

	chmod a+w file_name


Removing files

TO remove files use the rm command. No "undelete" command is available; be careful!

For example:

	rm file_name

To remove a directory, and all the files and directories in it, use the following variation:

	rm -r directory_name
Note that the -r option recursively deletes directories stored below directory_name. So if you issue it in your home area, it will destroy all your files.


Checking available space

To find out how much Web space you are using you would use the following command.

	du -sk docs

This will give you the number of 1Kb blocks that your pages occupy. Please try to keep this within your payment limits. If you exceed your payment range (for example, by using more than 5000 blocks on a £25-per-month account) you will be billed for the extra space used.


Back to the Demon Web Main Page
or
back to the Demon Internet Main Index.

These pages are maintained by Foresight Interactive Services. If you have any queries or comments about the Demon World Wide Web pages, please feel free to email webdemon@foresight.co.uk.