In netbeans I can right click on project name, select properties > run > and change the context path, how can I change the context path of the tomcat on my server which is
Add root.xml file in $CATALINA_BASE/conf/[enginename]/[hostname]/ and add this as :
$CATALINA_BASE/conf/[enginename]/[hostname]/
<Context docBase="/opt/mywebapps/<yourApp>" path="" reloadable="true" />
For more detail you can use the Apache context configuration link : http://tomcat.apache.org/tomcat-7.0-doc/config/context.html