[Apache/Tomcat] redirect hostname to webapp

Pagina: 1
Acties:

  • Feyd-Rautha
  • Registratie: November 2001
  • Laatst online: 02-08-2025
Momenteel heb ik de volgende configuratie geinstalleerd op mijn pc:

Op mijn Tomcat servlet-container heb ik een webapplicatie gedeployed, nl: "app1"
Via mod_jk forward ik alle requests voor "app1" van Apache naar mijn Tomcat Servlet-container.

mod_jk.conf
JkWorkersFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/workers.properties"
JkShmFile "C:/Program Files/Apache Software Foundation/Apache2.2/mod_jk.shm
JkLogFile "C:/Program Files/Apache Software Foundation/Apache2.2/logs/mod_jk.log"
JkLogLevel debug
JkMount /app1 tomcat_socrates
JkMount /app1/* tomcat_socrates
Dus, mijn web-applicatie is toegankelijk via http://<ip-adres>/app1

Intussen heb ik ook een (gratis domain-naam aangevraagd: app1.dyndns.org.

Heb probleem is dat ik nu steeds naar http://app1.dyndns.org/app1 moet gaan om mijn webapplicatie te starten. Dat is ook logisch.
Hetgeen ik nu zou willen is dat ik via http://app1.dyndns.org mijn webapplicatie kan starten (als dit mogelijk is tenminste).

Kan mij iemand helpen om apache en/of tomcat correct te configureren. :)

I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. Where the fear has gone there will be nothing. Only I will remain.


  • AlterMann
  • Registratie: December 2000
  • Laatst online: 31-01 23:39
Werkt het niet als je een Name-based Virtual Host aanmaakt met als hostname app1.dyndns.org die verwijst naar /app1? :)

  • BHR
  • Registratie: Februari 2002
  • Laatst online: 30-01 18:33

BHR

Een andere mogelijkheid is om
code:
1
DocumentIndex app1/
op te nemen in je apache config.

Je tomcat applicatie ziet dit eerste request als omgeving dan wel http://app1.dyn-dns.org/ in plaats van http://app1.dyn-dns.org/app1/, even uitproberen of je app ermee overweg kan.


Andere mogelijkheden zijn mod_rewrite of een redirect.php of redirect.html bestand met respectivelijk een header("Location....") of <meta refresh>


PS. Virtuele hosts met een eigen DocumentRoot aanmaken is de mooiste oplossing :).

[ Voor 10% gewijzigd door BHR op 19-05-2009 12:52 ]

No amount of key presses will shut off the Random Bug Generator


  • Equator
  • Registratie: April 2001
  • Laatst online: 21:58

Equator

Crew Council

#whisky #barista


  • Feyd-Rautha
  • Registratie: November 2001
  • Laatst online: 02-08-2025
Ik ga dit zo snel mogelijk eens uitproberen.

Intussen heb ik de Apache webserver ook weggelaten en rechtstreeks tomcat gebruikt als webserver. Maar ik vermoed dat de oplossing voor tomcat equivalent is met de voorgestelde oplossingen hierboven.

I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. Where the fear has gone there will be nothing. Only I will remain.