Thanks for your help and patience, John. Before even reading through your
whole email I looked at the sample mod_jk.conf and it game me an idea. In
my servers.xml, in the <Host name=... line I just changed the name from
localhost to my hostname. Now it seems to work! I can access it from other
machines with the hostname or IP Address!
I am seeing some strange behavior when trying to access it from a browser
running on the web server, but that doesn't concern me too much.
After getting it to work as noted, I took a closer look at your email.
NameVirtualHost * is commented out in my httpd.conf. I'm going to leave it
as is for now, but maybe I'll play around with this more later. I just want
to get the darn thing working the way it was under the older versoins of
Apache/Tomcat, then I'll tweak things and try to understand it better.
Thanks again John
-----Original Message-----
From: John Turner [mailto:tomcat-user@johnturner.com]
Sent: Wednesday, May 14, 2003 16:44
To: Tomcat Users List
Subject: Re: Newbie: IP Address not working, localhost okay
Sample mod_jk.conf:
http://www.johnturner.com/howto/mod_jk_conf.html
I posted this yesterday in response to someone else. This is for a virtual
host other than localhost:
In httpd.conf:
NameVirtualHost *
In Tomcat's server.xml:
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Engine name="Standalone" defaultHost="localhost" debug="0">
<Host name="your.host.com" debug="1" appBase="webapps" unpackWARs="true"
autoDeploy="true">
In mod_jk.conf (or httpd.conf):
<IfModule !mod_jk.c>
LoadModule jk_module /usr/local/apache2/modules/mod_jk.so
</IfModule>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
<VirtualHost *>
ServerName your.host.com
DocumentRoot /some/path/to/tomcat/webapps/yourApp
# Static files
Alias /yourApp "/some/path/to/tomcat/webapps/yourApp"
<Directory "/some/path/to/tomcat/webapps/yourApp">
Options Indexes FollowSymLinks
DirectoryIndex index.jsp
</Directory>
<Location "/yourApp/WEB-INF/*">
AllowOverride None
deny from all
</Location>
<Location "/yourApp/META-INF/*">
AllowOverride None
deny from all
</Location>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
</VirtualHost>
Repeat server.xml Host container and httpd.conf VirtualHost container for
every virtual host desired.
HTH
John
On Wed, 14 May 2003 16:27:14 -0400, Galuza, Mike <MGaluza@dejarnette.com>
wrote:
> My host name is in the DNS (at least I assume it is since I can ping my
> host
> name from other machines and my host name isn't in their hosts file).
> Still
> doesn't work. Added it to the hosts file as well, still doesn't work.
>
> I'm starting to get really frustrated because this all worked great under
> Apache 1.3 and Tomcat 3.3 (with no special setup). I decided to upgrade
> and
> the configuration has been very slow going so far.
>
> Any other suggestions? Does anyone have a sample mod_jk.conf that works
> with a host name or IP address in place of localhost so that I can
> compare
> it to mine?
>
> I'm about ready to give up and go back to the old versions.
>
> Thanks
>
>
> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com]
> Sent: Wednesday, May 14, 2003 15:07
> To: Tomcat Users List
> Subject: Re: Newbie: IP Address not working, localhost okay
>
>
>
> Well, you can't just setup a name and have it translate to an IP address.
>
> Did you setup a hosts file or local DNS server to translate myhostname to
> the IP address? How does your workstation or client know that myhostname
> = IP address?
>
> Other than that, I'm not sure what to tell you. I can tell you that
> hostnames other than localhost certainly work, but I can't confirm that
> IP addresses in place of hostnames will work with mod_jk, as I've never
> set it up that way.
>
> John
>
> On Wed, 14 May 2003 14:00:35 -0400, Galuza, Mike <MGaluza@dejarnette.com>
> wrote:
>
>> This doesn't seem to be working. Here's what I did:
>>
>> I added the following line in the place you suggested:
>> <Alias>xxx.xxx.xxx.xxx</Alias>
>>
>> then restarted Tomcat. The new mod_jk.conf had the following new line
>> in
>> it, just under ServerName localhost
>> ServerAlias xxx.xxx.xxx.xxx
>>
>> Nothing else changed in the mod_jk.conf file.
>>
>> I then restarted Apache. I can reach http://localhost,
>> http://xxx.xxx.xxx.xxx, and http://localhost/examples/jsp/index.html,
>> but I
>> cannot reach http://xxx.xxx.xxx.xxx/examples/jsp/index.html. Since you
>> said
>> something about using names vs. using IP Addresses, I changed the Alias
>> line
>> to
>> <Alias>myhostname</Alias>, but got the same results.
>>
>> Any other suggestions?
>>
>> Thanks
>>
>> -----Original Message-----
>> From: John Turner [mailto:tomcat-user@johnturner.com]
>> Sent: Wednesday, May 14, 2003 12:15
>> To: Tomcat Users List
>> Subject: Re: Newbie: IP Address not working, localhost okay
>>
>>
>>
>> If you are using the auto-config, add the Alias to server.xml and do a
>> restart, then check your mod_jk.conf file to make sure there is an entry
>> in there for the IP address, like a ServerName entry, or a ServerAlias
>> entry. I only use names (DNS), so I am not sure what the behavior will
>> be for IP addresses.
>>
>> My point about the Apache side is that you have to make sure that BOTH
>> Apache and Tomcat "know" about the new host header name. So, you either
>> have to set Apache up so that if it can't find a virtual host definition
>> for your IP address it fails back to a default, or that it has a virtual
>> host definition for your IP address.
>>
>> That's what the auto-config does. With it, you only need to update
>> Tomcat with the new virtual host, and the Apache stuff should be
>> generated for you. Otherwise, you will have to set up the virtual host
>> in both places manually.
>>
>> John
>>
>> On Wed, 14 May 2003 11:52:23 -0400, Galuza, Mike
>> <MGaluza@dejarnette.com> wrote:
>>
>>> Ha! John Turner! I used your instructions (posted on the internet) to
>>> get
>>> my stuff set up. Thanks!
>>>
>>> Are you saying I need to set up an alias in server.xml AND a JkMount in
>>> Apache? If so, I'm not sure how to set up the JkMount. It looks like
>>> the
>>> JkMount goes in my mod_jk.conf, but that is being automatically
>>> generated
>>> for me (as suggested in your instructions). So do I need to turn off
>>> the
>>> auto-config to get this working? Or is there a way to do it WITH
>>> auto-config.
>>>
>>> Thanks
>>>
>>> -----Original Message-----
>>> From: John Turner [mailto:tomcat-user@johnturner.com]
>>> Sent: Wednesday, May 14, 2003 11:41
>>> To: Tomcat Users List
>>> Subject: Re: Newbie: IP Address not working, localhost okay
>>>
>>>
>>>
>>> Probably the easiest thing to do, on the Tomcat side, is add
>>> <Alias>your.IP.address.here</Alias> to server.xml just under the
line
>>> that says <Host name="localhost"> and then restart Tomcat.
>>>
>>> On the Apache side, you'll need to configure the virtual host correctly
>>> so that there is a valid JkMount for requests using that IP address.
>>>
>>> John
>>>
>>> On Wed, 14 May 2003 11:29:08 -0400, Galuza, Mike
>>> <MGaluza@dejarnette.com> wrote:
>>>
>>>> I apologize if this question has been asked, but my searches of the
>>>> archives
>>>> were either ridiculously slow or gave me server errors.
>>>>
>>>> I've configured Apache 2.0.44 and Tomcat 4.1.24 and mod_jk on Windows
>>>> 2000.
>>>> I've got
>>>> them all talking so that I can access
>>>> http://localhost/examples/jsp/index.html. But when I replace
>>>> localhost with the IP address of the machine the browser reports that
>>>> it can't find the page. The Apache error log shows that it is looking
>>>> for examples in its DocumentRoot.
>>>>
>>>> Suggestions? From the info I've been able to find, it appears this
>>>> has something to do with setting up virtual hosts or perhaps a host
>>>> alias. I'm sure there is a relatively simple solution, but of course
>>>> I can't find any simple documentation on it.
>>>>
>>>> Any help would be greatly appreciated.
>>>>
>>>> Regards
>>>> Mike
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
|