You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joel <fe...@gmail.com> on 2011/02/22 16:44:23 UTC

server running website

So my boss has a Tomcat folder that was running a website at his old job. I
don't know how to determine the exact version but in the realease notes
there is: "$Id: RELEASE-NOTES-4.1.txt,v 1.81 2003/10/27 13:40:27 remm Exp $"
he wants to run it on a new machine, the OS is: Mac OS X Server 10.6.5

 When I do "sudo bash startup.sh" I get:
Using CATALINA_BASE:   /opt/Tomcat
Using CATALINA_HOME:   /opt/Tomcat
Using CATALINA_TMPDIR: /opt/Tomcat/temp
Using JAVA_HOME:       /Library/Java/Home

But when I try to go to the page "localhost:8080" or "localhost:80"

Safari says:

"Safari can’t open the page “http://function2.basiceng.umr.edu/view” because
Safari can’t find the server “function2.basiceng.umr.edu”."

When I don't run the server as sudo I get things like

Safari can’t open the page “http://www.localhost.com:80/” because the server
unexpectedly dropped the connection. This sometimes occurs when the server
is busy. Wait for a few minutes, and then try again.


Likewise when shutting down the server without sudo:
Using CATALINA_BASE:   /opt/Tomcat
Using CATALINA_HOME:   /opt/Tomcat
Using CATALINA_TMPDIR: /opt/Tomcat/temp
Using JAVA_HOME:       /Library/Java/Home
Catalina.stop: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
 at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
 at java.net.Socket.<init>(Socket.java:189)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:581)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

I don't mind running the server as root currently (I was just showing that
to see if that was a symptom of another problem), but I was wondering how it
can obviously find the correct previous web address but not find the server
that is running it; is it for some reason trying to go to the previous
website even though I told it to go to localhost? I tried changing all the
files in the tomcat folder to being owned by my user name but that had no
effect (that was impulsive hopefully that won't screw anything up later, let
me know if so)

I was wondering where I should start looking to resolve these problems.
Thanks.

Re: server running website

Posted by David Smith <da...@cornell.edu>.
Check the logs to find out what happened when you attempted to start the
server.  Is there something else already running on the ports tomcat is
trying to use?  What does netstat list as listening ports with and
without tomcat running?  Also what connectors are configured in your
tomcat's server.xml?

As you can see way too many questions to offer any suggestions.

--David

On 2/22/2011 10:44 AM, Joel wrote:
> So my boss has a Tomcat folder that was running a website at his old job. I
> don't know how to determine the exact version but in the realease notes
> there is: "$Id: RELEASE-NOTES-4.1.txt,v 1.81 2003/10/27 13:40:27 remm Exp $"
> he wants to run it on a new machine, the OS is: Mac OS X Server 10.6.5
>
>  When I do "sudo bash startup.sh" I get:
> Using CATALINA_BASE:   /opt/Tomcat
> Using CATALINA_HOME:   /opt/Tomcat
> Using CATALINA_TMPDIR: /opt/Tomcat/temp
> Using JAVA_HOME:       /Library/Java/Home
>
> But when I try to go to the page "localhost:8080" or "localhost:80"
>
> Safari says:
>
> "Safari can’t open the page “http://function2.basiceng.umr.edu/view” because
> Safari can’t find the server “function2.basiceng.umr.edu”."
>
> When I don't run the server as sudo I get things like
>
> Safari can’t open the page “http://www.localhost.com:80/” because the server
> unexpectedly dropped the connection. This sometimes occurs when the server
> is busy. Wait for a few minutes, and then try again.
>
>
> Likewise when shutting down the server without sudo:
> Using CATALINA_BASE:   /opt/Tomcat
> Using CATALINA_HOME:   /opt/Tomcat
> Using CATALINA_TMPDIR: /opt/Tomcat/temp
> Using JAVA_HOME:       /Library/Java/Home
> Catalina.stop: java.net.ConnectException: Connection refused
> java.net.ConnectException: Connection refused
>  at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
> at java.net.Socket.connect(Socket.java:529)
>  at java.net.Socket.connect(Socket.java:478)
> at java.net.Socket.<init>(Socket.java:375)
>  at java.net.Socket.<init>(Socket.java:189)
> at org.apache.catalina.startup.Catalina.stop(Catalina.java:581)
>  at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
>  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>
> I don't mind running the server as root currently (I was just showing that
> to see if that was a symptom of another problem), but I was wondering how it
> can obviously find the correct previous web address but not find the server
> that is running it; is it for some reason trying to go to the previous
> website even though I told it to go to localhost? I tried changing all the
> files in the tomcat folder to being owned by my user name but that had no
> effect (that was impulsive hopefully that won't screw anything up later, let
> me know if so)
>
> I was wondering where I should start looking to resolve these problems.
> Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: server running website

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 2/22/2011 10:59 AM, Caldarale, Charles R wrote:
>> From: Joel [mailto:felixtheratruns@gmail.com] 
>> Subject: server running website
> 
>> But when I try to go to the page "localhost:8080" or "localhost:80"
>> Safari says:
>> "Safari can't open the page "http://function2.basiceng.umr.edu/view" because
>> Safari can't find the server "function2.basiceng.umr.edu"."
> 
> Looks like something is seriously askew in your hosts file.  The localhost id should always be mapped to 127.0.0.1, not some external DNS name.
> 
>> When I don't run the server as sudo I get things like
>> Safari can't open the page "http://www.localhost.com:80/" because the server
>> unexpectedly dropped the connection. This sometimes occurs when the server
>> is busy. Wait for a few minutes, and then try again.
> 
> Again, it looks like something's wrong with the hosts file.

Careful. My last experience with Mac OS X lead, after days of head
scratching and ranting and raving, to the conclusion that the /etc/hosts
file is a sham: everything was being controlled via a LDAP configuration
and the hosts file was being ignored.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1lLNQACgkQ9CaO5/Lv0PBmlACbBjxczgeWIRqjwJ4azl6PRNXb
Wb4Ani4GYgWpPf+98PXRO12hFcUyt8YR
=hhTP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: server running website

Posted by Joel <fe...@gmail.com>.
Ignore that half complete message. One of mac's annoying keyboard shortcuts
sent that for me :) (don't ask me how, I really don't know how it happened)

