Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have just bought a Linux VPS and the current setup seems to be apache. The HTML files are stored on

/var/www

I want to install tomcat on this server. I don't understand where I should install this so when I am on my domain I want to use the tomcat server instead of what is in the /var/www/ folder.

This is the first time I have used a VPS so I a little confused on where to install software.

Does it matter where it is installed as long as I use port 8080?

share|improve this question

migrated from stackoverflow.com Feb 12 '12 at 22:41

This question came from our site for professional and enthusiast programmers.

    
What do you mean by I want to use the tomcat server instead of what is in the /var/www/ folder? –  shadyabhi Feb 12 '12 at 15:16
    
What I mean is when I go to www.domain.com it will run the files in my tomcat webapps folder –  Decrypter Feb 12 '12 at 15:26
    
There's nothing magical about it being a VPS. Configure it as you'd configure any server. If you don't know how, then you shouldn't have bought it. –  Lightness Races in Orbit Feb 12 '12 at 16:28

1 Answer 1

decide what should run on you VPS server:

  • a Webserver, typically apache (I will assume it's apache in your case, for simplicity)
  • your tomcat webcontainer or servlet container.
  • both

These server program are a little different in what they do and what they should be used for. Apache is great for serving static content, but can not execute your WAR files. It may be coupled with a tomcat, so apache delegates sone URI-Paths to the tomcat.

Tomcat runs you webapp, that is usually an Java WAR.

No two server can listen on the same port of the same machine (this is a little simplification, but matches the question), so you have to decide which server you want to call.

I assume that you have found the documentation to apache and tomcat.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.