Database Reference
In-Depth Information
Hosts File
To keep each chapter separated in terms of the webserver and container configuration, I recommend that you add
a host name to your local hosts file. The process for modifying the hosts file depends on your preferred operating
system. For this chapter, add an entry that points 127.0.0.1 to practicalneo4j-java.
Local Apache Tomcat Configuration
To follow the sample application found later in this chapter, you will need to configure your local Apache Tomcat
to use the workspace project in Eclipse as the document root. To do this, you will need to modify the server.xml file,
which can be found at /TOMCAT-INSTALLATION/conf/server.xml, as shown in Listing 12-3. The most important
changes are adding a HOST and CONTEXT as shown in the listing.
Listing 12-3. Example of Tomcat Configuration
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<!--
Listener and GlobalNamingResources excluded for brevity
-->
<Service name="Catalina">
<Connector port="8090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"
URIEncoding="UTF-8" useBodyEncodingForURI="true" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"
useBodyEncodingForURI="true"/>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
< Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="practicalneo4j-java"
appBase="/path-to-workspace/practicalneo4j-java/WebContent"
unpackWARs="true" autoDeploy="true" >
<Context path="" docBase=""
aliases="/resources=/path-to-workspace/practicalneo4j-java/WebContent/resources"
reloadable="true" swallowOutput="true" />
</Host>
</Engine>
</Service>
</Server>
Note Using the method of pointing your hoST's appbase to your project within the workspace is one way to “hot
reload” code changes. This method is very helpful for most developers because server startup and restart times can be a
significant drain on productivity. The process of “deploy and run” has its positive aspects, but the minutes add up quickly.
 
 
Search WWH ::




Custom Search