This gets round the fact that the links in VfB are all root, so when running it on localhost the folder is under localhost:8080/vfb/.... so links all miss out the /vfb/ bit. This will change the running location to hachi.ko:8080/ to avoid this problem.
Add a name pointing back to the localhost in the computer's host file /etc/hosts (my computer is called hachiko, hence the "domain" name hachi.ko:
127.0.0.1 hachi.ko
Add to the server.xml file in tomcat's conf directory (/var/lib/tomcat7/conf) in the <service> tag:
<Host name="hachi.ko" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/home/s1144899/vfb/VFB" debug="0" privileged="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="hachi_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
Note how the docBase is the path to the actual folder for the webapp.
There is a folder in the /var/lib/tomcat7/conf/Catalina/hachi.ko directory created called hachi.ko, but we don't need a webapp link script as the path is specified above.
The script we used for that before was called vfb.xml and stored in the localhost folder in /var/lib/tomcat7/conf/Catalina/:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/vfb"
docBase="/home/s1144899/vfb/VFB"
antiResourceLocking="false" privileged="true" />
This allowed us to link to a folder as opposed to keeping our webapp in the webapp directory specified by tomcat.
Add a name pointing back to the localhost in the computer's host file /etc/hosts (my computer is called hachiko, hence the "domain" name hachi.ko:
127.0.0.1 hachi.ko
Add to the server.xml file in tomcat's conf directory (/var/lib/tomcat7/conf) in the <service> tag:
<Host name="hachi.ko" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/home/s1144899/vfb/VFB" debug="0" privileged="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="hachi_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
Note how the docBase is the path to the actual folder for the webapp.
There is a folder in the /var/lib/tomcat7/conf/Catalina/hachi.ko directory created called hachi.ko, but we don't need a webapp link script as the path is specified above.
The script we used for that before was called vfb.xml and stored in the localhost folder in /var/lib/tomcat7/conf/Catalina/:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/vfb"
docBase="/home/s1144899/vfb/VFB"
antiResourceLocking="false" privileged="true" />
This allowed us to link to a folder as opposed to keeping our webapp in the webapp directory specified by tomcat.