Right, apparently deployOnStartup must be set to true otherwise the sites don't get uploaded.
(No idea in which case it could be set to false) I understand that I can upload unzipped war files, but I still would like to move over war files to my production server. Anyway, apart from the packed and unpacked web apps, was everything else correct, provided that deployOnStartup is set to true. The main issue is actually not the packed and unpacked web apps, I am actually trying to figure out why the sites are not showing after a while, so I am trying to configure everything correctly. Thanks. David Smith-2 wrote: > > If all you want to do is see the directory structure, why don't you just > unzip the .war file? That's all a .war/.jar file essentially is -- a > zip archive. Admittedly you can't just zip any folder and get a war > file, but you can see the contents just by unzipping it. > > --David > > jerrycat wrote: >> [Tried to read the tomcat docs, but it is a bit confusing] >> >> Right, my goal is to deploy war files that get unpacked so that I can see >> the directory structure. >> >> I am not interested in autoDeploy or deployOnStartup, unless it is >> necessary. >> >> Here is a paragraph from the docs: >> >> "Finally, note that if you are defining contexts explicitly, you should >> probably turn off automatic application deployment. Otherwise, your >> context >> will be deployed twice each, and that may cause problems for your app." >> >> >> So, I guess I am defining contexts explicitly, since I add a context.xml >> file under the META-INF >> folder of each of my web apps. >> >> This then means that autoDeploy should be set to false of my Host >> elements. >> Also I set deployOnStartup to false since I am not in need of it. >> >> Here is how I do: >> >> 1. Create a folder under webapps and name it test so the path is >> webapps/test >> >> 2. Add this Host element: >> <Host name="www.test.com" deployOnStartup="false" debug="0" >> appBase="webapps/test" unpackWARs="true" autoDeploy="false" >> xmlValidation="false" xmlNamespaceAware="false"> >> <Valve >> >> className="org.apache.catalina.valves.FastCommonAccessLogValve" >> prefix="access_log." >> suffix=".txt" >> pattern="common" >> directory="C:/Program Files/Apache Software Foundation/Tomcat >> 5.5/webapps/test/logs"/> >> </Host> >> >> 3. The context.xml under the META-INF folder of the test web app: >> <Context> >> <Resource >> name="jdbc/testDB" >> factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" >> auth="Container" >> type="javax.sql.DataSource" >> maxActive="10" >> maxIdle="5" >> maxWait="10000" >> removeAbandoned="true" >> removeAbandonedTimeout="60" >> logAbandoned="true" >> username="root" >> password="secret" >> driverClassName="com.mysql.jdbc.Driver" >> url="jdbc:mysql://localhost:3306/test" /> >> </Context> >> >> 4. Deploy the test web app under the webapps/test folder and name the war >> file ROOT.war: >> webapps/test/ROOT.war >> >> 5. Start Tomcat and it works: >> It works locally, when Host name is 127.0.0.2 instead of www.test.com, >> have not tried yet >> on the production server, but I assume it should. >> >> Questions: >> >> 1. Some web apps don't need the JNDI/JDBC data source configuration, >> is it OK with an empty context element in the context.xml file: >> <Context /> >> >> 2. Is all the configuration above OK (even though it works) >> >> 3. My production tomcat server (configured differently, very much the old >> fashioned way with Context elements within Host elements) after a while >> do >> not show the websites although the tomcat server is still >> running. >> >> Could this be because of misconfiguration? >> Nothing else is running on port 80 and the firewall is turned off. The OS >> is >> windows server 2003. >> >> >> Thanks for all help so far. >> >> >> Markus Schönhaber-10 wrote: >> >>> jerrycat wrote: >>> >>> >>>> Thanks, >>>> just a question here. >>>> >>>> Set the appBase attributes for all your Host elements to different >>>> paths >>>> and make sure that not one is contained in another. For example, if >>>> you've got two hosts, "localhost" and "www.test.com", you could >>>> configure them like that: >>>> <Host name="localhost" appBase="webapps/localhost" [...] >>>> and >>>> <Host name="www.test.com" appBase"webapps/test" [...] >>>> >>>> The question: >>>> If I have a subdomain, demo.test.com, should I define a new Host? >>>> <Host name="demo.test.com" appBase"webapps/demo.test" >>>> >>> If you want demo.test.com to be different from www.test.com, then yes. >>> Otherwise you could define demo.test.com to be an Alias for >>> www.test.com. >>> >>> >>>> The name after webapps/, which is demo.test, can it be named anyhow? >>>> for example webapps/mydemotestwebapp >>>> >>> Yes. >>> In fact, there is no law that states that the appBase has to start with >>> webapps/. You could even use absolute paths to point appBase to a >>> directory outside of your CATALINA_BASE. >>> >>> Regards >>> mks >>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >>> >> >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Tomcat-5.5-context.xml%2C-how-to-configure-the-Host-element-tp19152267p19170480.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]