|
INTERVIEW QUESTIONS
SERVERS
DETAILS
Question: How do you create multiple virtual hosts?
Answer: If you want tomcat to accept requests for different hosts e.g., www.myhostname.com then you must
0. create ${catalina.home}/www/appBase , ${catalina.home}/www/deploy, and ${catalina.home}/conf/Catalina/www.myhostname.com
1. add a host entry in the server.xml file <Host appBase="www/appBase" name="www.myhostname.com"/>
2. Create the the following file under conf/Catalina/www.myhostname.com/ROOT.xml <?xml version="1.0" encoding="UTF-8"?> <Context path="/" docBase="www/deploy/mywebapp.war" reloadable="true" antiJARLocking="true"> </Context> Add any parameters specific to this hosts webapp to this context file
3. put your war file in ${catalina.home}/www/deploy
When tomcat starts, it finds the host entry, then looks for any context files and will start any apps with a context
To add more sites just repeat and rinse, all webapps can share the same war file location and appbase
|
|
|
Category |
Servers Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 9113 users |
Added on |
8/1/2015 |
Views |
69927 |
Rate it! |
|
|
Question:
How do you create multiple virtual hosts?
Answer:
If you want tomcat to accept requests for different hosts e.g., www.myhostname.com then you must
0. create ${catalina.home}/www/appBase , ${catalina.home}/www/deploy, and ${catalina.home}/conf/Catalina/www.myhostname.com
1. add a host entry in the server.xml file <Host appBase="www/appBase" name="www.myhostname.com"/>
2. Create the the following file under conf/Catalina/www.myhostname.com/ROOT.xml <?xml version="1.0" encoding="UTF-8"?> <Context path="/" docBase="www/deploy/mywebapp.war" reloadable="true" antiJARLocking="true"> </Context> Add any parameters specific to this hosts webapp to this context file
3. put your war file in ${catalina.home}/www/deploy
When tomcat starts, it finds the host entry, then looks for any context files and will start any apps with a context
To add more sites just repeat and rinse, all webapps can share the same war file location and appbase Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain the concepts of Tomcat Servlet Container.
|
View Answer
|
|
What is Jasper?
|
View Answer
|
|
What is Tomcat?
|
View Answer
|
|
How Jigsaw Works
|
View Answer
|
|
What is Jigsaw?
|
View Answer
|
|
If you specify both deny from all and allow from all, what will be the default action of Apache?
|
View Answer
|
|
What does htpasswd do?
|
View Answer
|
|
What is mod_vhost_alias?
|
View Answer
|
|
What is ServerType directive?
|
View Answer
|
|
How do you set up a virtual host in Apache?
|
View Answer
|
|
Why do I get the message "… no listening sockets available, shutting down"?
|
View Answer
|
|
But I thought that running apache as a root is a security risk?
|
View Answer
|
|
When I do ps -aux, why do I have one copy of httpd running as root and the rest as nouser?
|
View Answer
|
|
How do you check for the httpd.conf consistency and any errors in it?
|
View Answer
|
|
What does apachectl graceful do?
|
View Answer
|
|
What’s the command to stop Apache?
|
View Answer
|
|
On a fresh install, why does Apache have three config files - srm.conf, access.conf and httpd.conf?
|
View Answer
|
|
How to configure ftp server on redhat linux?
|
View Answer
|
|
What is a Web server in client server environment?
|
View Answer
|
|
What is a Web server?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Servers Interview Questions & Answers - Exam Mode /
Learning Mode
|