Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Mar 23, 2013 2:19 pm 
Offline
Senior Newbie

Joined: Sat Mar 23, 2013 2:02 pm
Posts: 13
Hello,

Joined Linode community a week ago! My initial idea was to host a tomcat website. The more that I read the more I am getting interested in setting up a mail server on the same machine and maybe even SVN. I am confused on what to point my domain name. I registered for a domain name via registrar. My initial thinking was that I would just point the domain name to myipaddress:8080/MySite since you need a context root on tomcat. From what I am reading about PostFix and I think which is the correct way is to point the domain name to the ipadddress rather than ipaddress, port and site name. I can change the port of tomcat to point to 80, but if I point the site to the ipaddress only then I would still need to go to ipaddress/MySite in order access my site. I know I can put in a redirect on the ipaddress to point to ipaddress/MySite on port 80, but I do not want the MySite part to be visible.

Would anyone know what a plausible solution would be to this issue? Or can someone help me and point me to the right direction in what I am trying to do?

Any help will be greatly appreciated.


Top
   
PostPosted: Sat Mar 23, 2013 2:30 pm 
Offline
Senior Newbie

Joined: Mon May 10, 2010 11:29 pm
Posts: 15
You pretty much have it right, but there are a few other things you can do.

The DNS can only point at a hostname/IP address, the port and path are separate.

You 'can' run tomcat on port 80, but when I was looking to do this earlier this week, I found out that there is a permission problem because tomcat runs as an unprivileged user and can't run on ports below 1024 without a modification. You can either do the modification, or use something to redirect the port: You could use an apache proxy, or an iptables port redirection as you mentioned. You can probably also use the apache proxy to avoid having to display the 'MySite' path.

Another thing you can do to avoid the need for 'MySite' is to configure tomcat to host the site in the web root. I think the correct way to do this is to create a file in the webapps directory called 'ROOT.xml' - this should be a copy of the file that is used to deploy your application, I normally symlink them so that they stay synced.

Hope this helps,

Dan

EDIT: Oh, I didn't mention about the mail server - you probably just need to set it up if the domain name is already pointing at the correct place.

_________________
https://danieljamesscott.org


Top
   
PostPosted: Sat Mar 23, 2013 2:50 pm 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
The other option you have is to install apache webserver and route http requests from it to your tomcat workers. You may also consider using apache to serve your static media too.

The extra advantage of running apache is that it will make it easy to setup SVN access via a URL too.


Top
   
PostPosted: Sun Mar 24, 2013 1:53 pm 
Offline
Senior Newbie

Joined: Sat Mar 23, 2013 2:02 pm
Posts: 13
Thank you so much for both of your responses. This solution seems like it might solve another issue that I was having. I was thinking of setting up Redmine and SVN also. Does this mean that I can run SVN and Redmine on apache and my site on tomcat?

I will look for some tutorials on how to accomplish the task. If you know of any please do let me know.


Top
   
PostPosted: Sun Mar 24, 2013 2:06 pm 
Offline
Senior Newbie

Joined: Sat Mar 23, 2013 2:02 pm
Posts: 13
Actually I have one more question. Would using apache as a proxy help me accomplish something like:
www.website.com -> Goes to localhost:8080/MySite
admin.website.com -> Goes to localhost:8080/AdminSite
redmine.website.com -> Goes to site hosted on apache

for admin.website.com or redmine.website.com do I need to purchase anything special? I am actually fine with www.website.com/admin or www.website.com/redmine also but not sure if that is possible in the proxy way.


Top
   
PostPosted: Sun Mar 24, 2013 5:03 pm 
Offline
Senior Newbie

Joined: Mon May 10, 2010 11:29 pm
Posts: 15
Hi,

You can definitely do subdomains using apache: you need to add domain entries in DNS and use VirtualHosts in apache.

Dan

_________________
https://danieljamesscott.org


Top
   
PostPosted: Mon Mar 25, 2013 10:07 am 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
sunnyjassal wrote:
Actually I have one more question. Would using apache as a proxy help me accomplish something like:
http://www.website.com -> Goes to localhost:8080/MySite
admin.website.com -> Goes to localhost:8080/AdminSite
redmine.website.com -> Goes to site hosted on apache

for admin.website.com or redmine.website.com do I need to purchase anything special? I am actually fine with http://www.website.com/admin or http://www.website.com/redmine also but not sure if that is possible in the proxy way.


I use proxying, Apache for static content and certificates, run Tomcat on localhost:8080. This lets me run other servers if I wish on localhost on different ports all front-ended with Apache, certificates in just one place, Apache. I use ProxyPass and ProxyPassReverse. If I operated a high bandwidth site or sites I might change the configuration though so YMMV.


Top
   
PostPosted: Mon Mar 25, 2013 10:50 am 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
sunnyjassal wrote:
I was thinking of setting up Redmine and SVN also. Does this mean that I can run SVN and Redmine on apache and my site on tomcat?


Yes definitely. Apache will serve your "normal" websites like Redmine or SVN-via-HTTP and it will then proxy requests for your application through to your tomcat app and the process will be transparent to your end-users, they'll not notice the difference.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group