Re: server running website

Posted by Joel <fe...@gmail.com>.
On 2/23/2011 4:18 PM, Joel wrote:
> >>> sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec \
> >>>>   grep "function2.basiceng.umr.edu" "{}" \;
>
> Oops: I forgot the "-l" switch on grep... it's not giving you any file
> names :)


sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec grep -l "
function2.basiceng.umr.edu" "{}" \;
Password:
Sorry, try again.
Password:
/opt/Tomcat/webapps/ROOT/index.jsp
/opt/Tomcat/webapps/view/acct_new.jsp
/opt/Tomcat/webapps/view/css/.nobar.css.swp
/opt/Tomcat/webapps/view/test.html
/opt/Tomcat/webapps/view/test1.html
/opt/Tomcat/webapps/view2/acct_new.jsp
/opt/Tomcat/webapps/view2/css/.nobar.css.swp
/opt/Tomcat/work/Standalone/localhost/_/index_jsp.class
/opt/Tomcat/work/Standalone/localhost/_/index_jsp.java
/opt/Tomcat/work/Standalone/localhost/view/acct_new_jsp.java





>  >>> Password:
> >>> <meta http-equiv="Refresh" content="0;url=
> >>> http://function2.basiceng.umr.edu/view">
> >>> // "<a href=\"
> >>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
> +
> >>> id + "\">"
> >>> Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
> >>> <a href="http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi
> >>> ">Test</a>
> >>>  <FORM ACTION="http://function2.basiceng.umr.edu/tst.cgi">
> >>> // "<a href=\"
> >>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
> +
> >>> id + "\">"
> >>> Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
> >>> Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class
> >>> matches
> >>>       out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
> >>> http://function2.basiceng.umr.edu/view\">\r\n");
> >>>  // "<a href=\"
> >>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
> +
> >>> id + "\">"
>
> Got some hits, I see. What is the hostname of the server on which the
> app is actually running, now? Either :80 or :8080 should work given the
> configuration you've shown, so I suspect the hostname is the problem.
> You can always try to configure an /etc/hosts setting for the above
> hostname and set them to the IP address of the real host -- just for
> testing, of course... it's not reasonable to have users modify their
> hosts files just to use your webapp :)
>
> I'm not exactly sure what you are talking about. I don


I tried setting the host name to function2.basiceng.umr.edu with "sudo
scutil --set HostName function2.basiceng.umr.edu" I also tried escaping the
periods like so
"sudo scutil --set HostName "function2\.basiceng\.umr\.edu", and "sudo
scutil --set HostName function2\\.basiceng\\.umr\\.edu" and I tried putting
quotes around all of the former but the hostname continues to show up as
"function2" or "function2\".






function2:~ joel$ PS1="[\d \t \u@\h:\w ] $ "
[Thu Feb 24 13:19:21 joel@function2:~ ] $



I may be missing something here, if this isn't what you meant let me know.



>
> Hmm... does Wireshark have a Mac OS X build? You might try that if you
> get desperate.
>
> > So I was wondering if the website url in these files has anything to do
> with
> > my problem
>
> If the hostname of the server has changed (or you've moved the app,
> which it sounds like you have), then it is /very/ likely to cause problems.
>
>
Yes it does, but when I don



 > and if so are all the java files present for all the class files
>
> You'll have to check that out for yourself. How familiar are you with
> Java in general? Each .class file comes from a .java file, though there
> are some cases where the .java filename isn't obvious from the .class
> file name (inner classes, anonymous classes, and other assorted fun stuff).
>
> String constants are compiled-into the .class files without any
> compression, so if you have a .java file with that text in it, you
> should find it in the .java file that goes with it.
>
> Web applications rarely come with any source files in them, though .jsp
> files (which are compiled on the fly by the server) are always in
> "source form". If the webapp is written properly, all UI-related stuff
> will be in the .jsp files and not in any .java files.
>
> > and if so how would I go about recompiling the java files?
>
> That really depends on the build process of the webapp. Are there any
> files like "build.xml" in the root directory of the webapp? Anything
> else that might look like a build script? If you don't have any .java
> files, you have nothing to compile, which would be convenient. If you do
> have them and there are no build scripts, you might have to use "javac",
> the command-line compiler, which is similar to the "cc" C compiler
> except that it doesn't do any linking: just compiles .java -> .class.
>
> > Binary file Tomcat/work/Standalone/localhost/_/index_jsp.class matches
>
> These files are compiled .jsp files: you can ignore them and focus on
> the source .jsp with a similar name. For instance, the file above should
> have come from a file called "index.jsp".
>
> There will also be a .java file laying around with a similar name. Oh,
> there it is:
>
> > Tomcat/work/Standalone/localhost/_/index_jsp.java:      out.write("<meta
> > http-equiv=\"Refresh\" content=\"0;url=
> > http://function2.basiceng.umr.edu/view\">\r\n");
>
>

Re: server running website

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joel,

I'll try to hit all your replies at once, here.

On 2/23/2011 4:18 PM, Joel wrote:
>>> sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec \
>>>>   grep "function2.basiceng.umr.edu" "{}" \;

Oops: I forgot the "-l" switch on grep... it's not giving you any file
names :)

>>> Password:
>>> <meta http-equiv="Refresh" content="0;url=
>>> http://function2.basiceng.umr.edu/view">
>>> // "<a href=\"
>>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>>> id + "\">"
>>> Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
>>> <a href="http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi
>>> ">Test</a>
>>>  <FORM ACTION="http://function2.basiceng.umr.edu/tst.cgi">
>>> // "<a href=\"
>>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>>> id + "\">"
>>> Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
>>> Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class
>>> matches
>>>       out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
>>> http://function2.basiceng.umr.edu/view\">\r\n");
>>>  // "<a href=\"
>>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>>> id + "\">"

Got some hits, I see. What is the hostname of the server on which the
app is actually running, now? Either :80 or :8080 should work given the
configuration you've shown, so I suspect the hostname is the problem.
You can always try to configure an /etc/hosts setting for the above
hostname and set them to the IP address of the real host -- just for
testing, of course... it's not reasonable to have users modify their
hosts files just to use your webapp :)

