Apache 2 met Glassfish 3.1.1

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • JordyOnrust
  • Registratie: November 2007
  • Laatst online: 10-07 13:02

JordyOnrust

Leef om te leven.

Topicstarter
Ik probeer Glassfish werkende te krijgen met Apache middels Jk_mod.
Verschillende tutorials vertellen mij precies wat ik moet doen, maar helaas wil het niet lukken.
Eén van de tutorials die ik heb gevolgd kun je hier vinden: Tutorial

Wat heb ik tot nu toe:

workers.properties
#Worker 1
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300


In conf.d/jk
# Where to find workers.properties
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Locattion of shm file
JkShmFile /etc/apache2/jk/jk.shm


In de VirtualHost file
<VirtualHost *:80>
        ServerAdmin jordy@jonrust.nl
        ServerName jsp.jonrust.nl

        JkMount /* worker1

</VirtualHost>


Vervolgens voer ik het volgende commando uit om een listener te maken.
asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server jk-connector
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.jk-connector.jk-enabled=true


Deze zie ik vervolgens ook verschijnen als ik inlog middels <host>:4848
Hier heb ik ook een simpele war gedeployed.
Wanneer ik via de browser de standaard http listener wil benaderen, middels <host>:8080, krijg ik netjes mijn mooie Hello World output te zien.

Vervolgens wil ik jsp.<host> uitvoeren, krijg ik netjes een lege pagina.
Wanneer ik de log kijk zie ik het volgende:
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI '/' from 1 maps
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] find_match::jk_uri_worker_map.c (850): Attempting to map context URI '/*=worker1' source 'JkMount'
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] find_match::jk_uri_worker_map.c (863): Found a wildchar match '/*=worker1'
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] jk_handler::mod_jk.c (2459): Into handler jakarta-servlet worker=worker1 r->proxyreq=0
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] wc_get_worker_for_name::jk_worker.c (116): found a worker worker1
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] wc_maintain::jk_worker.c (339): Maintaining worker worker1
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_maintain::jk_ajp_common.c (3081): reached pool min size 5 from 10 cache slots
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] init_ws_service::mod_jk.c (977): Service protocol=HTTP/1.1 method=GET ssl=false host=(null) addr=94.212.103.53 name=jsp.jonrust.nl port=80 auth=(null) user=(null) laddr=192.168.178.100 raddr=94.212.103.53 uri=/
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_get_endpoint::jk_ajp_common.c (2977): acquired connection pool slot=0 after 0 retries
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (605): ajp marshaling done
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_service::jk_ajp_common.c (2283): processing worker1 with 2 retries
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): sending to ajp13 pos=4 len=492 max=8192
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0000    12 34 01 E8 02 02 00 08 48 54 54 50 2F 31 2E 31  - .4......HTTP/1.1
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0010    00 00 01 2F 00 00 0D 39 34 2E 32 31 32 2E 31 30  - .../...94.212.10
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0020    33 2E 35 33 00 FF FF 00 0E 6A 73 70 2E 6A 6F 6E  - 3.53.....jsp.jon
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0030    72 75 73 74 2E 6E 6C 00 00 50 00 00 08 A0 0B 00  - rust.nl..P......
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0040    0E 6A 73 70 2E 6A 6F 6E 72 75 73 74 2E 6E 6C 00  - .jsp.jonrust.nl.
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0050    A0 0E 00 4C 4D 6F 7A 69 6C 6C 61 2F 35 2E 30 20  - ...LMozilla/5.0.
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0060    28 57 69 6E 64 6F 77 73 20 4E 54 20 36 2E 31 3B  - (Windows.NT.6.1;
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0070    20 57 4F 57 36 34 3B 20 72 76 3A 31 30 2E 30 2E  - .WOW64;.rv:10.0.
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0080    31 29 20 47 65 63 6B 6F 2F 32 30 31 30 30 31 30  - 1).Gecko/2010010
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0090    31 20 46 69 72 65 66 6F 78 2F 31 30 2E 30 2E 31  - 1.Firefox/10.0.1
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00a0    00 A0 01 00 3F 74 65 78 74 2F 68 74 6D 6C 2C 61  - ....?text/html,a
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00b0    70 70 6C 69 63 61 74 69 6F 6E 2F 78 68 74 6D 6C  - pplication/xhtml
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00c0    2B 78 6D 6C 2C 61 70 70 6C 69 63 61 74 69 6F 6E  - +xml,application
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00d0    2F 78 6D 6C 3B 71 3D 30 2E 39 2C 2A 2F 2A 3B 71  - /xml;q=0.9,*/*;q
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00e0    3D 30 2E 38 00 00 0F 41 63 63 65 70 74 2D 4C 61  - =0.8...Accept-La
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 00f0    6E 67 75 61 67 65 00 00 17 6E 6C 2C 65 6E 2D 75  - nguage...nl,en-u
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0100    73 3B 71 3D 30 2E 37 2C 65 6E 3B 71 3D 30 2E 33  - s;q=0.7,en;q=0.3
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0110    00 00 0F 41 63 63 65 70 74 2D 45 6E 63 6F 64 69  - ...Accept-Encodi
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0120    6E 67 00 00 0D 67 7A 69 70 2C 20 64 65 66 6C 61  - ng...gzip,.defla
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0130    74 65 00 A0 06 00 0A 6B 65 65 70 2D 61 6C 69 76  - te.....keep-aliv
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0140    65 00 A0 09 00 9E 5F 5F 75 74 6D 61 3D 31 32 30  - e.....__utma=120
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0150    35 39 39 30 35 39 2E 37 33 37 34 30 34 35 33 31  - 599059.737404531
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0160    2E 31 33 32 39 31 37 32 37 35 39 2E 31 33 32 39  - .1329172759.1329
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0170    31 37 36 35 36 36 2E 31 33 32 39 31 38 31 34 39  - 176566.132918149
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0180    37 2E 33 3B 20 5F 5F 75 74 6D 63 3D 31 32 30 35  - 7.3;.__utmc=1205
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 0190    39 39 30 35 39 3B 20 5F 5F 75 74 6D 7A 3D 31 32  - 99059;.__utmz=12
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 01a0    30 35 39 39 30 35 39 2E 31 33 32 39 31 37 32 37  - 0599059.13291727
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 01b0    35 39 2E 31 2E 31 2E 75 74 6D 63 73 72 3D 28 64  - 59.1.1.utmcsr=(d
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 01c0    69 72 65 63 74 29 7C 75 74 6D 63 63 6E 3D 28 64  - irect)|utmccn=(d
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 01d0    69 72 65 63 74 29 7C 75 74 6D 63 6D 64 3D 28 6E  - irect)|utmcmd=(n
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1070): 01e0    6F 6E 65 29 00 A0 08 00 01 30 00 FF 00 00 00 00  - one).....0......
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_send_request::jk_ajp_common.c (1549): (worker1) Statistics about invalid connections: connect check (0), cping (0), send (0)
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_send_request::jk_ajp_common.c (1560): (worker1) request body to send 0 - request body to resend 0
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): received from ajp13 pos=0 len=50 max=8192
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): 0000    04 01 90 00 2A 4E 6F 20 48 6F 73 74 20 6D 61 74  - ....*No.Host.mat
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): 0010    63 68 65 73 20 73 65 72 76 65 72 20 6E 61 6D 65  - ches.server.name
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): 0020    20 6A 73 70 2E 6A 6F 6E 72 75 73 74 2E 6E 6C 00  - .jsp.jonrust.nl.
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): 0030    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  - ................
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_unmarshal_response::jk_ajp_common.c (660): status = 400
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_unmarshal_response::jk_ajp_common.c (667): Number of headers is = 0
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): received from ajp13 pos=0 len=2 max=8192
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1259): 0000    05 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  - ................
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_process_callback::jk_ajp_common.c (1846): AJP13 protocol: Reuse is OK
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_reset_endpoint::jk_ajp_common.c (743): (worker1) resetting endpoint with sd = 15
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] ajp_done::jk_ajp_common.c (2905): recycling connection pool slot=0 for worker worker1
[Tue Feb 14 02:41:23 2012] worker1 jsp.jonrust.nl 0.001561
[Tue Feb 14 02:41:23 2012] [11671:1841911616] [debug] jk_handler::mod_jk.c (2599): Service finished with status=400 for worker=worker1


