Tomcat Multiple Localhost Instances [closed] - apache

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
What is the smartest way to configure Tomcat to have two localhost instances?
Please note that I do not have admin rights to the system, and so don't have access to the /etc/hosts file. I would love to be able to do something like the following, but can't modify my /etc/hosts files:
http://juststuffreally.blogspot.com/2007/03/enabling-multiple-localhost-sites-in.html
I'd like to have something like this, so that my instances of localhost would look as follows:
keith.localhost.com
joe.localhost.com
...but I can't modify my /etc/hosts file =-(
Another resource that I found was this, but this gives instruction for multiple outside domains--I need multiple localhost instances:
http://iam-rakesh.blogspot.com/2009/10/hosting-multiple-domains-in-tomcat.html
Any ideas?
Thank you for your help.

You can run multiple instances of tomcat on multiple ports. You would need a unique server.xml for each instance, and each one would need different ports defined in the appropriate <Server> and <Connector> elements.
Once everything is set up, you would specify an explicit port when connecting to the instance, e.g.:
- http://localhost:8080/
- http://localhost:8081/
This document covers the process in a little more detail.

Related

Special configuration of the vhost [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I've got some headache trying to configure that for some days so I hope someone can help me.
I've got few sites, each one related to an FTP account. I would like to make them accessible through my man website by the url http://www.mainsite.com/site1. At this point an Alias should do the work.
However I would like to add some features such as specify the log file related to the site1 which would be in the web directory of the FTP account site1. Later, I would like to put them in /var/log and have a script to sync the log file located in the web directory with the one in /var/log so that even if a user delete the log file in the web directory, the original one is still here.
To go back to the main problem, I don't know how to do that, I tried to configure a whole vhost for the site1 but then, as the ServerName would be the same as the main site, the main site would no longer be accessible.
Any suggestions ?
You could try the ancient ServerPath directive, which will cause /site1 to be mapped to one vhost and /site2 to be mapped to another, despite having matching servername and local interface:port.

How can I change host Name for Apache tomcat server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I installed Apache Tomcat 6.0,I tested with simple Application it's working fine.but every time I calling my app with localhost:8080 in the browser.
I want to change host name(localhost) to something like subbu.for this I tried in the following way.
I open command prompt and entered drivers and after selected etc folder, open host file .in this file I changed subbu instead of localhost.After did this I restarted my system and started apache server and entered in my browser like subbu:8080.it's not working.
I hope,you understand what I faced problem.
How can I resolve this.
In /etc/hosts change the line
127.0.0.1 localhost
to be
127.0.0.1 localhost subbu

How to install/configure mod_reqtimeout in Apache [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I need to configure mod_reqtimeout in my Apache server v2.2.22 (in a linux machine). Problem is, I have absolutely no clue on how to do it.
I checked the Apache site on this module at this link but there was no download/configuration details given.
Can someone help me on this ? Any help is much appreciated. Basically,
Is there something needed to download ?
If not, which files do I need to edit and how?
It's a standard Apache module from 2.2.15 and later, but is apparently missing in some distro versions (e.g. Ubuntu, FreeBSD).
First, check that mod_reqtimeout exists (e.g. look in apache2/modules/ or - depending on your system - do something like /usr/sbin/httpd -l | grep mod_reqtimeout). Second, if it is, make sure it's enabled in your Apache config.
mod_reqtimeout is available from GitHub (also see the RPM resource). Finally, this thread has some useful tips. BTW FYI I don't think it can be enabled in an .htaccess file.

How can one reference subdomains on a dev server that also correctly resolve on a production server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've got a LAMP dev server at something like dev.example.com. Eventually this will be replicated to something like www.example.com where we will have root access.
I'd like to have the sys admin set up a few subdomains (e.g., subdomain1.example.com) such that they will work on both the dev server and the production server without the references to those subdomains having to be rewritten.
Can Apache be configured on the dev and production servers such that my code can reference something like subdomain1.localhost? Is there some other way of doing this?
(The servers will run recent versions of CentOS and the AMP stack.)
I finally found the answer in the CDN module. As the name implies, this is intended to be used with content delivery networks but essentially all it does is a rule-based re-writing of the URLs that Drupal outputs. I've used it to re-write URLs so that different file types can be served from unique hostnames (again, to maximize parallel downloads).
reading your question again, I think that you want your code to always return subdomain1.localhost, and you want apache to somehow change this to subdomain1.example.com on your production server.
You could do this with ProxyPassReverse, although you might have to run two copies of Apache if the subdomain1 is on the same machine. (I don't know if Apache will cope with talking to itself here). This is an expensive solution.
Instead, I recommend your parameterize your code.
On rails stacks, the easiest way to do this with the production.rb cp that capistrano recommends, and you might want to investigate similar ways of deploying your PHP code.

Apache wildcard at domain level [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have few sites, and they all have identical setup on a single server. Now, instead of the separate configuration file for each of them in sites-enabled directory, I want to have a common file.
Idea is this:
www.abc.com should have /var/www/abc as DocumentRoot,
www.xyz.com should have /var/www/xyz as DocumentRoot, etc.
All other parameteres like log files, contact emails etc should also have identical setup (abc.com should have contact#abc.com as admin email, xyz.com should have contact#xyz.com as admin email etc).
I couldnt find any tutorial on how to backreference wildcards, etc.
regards,
JP
Aha. Found the solution. VirtualDocumentRoot is the answer.
A single line like:
VirtualDocumentRoot /var/www/%0
does the job. Havent really figured the logs stuff but should be similar and easy.
See https://serverfault.com/questions/182929/wildcard-subdomain-directory-names for a nice related thread.
You gotta enable vhost_alias module for this. (sudo a2enmod vhost_alias on ubuntu).