>>>> This appears commented-out, but could be a problem.
>>>>
>>> How could this be a problem if it is commented out?

Well, it's tough to tell if it's commented since there was no context.
Maybe there really was a "//" in the output. Besides, anywhere that text
occurs is a potential error in case it gets un-commented in the future.

>> Yeah, finally found the tools menu (not used to macs), but I still can't
>> see how to turn off friendly messages. All the options are different in the
>> mac version.

Hmm... does Wireshark have a Mac OS X build? You might try that if you
get desperate.

> So I was wondering if the website url in these files has anything to do with
> my problem

If the hostname of the server has changed (or you've moved the app,
which it sounds like you have), then it is /very/ likely to cause problems.

> and if so are all the java files present for all the class files

You'll have to check that out for yourself. How familiar are you with
Java in general? Each .class file comes from a .java file, though there
are some cases where the .java filename isn't obvious from the .class
file name (inner classes, anonymous classes, and other assorted fun stuff).

String constants are compiled-into the .class files without any
compression, so if you have a .java file with that text in it, you
should find it in the .java file that goes with it.

Web applications rarely come with any source files in them, though .jsp
files (which are compiled on the fly by the server) are always in
"source form". If the webapp is written properly, all UI-related stuff
will be in the .jsp files and not in any .java files.

> and if so how would I go about recompiling the java files?

That really depends on the build process of the webapp. Are there any
files like "build.xml" in the root directory of the webapp? Anything
else that might look like a build script? If you don't have any .java
files, you have nothing to compile, which would be convenient. If you do
have them and there are no build scripts, you might have to use "javac",
the command-line compiler, which is similar to the "cc" C compiler
except that it doesn't do any linking: just compiles .java -> .class.

> Binary file Tomcat/work/Standalone/localhost/_/index_jsp.class matches

These files are compiled .jsp files: you can ignore them and focus on
the source .jsp with a similar name. For instance, the file above should
have come from a file called "index.jsp".

There will also be a .java file laying around with a similar name. Oh,
there it is:

> Tomcat/work/Standalone/localhost/_/index_jsp.java:      out.write("<meta
> http-equiv=\"Refresh\" content=\"0;url=
> http://function2.basiceng.umr.edu/view\">\r\n");

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1lk2UACgkQ9CaO5/Lv0PC4bQCdGuAMyj7V7V8wjkNpF+Zuc2Z0
WYcAoKsDd4+DaZlxYdoc5Qs1a+ZFHq9v
=nyyz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: server running website

Posted by Joel <fe...@gmail.com>.
On Wed, Feb 23, 2011 at 3:26 PM, Joel <fe...@gmail.com> wrote:

>
>
> On Wed, Feb 23, 2011 at 12:57 PM, Joel <fe...@gmail.com> wrote:
>
>>
>>
>>
>> On Wed, Feb 23, 2011 at 11:08 AM, Christopher Schultz <
>> chris@christopherschultz.net> wrote:
>>>
>>>
>>> Try this:
>>>
>>> sudo find /opt/Tomcat -type f -exec \
>>>   grep "function2.basiceng.umr.edu" "{}" \;
>>>
>>> Thanks, I'll use this now.
>>
>> sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec \
>> >   grep "function2.basiceng.umr.edu" "{}" \;
>> Password:
>> <meta http-equiv="Refresh" content="0;url=
>> http://function2.basiceng.umr.edu/view">
>> // "<a href=\"
>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>> id + "\">"
>> Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
>> <a href="http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi
>> ">Test</a>
>>  <FORM ACTION="http://function2.basiceng.umr.edu/tst.cgi">
>> // "<a href=\"
>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>> id + "\">"
>> Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
>> Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class
>> matches
>>       out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
>> http://function2.basiceng.umr.edu/view\">\r\n");
>>  // "<a href=\"
>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>> id + "\">"
>>
>>
>>
>>>
>>> >> /opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
>>> >>
>>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
>>> +
>>> >> id + "\">"
>>>
>>> This appears commented-out, but could be a problem.
>>>
>> How could this be a problem if it is commented out?
>>
>>
>>> Are the messages you are getting coming only from Safari? Can you track
>>> the HTTP messages that are actually being sent? It's tough to tell
>>> what's going on just from Safari error messages (which are somewhat
>>> "friendly" and try to interpret the situation instead of telling you
>>> exactly what happened).
>>>
>>>
>> I'm not sure how to do this, I know you can turn off friend messages in
>> internet explorer. But when I downloaded ie5 for mac I couldn't find the
>> *$&#*@(# tools menu. :)
>>
>>
>>
>> oh and this is the /etc/hosts
>>
>> ##
>> # Host Database
>> #
>> # localhost is used to configure the loopback interface
>> # when the system is booting.  Do not change this entry.
>> ##
>> 127.0.0.1       localhost
>> 255.255.255.255 broadcasthost
>> ::1             localhost
>> fe80::1%lo0     localhost
>> ~
>>
>>
>>
>> Thanks for the help.
>>
> Yeah, finally found the tools menu (not used to macs), but I still can't
> see how to turn off friendly messages. All the options are different in the
> mac version.
>



So I was wondering if the website url in these files has anything to do with
my problem and if so are all the java files present for all the class files
and if so how would I go about recompiling the java files?


Binary file Tomcat/work/Standalone/localhost/_/index_jsp.class matches

