Before you can start dotCMS for the first time, you have to tell dotCMS where to find your database, and which IP address or addresses to use:
- Set the server IP address. This is step is optional, the dotCMS will automatically run on localhost. If you need the dotCMS to run on a particular IP address, you can specify it in the ./tomcat/conf/server.xml file. Edit the ./tomcat/conf/server.xml file and search for the connector and server tags and add the address property on both. For example:
<Server address="208.250.1.102" port="8005" shutdown="SHUTDOWN" debug="0">
<Connector address="208.250.1.102" port="80"
URIEncoding="UTF-8"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />If you need dotCMS to run on more than one IP address you can add as many Connector elements as necessary. For more information you can refer to the Tomcat documentation.
- Set the database connection info in the ./tomcat/conf/Catalina/localhost/ROOT.xml file.
Uncomment the section corresponding to the database you are using in the configuration file. All other sections must be in comments.
You will need to update the last part of the URL to your database name along with username:password.
The following is an example of a PostgreSQL configuration pointing to a database named dotcms<!-- POSTGRESQL -->
<Resource name="jdbc/dotCMSPool" auth="Container"
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1/dotcms"
username="postgres" password="xxxxx" maxActive="50" maxIdle="10" maxWait="-1"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/>
2