Daniel Pelegrini
Daniel Pelegrini

Reputation: 33

Run different web apps as different users in Tomcat

Is it possible to run each webapp in Tomcat as a specific user? My goal is to authenticate each app as a domain user against SQL Server using integrated security.

Upvotes: 1

Views: 565

Answers (2)

Fredy Fischer
Fredy Fischer

Reputation: 458

If you want to authenticate against active directory, there is a how to on the apache page . This does not mean the user under tomcat is running nor the user accessing the DB, it's just the user using tomcat.

Upvotes: 0

Olaf Kock
Olaf Kock

Reputation: 48087

If you mean OS-User: No. Tomcat is one process, which runs as one OS-User.

You can provide different databases (e.g. connection pools) to each application. But they all will run within the same process.

Alternatively, you can run many different tomcats (naturally, on multiple ports) and combine them all with a frontend Apache httpd or nginx, forwarding the requests to each respective tomcat. This way, all tomcats can run as their individual OS-User, but still appear as a single webserver on the standard ports 80 and 443.

Upvotes: 2

Related Questions