Wat doe ik nu fout?

Als je sterft voordat je sterft, sterf je niet wanneer je sterft. Rom 6:5


Acties:
  • 0 Henk 'm!

  • Equator
  • Registratie: April 2001
  • Laatst online: 09-09 15:29

Equator

Crew Council

#whisky #barista

....*No.Host.mat
- ches.server.name
- .jsp.jonrust.nl.
Heb je, op je host zelf een correcte host entry toegevoegd in /etc/hosts voor de fqdn jsp.jonrust.nl? Oftewel, als jij vanaf je server pingt naar deze host, krijg je dan reply van je server?

Acties:
  • 0 Henk 'm!

  • JordyOnrust
  • Registratie: November 2007
  • Laatst online: 10-07 13:02

JordyOnrust

Leef om te leven.

Topicstarter
Ik heb niks toegevoegd aan /etc/hosts. Dit heb ik ook nergens gelezen.
Wat moet hier komen te staan?

Dit is wat er nu staat.
127.0.0.1       localhost
127.0.1.1       bright-server

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Ik kan overigens wel pingen naar deze host, zowel vanaf mijn client als vanaf mijn server.

Dit krijg ik trouwens wel als ik apache reload. Heb me er nooit druk om gemaakt, omdat het altijd prima werkte.

 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