Tomcat/work/Standalone/localhost/_/index_jsp.java:      out.write("<meta
http-equiv=\"Refresh\" content=\"0;url=
http://function2.basiceng.umr.edu/view\">\r\n");



Thanks.

Re: server running website

Posted by Joel <fe...@gmail.com>.
On Wed, Feb 23, 2011 at 12:57 PM, Joel <fe...@gmail.com> wrote:

>
>
>
> On Wed, Feb 23, 2011 at 11:08 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>>
>>
>> Try this:
>>
>> sudo find /opt/Tomcat -type f -exec \
>>   grep "function2.basiceng.umr.edu" "{}" \;
>>
>> Thanks, I'll use this now.
>
> sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec \
> >   grep "function2.basiceng.umr.edu" "{}" \;
> Password:
> <meta http-equiv="Refresh" content="0;url=
> http://function2.basiceng.umr.edu/view">
> // "<a href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
> Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
> <a href="http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi
> ">Test</a>
>  <FORM ACTION="http://function2.basiceng.umr.edu/tst.cgi">
> // "<a href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
> Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
> Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class matches
>       out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
> http://function2.basiceng.umr.edu/view\">\r\n");
> // "<a href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
>
>
>
>>
>> >> /opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
>> >> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
>> +
>> >> id + "\">"
>>
>> This appears commented-out, but could be a problem.
>>
> How could this be a problem if it is commented out?
>
>
>> Are the messages you are getting coming only from Safari? Can you track
>> the HTTP messages that are actually being sent? It's tough to tell
>> what's going on just from Safari error messages (which are somewhat
>> "friendly" and try to interpret the situation instead of telling you
>> exactly what happened).
>>
>>
> I'm not sure how to do this, I know you can turn off friend messages in
> internet explorer. But when I downloaded ie5 for mac I couldn't find the
> *$&#*@(# tools menu. :)
>
>
>
> oh and this is the /etc/hosts
>
> ##
> # Host Database
> #
> # localhost is used to configure the loopback interface
> # when the system is booting.  Do not change this entry.
> ##
> 127.0.0.1       localhost
> 255.255.255.255 broadcasthost
> ::1             localhost
> fe80::1%lo0     localhost
> ~
>
>
>
> Thanks for the help.
>
Yeah, finally found the tools menu (not used to macs), but I still can't see
how to turn off friendly messages. All the options are different in the mac
version.

Re: server running website

Posted by Joel <fe...@gmail.com>.
On Wed, Feb 23, 2011 at 11:08 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:
>
>
> Try this:
>
> sudo find /opt/Tomcat -type f -exec \
>   grep "function2.basiceng.umr.edu" "{}" \;
>
> Thanks, I'll use this now.

sackett-research-lab2b:~ joel$ sudo find /opt/Tomcat -type f -exec \
>   grep "function2.basiceng.umr.edu" "{}" \;
Password:
<meta http-equiv="Refresh" content="0;url=
http://function2.basiceng.umr.edu/view">
// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"
Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
<a href="http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi
">Test</a>
<FORM ACTION="http://function2.basiceng.umr.edu/tst.cgi">
// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"
Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class matches
      out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
http://function2.basiceng.umr.edu/view\">\r\n");
// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"



>
> >> /opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
> >> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id="
> +
> >> id + "\">"
>
> This appears commented-out, but could be a problem.
>
How could this be a problem if it is commented out?


> Are the messages you are getting coming only from Safari? Can you track
> the HTTP messages that are actually being sent? It's tough to tell
> what's going on just from Safari error messages (which are somewhat
> "friendly" and try to interpret the situation instead of telling you
> exactly what happened).
>
>
I'm not sure how to do this, I know you can turn off friend messages in
internet explorer. But when I downloaded ie5 for mac I couldn't find the
*$&#*@(# tools menu. :)



oh and this is the /etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
~



Thanks for the help.

Re: server running website

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joel,

On 2/23/2011 10:47 AM, Joel wrote:
> On Wed, Feb 23, 2011 at 10:44 AM, Joel <fe...@gmail.com> wrote:
>> sackett-research-lab2b:opt joel$ sudo find /opt/Tomcat -type f | xargs grep
>> function2.basiceng.umr.edu
>> grep: /opt/Tomcat/conf/server: No such file or directory
>> grep: copy.xml: No such file or directory

It looks like you might not have enough "sudos" in there: I believe
xargs isn't being run as administrator, hence all the errors.

Try this:

sudo find /opt/Tomcat -type f -exec \
   grep "function2.basiceng.umr.edu" "{}" \;

>> /opt/Tomcat/webapps/ROOT/index.jsp: <meta http-equiv="Refresh"
>> content="0;url=http://function2.basiceng.umr.edu/view">

That looks promising.

>> /opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
>> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
>> id + "\">"

This appears commented-out, but could be a problem.

There appear to be references to these things in various places:

>> /opt/Tomcat/webapps/view/test.html: <a href="
>> http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi">Test</a>

Note that the port number here (8080) isn't the same as the very first
one (the META refresh, to port 80). It looks like the app "matured" over
some time and maybe graduated from 8080 to 80 and nobody went back and
cleaned things up.

The proper way to create a link in JSP back to the same site, allowing
for relocations of both hostname /and/ deployment directory (say, /foo
instead of /bar) is this:

<a href="<%= response.encodeURL(request.getContextPath()
                        + "/cgi-bin/test.cgi") %>">link text</a>

There are better ways to do this these says (using JSTL, for instance),
but this will work with all versions of JSP... and if you're on Tomcat
4.1 you'll need all the backward-compatibility you can get. :)

>> Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources

Oh, if you're using Struts, you can use the Struts taglibs to create
URLs for you. Assuming you don't really want to mess with too many
things just yet, I'll leave that discussion for later if you want.

Now, the fun part:

>> Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on port 8080

HTTP connector on port 8080.

>> Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on port 80

HTTP connector on port 80.

>> Feb 23, 2011 10:41:52 AM org.apache.jk.common.ChannelSocket init
>> INFO: JK2: ajp13 listening on /0.0.0.0:9007

AJP13 (aka mod_jk) connector on port 9007.

>> Feb 23, 2011 10:41:52 AM org.apache.jk.server.JkMain start
>> INFO: Jk running ID=0 time=1/8  config=/opt/Tomcat/conf/jk2.properties

Fantastic: it's running mod_jk2. Oddly enough, mod_jk2 is out of date
when compared to mod_jk. mod_jk2 was an abortive attempt to improve on
mod_jk... then mod_jk caught up and got better and mod_jk2 wasn't necessary.

Were these the latest "Starting Coyote" messages in the log file? When
constantly starting and stopping, it's easy to lose track of what
messages came from which startup. I recommend deleting the
logs/catalina.out file before you start with a new configuration just to
avoid confusion.

>> tcp46      0      0  *.9007                 *.*                    LISTEN
>> tcp46      0      0  *.http                 *.*                    LISTEN
>> tcp46      0      0  *.http-alt             *.*                    LISTEN

Those appear to be Tomcat.

>> without:
>>
>> sackett-research-lab2b:bin joel$ netstat -a | grep LISTEN

I don't see any :http and :http-alt, so this probably means that Tomcat
is listening properly. No port binding errors in the log file is also a
good indication.

> About the server.xml I must not have looked very closely, I think this is
> what you want.

Looks like the right stuff, thought many are commented-out. Let's look
at the enabled connectors (should be no surprised, given the log output
from above):

>     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 9007 -->
>     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>                port="9007" minProcessors="5" maxProcessors="75"
>                enableLookups="true" redirectPort="8443"
>                acceptCount="10" debug="0" connectionTimeout="0"
>                useURIValidationHack="false"
> 
> protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

AJP13 connector on port 9007.

That's all: there must be more somewhere else.

So... back to the original question: what's going on?

Are the messages you are getting coming only from Safari? Can you track
the HTTP messages that are actually being sent? It's tough to tell
what's going on just from Safari error messages (which are somewhat
"friendly" and try to interpret the situation instead of telling you
exactly what happened).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1lMRgACgkQ9CaO5/Lv0PB4JQCgm1+fjsOx9RSBkeeEdiV3Kvis
BUYAmQHWluZIsa5JpwHP75eqS9RheUwY
=lJjY
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: server running website

Posted by Joel <fe...@gmail.com>.
On Wed, Feb 23, 2011 at 10:44 AM, Joel <fe...@gmail.com> wrote:

