Plusnet
Sunday 8th November 2009Login | Register | Help
Pages: [1]

Servers: CGI/Shell Server Basics

  • task
  • Guest
« on 09/12/2003, 23:59 »
Tutorials and FAQS: Servers: CGI/Shell Server Basics

Please Note: This tutorial relates to the new CGI Platorm which went live at the end of June 2005

Note: Throughout this tutorial, green is used to indicate the server respones and blue is used to indicate the users typing.

This tutorial describes activating the CGI/Shell Service part of certain VISP full name accounts and basic commands for using the CGI/Shell Server. The tutorial contains information on the following:
  • Activating the CGI/Shell Server
  • Connecting to the CGI/Shell Server
    • Using Telnet
    • Using SSH
  • Basic CGI/Shell Server Commands
  • More Information on the Server
Activating the CGI/Shell Server

If your PlusNet account type allows you access to the CGI server, you should see the following link appearing on your Website Settings page.
    [/list]Once you click the link, you will be taken to the CGI server setup page where you will see a table which is headed "Control your CGI webspace" with the left hand column telling you whether your CGI webspace is active or not and a button to activate/deactivate it.

    If it is deactivated, you should click the button and wait for up to 4 days for the details to be emailed to you on postmaster@username.force9.co.uk - although it will tend to be quicker than this.


    Understanding your CGI Account's Password

    On activating your CGI usage, your CGI password is set to the same value as your normal PlusNet account password, but the CGI password is independent of your normal account password -- changing one does not affect the other.

      Changing your CGI password does not change your normal account password.[/list]

      Connecting to the CGI Server

      Web: When connecting to the CGI server through a web browser, you will be able to use http://ccgi.username.plus.com or if you host a domain, you are able to setup Domain records which enable URIs of the form http://cgi.domain.co.uk to work as well. For more information on this please see the domain records tutorial.

      FTP: To connect to the CGI server through an FTP client, you should use ccgi.force9.net as the server to connect to and use the username and password detailed in the email. Initially this is the same as your VISP full name account username and password, but you are able to change this at the command line.

      To access the shell server through a command line you need either a telnet client or an SSH client. Telnet is an unencrypted protocol, whereas SSH is encrypted. For convenience telnet is more appropriate.

      For Windows, most computers come supplied with a telnet client called "telnet" but do not come with an SSH client, so telnet is often more convenient. The "core commands" given for using the shell server will apply to both connection methods, but the connection details are different.
        An attempt to log on to any VISP full name server will succeed only if your Internet connection has been established through VISP full name or one of the other VISP full name ISPs.[/list]
        Connecting through telnet

        To connect using telnet you need to bring up a command prompt window. This can usually be achieved by calling

        Start Menu -> Programs -> Accessories -> Command Prompt

        When the command prompt window appears, a black window with a prompt such as:

        Code:
        C:\>


        You can connect to the CGI server by typing in the command

        Code:
        telnet cshell.force9.net


        The window will change and display the following text:

        Code:
        [Connecting]
        Linux 2.6.11-plusnet-cgi (<timestamp>)

        login:


        At the login: prompt type in your username and at password: type in your password. Note, for security reasons nothing is displayed on screen, not even * when you are typing your password.

        If you connected through telnet, you may skip the next section.


        Connection through SSH

        To connect to the CGI/shell server, you need an SSH client. The most common client for Windows is PuTTY, which can be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/

        You need to download putty.exe to a directory on your computer. For convenience, make a shortcut to this file on your desktop, or in your start menu.

        When you click on the PuTTY shortcut, a window will appear which looks like the following:



        For connecting to the CGI server, you should put username@ccgi.force9.net (replacing username with your username) in the Host Name box and choose the SSH radio button. This will automatically change the port to 22.

        A black window with:
        Code:

        Sent username "username"
        username@cgi.force9.net's password:


        appears, and you should type in your password and again press Enter.


        After Connection

        After connecting to the CGI/Shell Server you should see the following:
        Quote
        Last login: <date> from username.force9.co.uk

        and then some information about the platform.

        You will then be shown a prompt of the form

        Quote
        username@shell1 username $


        The prompt is the bit after the $ where commands you type appear.


        Core Commands

        Identifying your "home" directory

        When you log on, you start off in your "home" directory. After having done some work, you may have moved away from your home directory, but you can rely on the fact that the "cd" command, entered with nothing else, will always take you back to your "home" directory. "pwd" can then be used to display the full path name of that directory.  (The "cd" and "pwd" commands are explained in more detail later.) So, to find out the name of your home directory, you can enter the two commands (by separating them with a semi-colon, they may be entered on a single line):

        Quote
        username@shellx anyfolder $ cd;pwd
        /files/homex/username
        username@shellx username $


        Many applications you might install require you to enter the full directory path of a particular file or directory. You can discover this by using a combination of the cd and pwd commands: use the cd command to move to the required directory (or to the directory containing the file you're interested in) and then use the pwd command to print the full path name of that directory.

        Finding Where you Are

        To find out the full path to your files on the CGI server, you can issue the command: pwd at the command prompt.

        This will result in:

        Quote
        username@shellx username $ pwd
        /files/homex/usernamep
        username@shellx username $


        where homex is one of home1, home2 or home3.


        Changing your password

        If you are asked to change your password, or you decide you wish to use a different password for accessing the Shell Server, you can.

        Quote
        username@shellx username $ passwd
        Changing password for username
        (current) UNIX password:

        At this point, you should type your current password
        Quote
        Enter new UNIX password:
        Retype new UNIX password:

        At these prompts you should enter your new password.
        If all is successful, you should see
        Quote
        passwd: all authentication tokens updated successfully


        Exiting

        When you are finished on the shell server, you can exit it by using the exit command.

        Quote
        username@shellx username $ exit


        "logout" will briefly appear on the screen and the window should close.


        Finding What Files are in the Current Directory

        To find out what files are stored in the current directory you can issue the ls command:

        Quote
        username@shellx username $ ls
        cgi-bin


        By default, the only entry listed is the cgi-bin directory.


        Creating Folders

        To create new folders on the CGI server you use the mkdir command:

        Quote
        username@shellx username $ mkdir test



        Changing Directories

        To change into the new folder you have created, you use the cd command

        Quote
        username@shellx username $ cd test
        username@shellx test $


        If you wish to move back up to the previous folder you use .. as the directory to move into.

        Quote
        username@shellx test $ cd ..
        username@shellx username $



        Removing Files/Folders

        To remove a file from the server, you use the rm command:

        Quote
        username@shellx username $ rm test.txt
        username@shellx username $


        To remove a folder from the server, you need to replace rm with rmdir.


        More Information on the Server

        If you wish more information on the configuration of PHP and Perl on the CGI server, you can find more information at the following links.

        PHP Information: http://ccgi.force9.net/phpinfo.php
        Perl Information: http://ccgi.force9.net/cgi-bin/perlinfo.cgi
        Logged
        Pages: [1]
        Jump to:  

        Related Sites

        Community Apps

        Here at Plusnet we're always trying to use clever open source things to make our lives easier. Sometimes we write our own and make other people's lives easier too!

        View the Plusnet Open Source applications page

        About Plusnet

        We sell broadband, phone, VoIP and more to homes and businesses in the UK. Winner of 9 out of 11 Categories in the 2008 USwitch survey. Winner of "Best Consumer ISP" at 2008 ISPA awards. Voted number 1 in the Broadband Choices 2008 survey.

        © Plusnet plc All Rights Reserved. E&OE

        Powered by SMF | SMF © 2006-2008, Simple Machines LLC

        Add to Technorati Favourites