Second Summer 2009


Installation of Apache. Unix. HTML
Today we will make sure that we all have Apache installed.

The steps are listed below.

  1. Log into silo.

  2. This next step is optional.

    If you have already installed Apache:

    Stop it:
    ~/apache/bin/apachectl stop

    Wipe out the installation folder:
    yes | rm -ir ~/apache/

    Clean up the nobackup folder of previous installation files:
    yes | rm -ir /nobackup/username/httpd*

    (Note: username denotes, as always, denotes your actual username).

    Now you can start the installation process.

  3. Create your nobackup folder:
    makenobackup
  4. Move there:
    cd /nobackup/username
    Please replace username with your actual username.
  5. Optional: Type pwd to make sure you're indeed in that folder.

  6. Copy the compressed archive from the class repository into your nobackup folder:
    cp /l/www/classes/a348/sum2006/software/httpd-2.2.2.tar.gz .
    Don't forget the period at the end of the command (it's indicating the current folder).

  7. Uncompress the compressed archive:
    gunzip httpd-2.2.2.tar.gz
  8. Unarchive the uncompressed archive:
    tar xvf httpd-2.2.2.tar
    This results in a new folder being created, with lots of files being placed in it.

    The new folder's absolute path is: /nobackup/username/httpd-2.2.2

    (Note: as always username denotes your actual username.)

  9. Move into this new folder:
    cd /nobackup/username/httpd-2.2.2

    (Note: username denotes, as always, your actual username.)

  10. Type the following command and wait until it's done:
    ./configure --prefix=/u/username/apache --enable-so

    (Note: username denotes, as always, your actual username.)

    This configures your installation.

  11. Now type the following command and wait until it's done:
    make
    This actually compiles the source files as configured.

  12. Finally type the following command and wait until it's done:
    make install
    (Note: if you need to redo these steps: 10, 11, 12, you need to start with make clean).

  13. Move to the ~/apache folder that has your Apache installation:
    cd ~/apache
  14. Move into the conf folder and open httpd.conf for editing:

    cd conf
    pico httpd.conf
  15. Go to line 40 and replace: Listen 80 with Listen 44xxx

    (Note: 44xxx denotes your port number, see below. For example, mine is 44063).

  16. Go to line 64 and replace the line User nobody with User username.

    (Note: username denotes your actual username, and daemon could be there instead of nobody).

  17. Exit httpd.conf and start your server:

    ~/apache/bin/apachectl restart
    Now your server should be running and accessible from one of the links below:

    44039 44065 Brumbaugh, Margaret Susan
    44040 44066 Sorosky, Nicholas Tyler
    44041 44067 Turner, Sarah Megan
    44042 44068 Amanbayev, Talgat
    44043 44069 Baker, Jordan Keith
    44044 44070 Castner, Dean A
    44045 44071 Fernandez, Francis Paul
    44046 44072 Jefford, Logan Nance
    44047 44073 Kang, Yoon Mo
    44048 44074 Skaggs, Timothy Lee
    44049 44075 Al-Azdee, Mohammed
    44050 44076 Liu, Hongliu
    44051 44077 Nehrt, Nathan
    44052 44078 Pejaver, Vikas
    44053 44079 Rectanus, Lauren Caitlin
    44054 44080 Wright, Scott N
    44055 44081 Huang, Gang
    44056 44082 Keif, Echo Marie
    44057 44083 Paulraj, Sushmitha
    44058 44084 Sabetti, Leonard
    44059 44085 Sankaranarayanan, Madhuvanthi
    44060 44086 Shah, Neethu
    44061 44087 Sobieralski, Joseph Bernard
    44062 44088 Swaminathan, Rajeswari
    44063 44089 German, Dan-Adrian
    44064 44090 Dan Wick 

  18. Go into ~/apache/htdocs and edit your index.html file:

    pico ~/apache/htdocs/index.html
  19. Go into ~/apache/cgi-bin/ and create this program:

    #!/usr/bin/perl
    
    print "Content=type: text/html\n\n";
    
    $a = localtime;
    
    print $a;
    Call it one. Before you run it make it executable: chmod 700 ~/apache/cgi-bin/one

    Access it from the web at http://silo.cs.indiana.edu:44xxx/cgi-bin/one

    Note: 44xxx denotes your port, as listed above.


Updated by Adrian German for A202/A598