[ Voor 28% gewijzigd door JordyOnrust op 14-02-2012 11:25 . Reden: Toevoeging over melding Apache ]

Als je sterft voordat je sterft, sterf je niet wanneer je sterft. Rom 6:5


Acties:
  • 0 Henk 'm!

  • Equator
  • Registratie: April 2001
  • Laatst online: 09-09 15:29

Equator

Crew Council

#whisky #barista

Voeg onderstaande regel toe aan je /etc/hosts (onder de 127.0.0.1 regels)

192.168.1.40          jsp.jonrust.nl

Maar dan wel het correcte IP adres gebruiken.

En doe dan eens een apache restart :)

Acties:
  • 0 Henk 'm!

  • JordyOnrust
  • Registratie: November 2007
  • Laatst online: 10-07 13:02

JordyOnrust

Leef om te leven.

Topicstarter
Helaas, maar dit geeft geen uitkomst.
Heb 192.18.178.100 gebruikt als IP, dit is het IP dat mijn server van de modem krijgt.
Maar krijg nog steeds mooie een lege pagina te zien.

Is mijn site-file wel ok?
<VirtualHost *:80>
        ServerAdmin jordy@jonrust.nl
        ServerName jsp.jonrust.nl

        JkMount /* worker1

</VirtualHost>


Is er ook een andere manier? Kan ik ook gewoon gebruik maken van de 8080 poort? Dat ik middels apache via poort 80 binnen komt en dat apache bij bepaalde vitual hosts dit door stuurt naar poort 8080 van glassfish?

Ik wil namelijk apache graag behouden, omdat ik hier meerder php projecten op heb draaien.
Maar naast deze php projecten wil ik ook graag een project hosten die gebruik maakt van JSP en servlets.

Als je sterft voordat je sterft, sterf je niet wanneer je sterft. Rom 6:5


Acties:
  • 0 Henk 'm!

  • Equator
  • Registratie: April 2001
  • Laatst online: 09-09 15:29

Equator

Crew Council

#whisky #barista

Maar komt apache nu nog steeds met die melding ? (Could not reliably determine the server's fully qualified domain name)

EN komt die eerder melding
....*No.Host.mat
- ches.server.name
- .jsp.jonrust.nl.
Nog voor in de logging?

Acties:
  • 0 Henk 'm!

  • JordyOnrust
  • Registratie: November 2007
  • Laatst online: 10-07 13:02

JordyOnrust

Leef om te leven.

Topicstarter
Ja krijg nog steeds de zelfde meldingen.
Inmiddels heb ik het anders opgelost.

<VirtualHost *:80>
        ServerAdmin jordy@jonrust.nl
        ServerName jsp.jonrust.nl

        ProxyRequests Off
        ProxyPreserveHost On

        <Proxy *>
                 Order deny,allow
                 Allow from all
        </Proxy>

        ProxyPass / http://192.168.178.100:8080/
        ProxyPassReverse / http://192.168.178.100:8080/

        <Location />
                 Order allow,deny
                 Allow from all
        </Location>

</VirtualHost>

Als je sterft voordat je sterft, sterf je niet wanneer je sterft. Rom 6:5

Pagina: 1