You are not logged in.

#1 2012-04-26 08:04:27

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

tomcat7 fails can not load virtual host directory [solved]

I have a new installation of timcat7 setup. The default apps work fine.

I have a virtual host setup in my home directory but tomcat gies the following erro and it does nto work:
"SEVERE: Application base [/home/doug/Sites/localcity] for host [localcity] does not exist or is not a directory. deployOnStartUp and autoDeploy have been set to false to prevent deployment errors. Other errors may still occur."

This is an extract of ls -la of ~/Sites
...
drwxrwxr-x  2 tomcat tomcat 4096 Apr 25 12:05 localcity
...

I have the exact same setup on a different machine and can not see any differences. Any clue as to what I can do get get this host working?

I am in the group 'tomcat'.

Last edited by hypoglycemic (2012-06-05 12:41:54)

Offline

#2 2012-04-27 14:23:52

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Bump. this is still an issue for me.

I have tried complettly removing the tomcat7 package and reinstalling it. I would be happy with 5.5 or 6 but my production environment is 7 so matching that as closly as possible is desirable.

Offline

#3 2012-04-29 11:56:43

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Bump aing. Any ideas yet?

Offline

#4 2012-05-05 05:35:54

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Still have this issue. Is there some other log I can view for more information on exactly the problem?

Offline

#5 2012-05-12 07:42:43

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

I am not sure what else I can try to help diagnose why this is breaking. Anyone have some ideas?

Offline

#6 2012-05-15 08:31:51

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Id still really love some help with this. Any ideas at all?

Offline

#7 2012-05-22 08:42:03

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Still hoping for some ideas for this. What could be makign this happen?

I reinstalled again with the default everythign. I then changed the default path of the default host to what is above and left everything else the same. Still having the same problem. (Works fine if I just use the default webapp dir)

Offline

#8 2012-05-26 01:08:30

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

I still think all the permissions are correct so I do not know what else I can check. Anyone think of anything?

Offline

#9 2012-05-26 05:24:40

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

I changed back to the dafault host location of webapps with the examples in it to test if it some larger problem than hosts. It looks liek it is becasue thsi is the log output on start up:

May 26, 2012 3:07:33 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [/usr/share/tomcat7/work/Catalina/localcity/manager] for context [/manager]
May 26, 2012 3:07:34 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [741] milliseconds.
May 26, 2012 3:07:34 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: /usr/share/tomcat7/work/Catalina/localcity/manager is unusable.
May 26, 2012 3:07:34 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/docs
May 26, 2012 3:07:34 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [/usr/share/tomcat7/work/Catalina/localcity/docs] for context [/docs]
May 26, 2012 3:07:34 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: /usr/share/tomcat7/work/Catalina/localcity/docs is unusable.
May 26, 2012 3:07:34 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/host-manager
May 26, 2012 3:07:34 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [/usr/share/tomcat7/work/Catalina/localcity/host-manager] for context [/host-manager]
May 26, 2012 3:07:34 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: /usr/share/tomcat7/work/Catalina/localcity/host-manager is unusable.
May 26, 2012 3:07:34 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 26, 2012 3:07:34 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: /usr/share/tomcat7/work/Catalina/localcity/_ is unusable.
May 26, 2012 3:07:34 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/examples
May 26, 2012 3:07:34 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [/usr/share/tomcat7/work/Catalina/localcity/examples] for context [/examples]
May 26, 2012 3:07:35 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 26, 2012 3:07:35 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
May 26, 2012 3:07:35 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: /usr/share/tomcat7/work/Catalina/localcity/examples is unusable.
May 26, 2012 3:07:35 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@6098f192')
May 26, 2012 3:07:35 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 26, 2012 3:07:35 PM org.apache.catalina.startup.Catalina start


So there is something wrong with the installation itself. I have pacman -R it followed by a -S but the problem remains.

Is there someway to really super duperly remove the everythign related to tomcat to really truely remove ever trace so that it should rever to normal behaviour?

Offline

#10 2012-05-30 08:46:40

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

Is there a way to install all the parts that are related to making tomocat work? Maybe I broke some supporting program that needs to be put back in? i.e. is there a command to reinstall the entire stack that omcat depends upon?

Offline

#11 2012-06-02 07:58:06

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

I upgraded form jdk6 to jdk7 and the problems in #9 have gone away and the default app "Welcome to Tomcat" now works again but the virtual host still ahs the error:
"...
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Jun 03, 2012 1:48:15 AM org.apache.catalina.startup.HostConfig start
SEVERE: Unable to create directory for deployment: /home/doug/Sites/localcity
Jun 03, 2012 1:48:15 AM org.apache.catalina.startup.HostConfig start
SEVERE: Application base [/home/doug/Sites/localcity] for host [localcity] does not exist or is not a directory. deployOnStartUp and autoDeploy have been set to false to prevent deployment errors. Other errors may still occur.
Jun 03, 2012 1:48:15 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/manager
Jun 03, 2012 1:48:15 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/docs
...
"

I have stopped tomcat, cleared the cache and restarted. Navigating to localcity give a blank white page (and no other servers are running).

Has the config changed between 6 and 7 such that i cant see?
This is what I am using:
      <Host name="localcity"  appBase="/home/doug/Sites/localcity"
            unpackWARs="false" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localcity_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>

Pending this all working I still feel that somethign that tomcat is relying on has broken and needs to be reinstalled. Any clue how I can do that?

Offline

#12 2012-06-02 08:23:35

rowdog
Member
From: East Texas
Registered: 2009-08-19
Posts: 118

Re: tomcat7 fails can not load virtual host directory [solved]

Well, it looks like a permissions problem. I'm not familiar with tomcat, but the user apache runs as would not be likely be able to write to /home/doug/Sites.

Typically, you'd want to create the "Sites" directory somewhere the "http" user can reach, maybe /srv/http/Sites. Then you need to change the permissions to let "http" user write to the directory. There are several ways to go, but most people would use 'chown http:http Sites'. I tend to use the sticky bit but I'm not sure I'd really recommend it.

Oh, and then update tomcat config to use the new Sites directory.

Last edited by rowdog (2012-06-02 08:28:15)

Offline

#13 2012-06-04 11:54:32

hypoglycemic
Member
Registered: 2010-01-14
Posts: 25

Re: tomcat7 fails can not load virtual host directory [solved]

rowdog wrote:

Well, it looks like a permissions problem. I'm not familiar with tomcat, but the user apache runs as would not be likely be able to write to /home/doug/Sites.

This looks like it solved the problem to me.

I did end upmoving the folder ot /srv/http and goignwith the permisisons you said. Everythign seems to be workign well now. I made sure I was in the tomcat group too.

Thank you for you patietns and help with this.

Offline

#14 2012-06-04 14:54:34

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: tomcat7 fails can not load virtual host directory [solved]

hypoglycemic wrote:

This looks like it solved the problem to me.

Then please mark your thread as SOLVED


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB