Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Quick touchup for tomcat deployment docs #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions configure/tomcat.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Finally save the `server.xml` file and restart tomcat8.

#### Context path

By default, Tomcat will deploy any ``.war`` file in ``webapps` directory
with the context name matching the filename. For example, ``airsonic.war``
will be deployed to the ``/airsonic`` context.

If you don't want this to happen, you need to locate your ``airsonic.war``
file somewhere other than the tomcat ``webapps`` directory and apply some
configuration.

Locate `server.xml` which by default should be in the ``${TOMCAT_HOME}/conf/`` folder (e.g. for Debian it will be `/var/lib/tomcat8/conf/server.xml`).

You will need to add the following right above the `</Host>` tag:
Expand All @@ -82,4 +90,28 @@ You will need to add the following right above the `</Host>` tag:
</Context>
```

To clarify, if you want to serve airsonic from the ``/air`` context and you have the
airsonic.war file located in ``/opt/airsonic/airsonic.war``, make sure the
configuration looks something like this:

```xml
<Context path="/air" docBase="/opt/airsonic/airsonic.war" debug="0" reloadable="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
```

Finally save the `server.xml` file and restart tomcat8.

#### hostname configuration

If you find your reverse proxy isn't working properly and is returning 404 results
you don't expect, you might need to set the hostname configuration in the Tomcat
``server.xml`` configuration file.

For example, if your instance is running on a host named ``mymusic.example.com``,
the config line should look like:

```
<Host name="mymusic.example.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
```