>
>
> On Tue, Feb 22, 2011 at 10:59 AM, Caldarale, Charles R <
> Chuck.Caldarale@unisys.com> wrote:
>>
>>
>> Again, it looks like something's wrong with the hosts file.  Might be as
>> simple as not having a hosts file, or not having an entry for localhost.
>>
>> Another possibility is that you may have a webapp deployed that has
>> hard-coded the original website address, and did a redirect with it - hard
>> coding like that is a very, very bad practice.
>>
>>
> So yeah it might be the later problem, where there is a hardcoded
> directory. Is there a quick way to fix this? This should be a list of all
> the files that "function2.basiceng.umr.edu" appears in
>
> sackett-research-lab2b:opt joel$ sudo find /opt/Tomcat -type f | xargs grep
> function2.basiceng.umr.edu
> grep: /opt/Tomcat/conf/server: No such file or directory
> grep: copy.xml: No such file or directory
> /opt/Tomcat/webapps/ROOT/index.jsp: <meta http-equiv="Refresh"
> content="0;url=http://function2.basiceng.umr.edu/view">
> /opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
> Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
> grep: /opt/Tomcat/webapps/view/images/folder_closed: No such file or
> directory
> grep: copy.gif: No such file or directory
> grep: /opt/Tomcat/webapps/view/Pick_: No such file or directory
> grep: CLMatrices.jsp: No such file or directory
> grep: /opt/Tomcat/webapps/view/Reading: No such file or directory
> grep: Excel.jsp: No such file or directory
> grep: /opt/Tomcat/webapps/view/searchmorph_results: No such file or
> directory
> grep: old.jsp: No such file or directory
> /opt/Tomcat/webapps/view/test.html: <a href="
> http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi">Test</a>
> /opt/Tomcat/webapps/view/test1.html: <FORM ACTION="
> http://function2.basiceng.umr.edu/tst.cgi">
> grep: /opt/Tomcat/webapps/view/Testing: No such file or directory
> grep: DB.jsp: No such file or directory
> grep: /opt/Tomcat/webapps/view/UserPick_: No such file or directory
> grep: CLMatrices.jsp: No such file or directory
> /opt/Tomcat/webapps/view2/acct_new.jsp:// "<a href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
> Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
> grep: /opt/Tomcat/webapps/view2/images/folder_closed: No such file or
> directory
> grep: copy.gif: No such file or directory
> Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class matches
> /opt/Tomcat/work/Standalone/localhost/_/index_jsp.java:
>  out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
> http://function2.basiceng.umr.edu/view\">\r\n");
> /opt/Tomcat/work/Standalone/localhost/view/acct_new_jsp.java:// "<a
> href=\"
> http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" +
> id + "\">"
> grep: copy/SESSIONS.ser: No such file or directory
>
>
>
>
>
>
> Check the logs to find out what happened when you attempted to start the
>
> server.
>
> here is what happens in catalina.out when I start, not sure which log file
> you want, though there aren't errors in any of them
>
> Feb 23, 2011 10:37:26 AM org.apache.coyote.http11.Http11Protocol destroy
> INFO: Stoping http11 protocol on 80 Catalina:type=ThreadPool,name=http80
> Feb 23, 2011 10:41:50 AM org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on port 8080
> Feb 23, 2011 10:41:50 AM org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on port 80
> Starting service Tomcat-Standalone
> Apache Tomcat/4.1.29-LE-jdk14
> Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
> <init>
> INFO: Initializing, config='org.apache.struts.util.LocalStrings',
> returnNull=true
> Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
> <init>
> INFO: Initializing, config='org.apache.struts.action.ActionResources',
> returnNull=true
> Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
> <init>
> INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources',
> returnNull=true
> Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on port 8080
> Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on port 80
> Feb 23, 2011 10:41:52 AM org.apache.jk.common.ChannelSocket init
> INFO: JK2: ajp13 listening on /0.0.0.0:9007
> Feb 23, 2011 10:41:52 AM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=1/8  config=/opt/Tomcat/conf/jk2.properties
>
>
> Is there something else already running on the ports tomcat is
> trying to use?  What does netstat list as listening ports with and
> without tomcat running?
>
>
> With tomcat:
> sackett-research-lab2b:logs joel$ netstat -a | grep LISTEN
> tcp4       0      0  localhost.8005         *.*                    LISTEN
> tcp46      0      0  *.9007                 *.*                    LISTEN
> tcp46      0      0  *.commplex-link        *.*                    LISTEN
> tcp46      0      0  *.http                 *.*                    LISTEN
> tcp46      0      0  *.http-alt             *.*                    LISTEN
> tcp4       0      0  *.kerberos             *.*                    LISTEN
> tcp6       0      0  *.kerberos             *.*                    LISTEN
> tcp46      0      0  *.vnc-server           *.*                    LISTEN
> tcp4       0      0  sackett-research.cbt   *.*                    LISTEN
> tcp4       0      0  localhost.8802         *.*                    LISTEN
> tcp4       0      0  localhost.8010         *.*                    LISTEN
> tcp4       0      0  localhost.8012         *.*                    LISTEN
> tcp4       0      0  localhost.8009         *.*                    LISTEN
> tcp4       0      0  localhost.8011         *.*                    LISTEN
> tcp4       0      0  localhost.8801         *.*                    LISTEN
> tcp46      0      0  *.jabber-server        *.*                    LISTEN
> tcp46      0      0  *.jabber-client        *.*                    LISTEN
> tcp4       0      0  sackett-research.http  *.*                    LISTEN
> tcp4       0      0  localhost.9010         *.*                    LISTEN
> tcp4       0      0  localhost.5347         *.*                    LISTEN
> tcp4       0      0  *.8087                 *.*                    LISTEN
> tcp4       0      0  *.8086                 *.*                    LISTEN
> tcp4       0      0  *.asip-webadmin        *.*                    LISTEN
> tcp4       0      0  *.62310                *.*                    LISTEN
> tcp4       0      0  localhost.62309        *.*                    LISTEN
> tcp4       0      0  *.http-alt             *.*                    LISTEN
> tcp4       0      0  *.sunwebadmin          *.*                    LISTEN
> tcp4       0      0  localhost.postgresql   *.*                    LISTEN
> tcp6       0      0  localhost.postgres     *.*                    LISTEN
> tcp6       0      0  localhost.postgres     *.*                    LISTEN
> tcp4       0      0  localhost.11211        *.*                    LISTEN
> tcp4       0      0  localhost.11611        *.*                    LISTEN
> tcp4       0      0  *.apple-sasl           *.*                    LISTEN
> tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
> tcp4       0      0  *.apple-sasl           *.*                    LISTEN
> tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
> tcp4       0      0  *.ldap                 *.*                    LISTEN
> tcp6       0      0  *.ldap                 *.*                    LISTEN
> tcp4       0      0  *.kerberos-adm         *.*                    LISTEN
> tcp4       0      0  *.ssh                  *.*                    LISTEN
> tcp6       0      0  *.ssh                  *.*                    LISTEN
> tcp4       0      0  *.netbios-ssn          *.*                    LISTEN
> tcp4       0      0  *.microsoft-ds         *.*                    LISTEN
> tcp4       0      0  *.afpovertcp           *.*                    LISTEN
> tcp6       0      0  *.afpovert             *.*                    LISTEN
> tcp4       0      0  *.dec_dlm              *.*                    LISTEN
> tcp4       0      0  localhost.ipp          *.*                    LISTEN
> tcp6       0      0  localhost.ipp          *.*                    LISTEN
>
> without:
>
> sackett-research-lab2b:bin joel$ netstat -a | grep LISTEN
> tcp4       0      0  *.kerberos             *.*                    LISTEN
> tcp6       0      0  *.kerberos             *.*                    LISTEN
> tcp46      0      0  *.vnc-server           *.*                    LISTEN
> tcp4       0      0  sackett-research.cbt   *.*                    LISTEN
> tcp4       0      0  localhost.8802         *.*                    LISTEN
> tcp4       0      0  localhost.8010         *.*                    LISTEN
> tcp4       0      0  localhost.8012         *.*                    LISTEN
> tcp4       0      0  localhost.8009         *.*                    LISTEN
> tcp4       0      0  localhost.8011         *.*                    LISTEN
> tcp4       0      0  localhost.8801         *.*                    LISTEN
> tcp46      0      0  *.jabber-server        *.*                    LISTEN
> tcp46      0      0  *.jabber-client        *.*                    LISTEN
> tcp4       0      0  sackett-research.http  *.*                    LISTEN
> tcp4       0      0  localhost.9010         *.*                    LISTEN
> tcp4       0      0  localhost.5347         *.*                    LISTEN
> tcp4       0      0  *.8087                 *.*                    LISTEN
> tcp4       0      0  *.8086                 *.*                    LISTEN
> tcp4       0      0  *.asip-webadmin        *.*                    LISTEN
> tcp4       0      0  *.62310                *.*                    LISTEN
> tcp4       0      0  localhost.62309        *.*                    LISTEN
> tcp4       0      0  *.http-alt             *.*                    LISTEN
> tcp4       0      0  *.sunwebadmin          *.*                    LISTEN
> tcp4       0      0  localhost.postgresql   *.*                    LISTEN
> tcp6       0      0  localhost.postgres     *.*                    LISTEN
> tcp6       0      0  localhost.postgres     *.*                    LISTEN
> tcp4       0      0  localhost.11211        *.*                    LISTEN
> tcp4       0      0  localhost.11611        *.*                    LISTEN
> tcp4       0      0  *.apple-sasl           *.*                    LISTEN
> tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
> tcp4       0      0  *.apple-sasl           *.*                    LISTEN
> tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
> tcp4       0      0  *.ldap                 *.*                    LISTEN
> tcp6       0      0  *.ldap                 *.*                    LISTEN
> tcp4       0      0  *.kerberos-adm         *.*                    LISTEN
> tcp4       0      0  *.ssh                  *.*                    LISTEN
> tcp6       0      0  *.ssh                  *.*                    LISTEN
> tcp4       0      0  *.netbios-ssn          *.*                    LISTEN
> tcp4       0      0  *.microsoft-ds         *.*                    LISTEN
> tcp4       0      0  *.afpovertcp           *.*                    LISTEN
> tcp6       0      0  *.afpovert             *.*                    LISTEN
> tcp4       0      0  *.dec_dlm              *.*                    LISTEN
> tcp4       0      0  localhost.ipp          *.*                    LISTEN
> tcp6       0      0  localhost.ipp          *.*                    LISTEN
>
>
>
> Also what connectors are configured in your
>
> tomcat's server.xml?
>
> Not sure how I can tell. I searched for connector in the xml and couldn't
> find anything
>
>
>
About the server.xml I must not have looked very closely, I think this is
what you want.

    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to -1 -->

    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8443" minProcessors="5" maxProcessors="75"
               enableLookups="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               useURIValidationHack="false" disableUploadTimeout="true">
      <Factory
