You are not logged in.

#1 2013-11-28 12:03:44

sonay
Member
Registered: 2010-03-09
Posts: 75

[Newbie Question] Tomcat Context Path and Permissions

How do I set my context path to a directory in my home folder with the permissions allowed to modify the files by a regular user?

What I am trying to achieve here is that I set up a development environment which I am free to do anything by programming jsps and tinkering configuration files such as web.xml, server.xml. I will be testing on port 8080 or something above 1024 so I am guessing it won't require root priviliges.

Long story short, what is the best practice to follow for a learning experience with some ease. It will be great after the relevant changes I can deploy and run through the tomcat web interface. 

ps: I don't know much about Tomcat, the goal is to learn it. I have been trying to follow some books and tutorials however many of them are targetted at Windows environments or assumes you have configured it in a way that allows the examples to be executed, suggestions are welcome.

Offline

#2 2013-11-28 12:49:01

sonay
Member
Registered: 2010-03-09
Posts: 75

Re: [Newbie Question] Tomcat Context Path and Permissions

So I have searched tomcat directories in my hard disk, this is what I found out up until now:

Tomcat Directories And Files:

/usr/share/tomcat7
    /bin
        bootstrap.jar
        catalina.sh
        catalina-tasks.xml
        configtest.sh
        daemon.sh 
        digest.sh 
        setclasspath.sh 
        shutdown.sh
        startup.sh   
        tomcat-juli.jar   
        tool-wrapper.sh
        version.sh
       
        /conf        -> /etc/tomcat7
        /lib                -> /usr/share/java/tomcat7
        /logs        -> /var/log/tomcat7
        /temp        -> /var/tmp/tomcat7/temp
        /webapps     -> /var/lib/webapps
        /work         -> /var/tmp/tomcat7/work

/etc/tomcat7
    catalina.properties 
    context.xml
    logging.properties 
    catalina.policy   
    tomcat-users.xml
    server.xml
    web.xml

/var/log/tomcat7/
    catalina.out
    catalina.err                
    localhost_access_log.2013-04-16.txt 
    localhost_access_log.2013-11-28.txt
    localhost_access_log.2013-04-17.txt
    localhost_access_log.2013-03-24.txt
    localhost_access_log.2013-04-18.txt
   
/var/lib/webapps/ : webapps goes here

/usr/share/java/tomcat7/
    catalina-ant.jar                 
    catalina-ha.jar              
    catalina-tribes.jar          
    catalina.jar                 
    eclipse-ecj.jar
    jasper.jar
    jsp-api.jar             
    el-api.jar   
    servlet-api.jar     
    tomcat-api.jar
    tomcat-coyote.jar
    tomcat-dbcp-7.0.47.jar   
    tomcat-i18n-es.jar
    tomcat-i18n-fr.jar
    tomcat-i18n-ja.jar
    tomcat-jdbc.jar
    tomcat-util.jar

It looks like catalina.sh is responsible.

# -----------------------------------------------------------------------------
# Control Script for the CATALINA Server
#
# Environment Variable Prerequisites
#
#   Do not set the variables in this script. Instead put them into a script
#   setenv.sh in CATALINA_BASE/bin to keep your customizations separate.
#
#   CATALINA_HOME   May point at your Catalina "build" directory.
#
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.
#
#...
# -----------------------------------------------------------------------------

so how do I write a setenv.sh to assign the variables? I don't know any shell programming. 

At this moment I guess I can make tomcat/webapps to point to a directory like /home/sonay/webapps and get over with it? But is this a good idea at all?

Offline

Board footer

Powered by FluxBB