What is a web server?

What is a receptionist?

A web server is a program running on a computer and waiting for requests on a port. 

In your case you will install Apache Tomcat on silo.cs.indiana.edu on a specific port. 

The list of assigned ports for this exercise is listed at:

http://www.cs.indiana.edu/classes/c212-dgerman/sum2013/labThirteen.html

I will work as Pascal so my information in that document says:

pdeboeck (Pascal             Deboeck) 14246 14282

Once you have settled on silo we need to follow these steps: 

1. Download the software

http://tomcat.apache.org/

You can get it from us: 

  cp /l/www/classes/a348/spr2013/software/apache-tomcat-7.0.35.tar.gz ~

2. Uncompress and unarchive: 

  gunzip apache-tomcat-7.0.35.tar.gz

  tar xvf apache-tomcat-7.0.35.tar

A folder will be created, move into it. 

  cd apache-tomcat-7.0.35

3. Move into the conf folder of your server: 

  cd conf

4. Modify your server.xml as follows: 

   mv server.xml server.xml-backup

   pico -w server.xml

This is the contents for server.xml: 

<Server port="18631" shutdown="SHUTDOWN">

  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="17631" />

    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />
      <Host name="localhost" appBase="webapps" />
    </Engine>

  </Service>
</Server>

Replace 17631 and 18631 with your assigned ports (for me: 14246 and 14282). 

5. I have to define three environment variables:

  export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun.x86_64

  export CATALINA_HOME=/u/pdeboeck/apache-tomcat-7.0.35

  export CLASSPATH=.:$CATALINA_HOME/lib/servlet-api.jar

6. Start your server:

  $CATALINA_HOME/bin/startup.sh

Check it online: 

  http://silo.cs.indiana.edu:14246/

(Please be sure to put your port number there). 

Also check that it's running from the command line: 

  ps -ef | grep pdeboe

When you're convinced your server is running move to the next step. 

7. Stop your server: 

  $CATALINA_HOME/bin/shutdown.sh

Verify that the server is no longer running. 

That's all for today. 

--