className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
               clientAuth="false" protocol="TLS" />
    </Connector>
    -->

    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 9007 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="9007" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="0"
               useURIValidationHack="false"

protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>
    -->

    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8082" minProcessors="5" maxProcessors="75"
               enableLookups="true"
               acceptCount="100" debug="0" connectionTimeout="20000"
               proxyPort="80" useURIValidationHack="false"
               disableUploadTimeout="true" />
    -->

    <!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
    <!--
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8083" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" />
    -->

    <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
    <!--
    <Connector
className="org.apache.catalina.connector.http10.HttpConnector"
               port="8084" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" />
    -->

RE: server running website

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Joel [mailto:felixtheratruns@gmail.com] 
> Subject: Re: server running website

> So yeah it might be the later problem, where there is a 
> hardcoded directory.  Is there a quick way to fix this?

Since you're running on a very unsupported version of Tomcat, you're pretty much on your own now.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: server running website

Posted by Joel <fe...@gmail.com>.
On Tue, Feb 22, 2011 at 10:59 AM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:
>
>
> Again, it looks like something's wrong with the hosts file.  Might be as
> simple as not having a hosts file, or not having an entry for localhost.
>
> Another possibility is that you may have a webapp deployed that has
> hard-coded the original website address, and did a redirect with it - hard
> coding like that is a very, very bad practice.
>
>
So yeah it might be the later problem, where there is a hardcoded directory.
Is there a quick way to fix this? This should be a list of all the files
that "function2.basiceng.umr.edu" appears in

sackett-research-lab2b:opt joel$ sudo find /opt/Tomcat -type f | xargs grep
function2.basiceng.umr.edu
grep: /opt/Tomcat/conf/server: No such file or directory
grep: copy.xml: No such file or directory
/opt/Tomcat/webapps/ROOT/index.jsp: <meta http-equiv="Refresh"
content="0;url=http://function2.basiceng.umr.edu/view">
/opt/Tomcat/webapps/view/acct_new.jsp:// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"
Binary file /opt/Tomcat/webapps/view/css/.nobar.css.swp matches
grep: /opt/Tomcat/webapps/view/images/folder_closed: No such file or
directory
grep: copy.gif: No such file or directory
grep: /opt/Tomcat/webapps/view/Pick_: No such file or directory
grep: CLMatrices.jsp: No such file or directory
grep: /opt/Tomcat/webapps/view/Reading: No such file or directory
grep: Excel.jsp: No such file or directory
grep: /opt/Tomcat/webapps/view/searchmorph_results: No such file or
directory
grep: old.jsp: No such file or directory
/opt/Tomcat/webapps/view/test.html: <a href="
http://function2.basiceng.umr.edu:8080/view/cgi-bin/test.cgi">Test</a>
/opt/Tomcat/webapps/view/test1.html: <FORM ACTION="
http://function2.basiceng.umr.edu/tst.cgi">
grep: /opt/Tomcat/webapps/view/Testing: No such file or directory
grep: DB.jsp: No such file or directory
grep: /opt/Tomcat/webapps/view/UserPick_: No such file or directory
grep: CLMatrices.jsp: No such file or directory
/opt/Tomcat/webapps/view2/acct_new.jsp:// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"
Binary file /opt/Tomcat/webapps/view2/css/.nobar.css.swp matches
grep: /opt/Tomcat/webapps/view2/images/folder_closed: No such file or
directory
grep: copy.gif: No such file or directory
Binary file /opt/Tomcat/work/Standalone/localhost/_/index_jsp.class matches
/opt/Tomcat/work/Standalone/localhost/_/index_jsp.java:
 out.write("<meta http-equiv=\"Refresh\" content=\"0;url=
http://function2.basiceng.umr.edu/view\">\r\n");
/opt/Tomcat/work/Standalone/localhost/view/acct_new_jsp.java:// "<a href=\"
http://function2.basiceng.umr.edu:8080/view/Accounting/confirm.jsp?id=" + id
+ "\">"
grep: copy/SESSIONS.ser: No such file or directory






Check the logs to find out what happened when you attempted to start the

server.

here is what happens in catalina.out when I start, not sure which log file
you want, though there aren't errors in any of them

Feb 23, 2011 10:37:26 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stoping http11 protocol on 80 Catalina:type=ThreadPool,name=http80
Feb 23, 2011 10:41:50 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Feb 23, 2011 10:41:50 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 80
Starting service Tomcat-Standalone
Apache Tomcat/4.1.29-LE-jdk14
Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
Feb 23, 2011 10:41:51 AM org.apache.struts.util.PropertyMessageResources
<init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources',
returnNull=true
Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Feb 23, 2011 10:41:52 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 80
Feb 23, 2011 10:41:52 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:9007
Feb 23, 2011 10:41:52 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/8  config=/opt/Tomcat/conf/jk2.properties


Is there something else already running on the ports tomcat is
trying to use?  What does netstat list as listening ports with and
without tomcat running?


With tomcat:
sackett-research-lab2b:logs joel$ netstat -a | grep LISTEN
tcp4       0      0  localhost.8005         *.*                    LISTEN
tcp46      0      0  *.9007                 *.*                    LISTEN
tcp46      0      0  *.commplex-link        *.*                    LISTEN
tcp46      0      0  *.http                 *.*                    LISTEN
tcp46      0      0  *.http-alt             *.*                    LISTEN
tcp4       0      0  *.kerberos             *.*                    LISTEN
tcp6       0      0  *.kerberos             *.*                    LISTEN
tcp46      0      0  *.vnc-server           *.*                    LISTEN
tcp4       0      0  sackett-research.cbt   *.*                    LISTEN
tcp4       0      0  localhost.8802         *.*                    LISTEN
tcp4       0      0  localhost.8010         *.*                    LISTEN
tcp4       0      0  localhost.8012         *.*                    LISTEN
tcp4       0      0  localhost.8009         *.*                    LISTEN
tcp4       0      0  localhost.8011         *.*                    LISTEN
tcp4       0      0  localhost.8801         *.*                    LISTEN
tcp46      0      0  *.jabber-server        *.*                    LISTEN
tcp46      0      0  *.jabber-client        *.*                    LISTEN
tcp4       0      0  sackett-research.http  *.*                    LISTEN
tcp4       0      0  localhost.9010         *.*                    LISTEN
tcp4       0      0  localhost.5347         *.*                    LISTEN
tcp4       0      0  *.8087                 *.*                    LISTEN
tcp4       0      0  *.8086                 *.*                    LISTEN
tcp4       0      0  *.asip-webadmin        *.*                    LISTEN
tcp4       0      0  *.62310                *.*                    LISTEN
tcp4       0      0  localhost.62309        *.*                    LISTEN
tcp4       0      0  *.http-alt             *.*                    LISTEN
tcp4       0      0  *.sunwebadmin          *.*                    LISTEN
tcp4       0      0  localhost.postgresql   *.*                    LISTEN
tcp6       0      0  localhost.postgres     *.*                    LISTEN
tcp6       0      0  localhost.postgres     *.*                    LISTEN
tcp4       0      0  localhost.11211        *.*                    LISTEN
tcp4       0      0  localhost.11611        *.*                    LISTEN
tcp4       0      0  *.apple-sasl           *.*                    LISTEN
tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
tcp4       0      0  *.apple-sasl           *.*                    LISTEN
tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
tcp4       0      0  *.ldap                 *.*                    LISTEN
tcp6       0      0  *.ldap                 *.*                    LISTEN
tcp4       0      0  *.kerberos-adm         *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
tcp6       0      0  *.ssh                  *.*                    LISTEN
tcp4       0      0  *.netbios-ssn          *.*                    LISTEN
tcp4       0      0  *.microsoft-ds         *.*                    LISTEN
tcp4       0      0  *.afpovertcp           *.*                    LISTEN
tcp6       0      0  *.afpovert             *.*                    LISTEN
tcp4       0      0  *.dec_dlm              *.*                    LISTEN
tcp4       0      0  localhost.ipp          *.*                    LISTEN
tcp6       0      0  localhost.ipp          *.*                    LISTEN

without:

sackett-research-lab2b:bin joel$ netstat -a | grep LISTEN
tcp4       0      0  *.kerberos             *.*                    LISTEN
tcp6       0      0  *.kerberos             *.*                    LISTEN
tcp46      0      0  *.vnc-server           *.*                    LISTEN
tcp4       0      0  sackett-research.cbt   *.*                    LISTEN
tcp4       0      0  localhost.8802         *.*                    LISTEN
tcp4       0      0  localhost.8010         *.*                    LISTEN
tcp4       0      0  localhost.8012         *.*                    LISTEN
tcp4       0      0  localhost.8009         *.*                    LISTEN
tcp4       0      0  localhost.8011         *.*                    LISTEN
tcp4       0      0  localhost.8801         *.*                    LISTEN
tcp46      0      0  *.jabber-server        *.*                    LISTEN
tcp46      0      0  *.jabber-client        *.*                    LISTEN
tcp4       0      0  sackett-research.http  *.*                    LISTEN
tcp4       0      0  localhost.9010         *.*                    LISTEN
tcp4       0      0  localhost.5347         *.*                    LISTEN
tcp4       0      0  *.8087                 *.*                    LISTEN
tcp4       0      0  *.8086                 *.*                    LISTEN
tcp4       0      0  *.asip-webadmin        *.*                    LISTEN
tcp4       0      0  *.62310                *.*                    LISTEN
tcp4       0      0  localhost.62309        *.*                    LISTEN
tcp4       0      0  *.http-alt             *.*                    LISTEN
tcp4       0      0  *.sunwebadmin          *.*                    LISTEN
tcp4       0      0  localhost.postgresql   *.*                    LISTEN
tcp6       0      0  localhost.postgres     *.*                    LISTEN
tcp6       0      0  localhost.postgres     *.*                    LISTEN
tcp4       0      0  localhost.11211        *.*                    LISTEN
tcp4       0      0  localhost.11611        *.*                    LISTEN
tcp4       0      0  *.apple-sasl           *.*                    LISTEN
tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
tcp4       0      0  *.apple-sasl           *.*                    LISTEN
tcp4       0      0  *.3com-tsmux           *.*                    LISTEN
tcp4       0      0  *.ldap                 *.*                    LISTEN
tcp6       0      0  *.ldap                 *.*                    LISTEN
tcp4       0      0  *.kerberos-adm         *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
tcp6       0      0  *.ssh                  *.*                    LISTEN
tcp4       0      0  *.netbios-ssn          *.*                    LISTEN
tcp4       0      0  *.microsoft-ds         *.*                    LISTEN
tcp4       0      0  *.afpovertcp           *.*                    LISTEN
tcp6       0      0  *.afpovert             *.*                    LISTEN
tcp4       0      0  *.dec_dlm              *.*                    LISTEN
tcp4       0      0  localhost.ipp          *.*                    LISTEN
tcp6       0      0  localhost.ipp          *.*                    LISTEN



Also what connectors are configured in your

tomcat's server.xml?

Not sure how I can tell. I searched for connector in the xml and couldn't
find anything

RE: server running website

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Joel [mailto:felixtheratruns@gmail.com] 
> Subject: server running website

> But when I try to go to the page "localhost:8080" or "localhost:80"
> Safari says:
> "Safari can't open the page "http://function2.basiceng.umr.edu/view" because
> Safari can't find the server "function2.basiceng.umr.edu"."

Looks like something is seriously askew in your hosts file.  The localhost id should always be mapped to 127.0.0.1, not some external DNS name.

> When I don't run the server as sudo I get things like
> Safari can't open the page "http://www.localhost.com:80/" because the server
> unexpectedly dropped the connection. This sometimes occurs when the server
> is busy. Wait for a few minutes, and then try again.

Again, it looks like something's wrong with the hosts file.  Might be as simple as not having a hosts file, or not having an entry for localhost.

Another possibility is that you may have a webapp deployed that has hard-coded the original website address, and did a redirect with it - hard coding like that is a very, very bad practice.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org