Apache2/glassfish|tomcat: Redirecting some (but not all) requests on 80 to glassfish on port 8080, where is the admin screen? The 2019 Stack Overflow Developer Survey Results Are InHow to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80Tomcat cookies not working via my ProxyPass VirtualHostRunning Tomcat on an Apache Alias Or Map Port numbers to HostnamesHow to configure mod_proxy to ProxyPass based on http vs https?How can I set up port forwarding for GlassFish on Windows Server 2008 and IIS7?Apache2 proxypassreverse directive appending virtualhost port?How to Configure Apache mod_proxy to proxy Glassfish 4.1 on Fedora 21?Basic auth Apache with TomcatHide Original URL using mod_proxyHow to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcatGlassFish DAS cannot be accessed after enable secure admin

How do you keep chess fun when your opponent constantly beats you?

What do these terms in Caesar's Gallic wars mean?

What's the name of these plastic connectors

Old scifi movie from the 50s or 60s with men in solid red uniforms who interrogate a spy from the past

What is the meaning of Triage in Cybersec world?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

What is this business jet?

Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?

Cooking pasta in a water boiler

"as much details as you can remember"

What information about me do stores get via my credit card?

ODD NUMBER in Cognitive Linguistics of WILLIAM CROFT and D. ALAN CRUSE

Match Roman Numerals

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

How to obtain a position of last non-zero element

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Pokemon Turn Based battle (Python)

How to type this arrow in math mode?

Is it possible for absolutely everyone to attain enlightenment?

Why doesn't UInt have a toDouble()?

How to type a long/em dash `—`

The phrase "to the numbers born"?

Can there be female White Walkers?

Kerning for subscripts of sigma?



Apache2/glassfish|tomcat: Redirecting some (but not all) requests on 80 to glassfish on port 8080, where is the admin screen?



The 2019 Stack Overflow Developer Survey Results Are InHow to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80Tomcat cookies not working via my ProxyPass VirtualHostRunning Tomcat on an Apache Alias Or Map Port numbers to HostnamesHow to configure mod_proxy to ProxyPass based on http vs https?How can I set up port forwarding for GlassFish on Windows Server 2008 and IIS7?Apache2 proxypassreverse directive appending virtualhost port?How to Configure Apache mod_proxy to proxy Glassfish 4.1 on Fedora 21?Basic auth Apache with TomcatHide Original URL using mod_proxyHow to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcatGlassFish DAS cannot be accessed after enable secure admin



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Using that answer: How to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80



I've configured my apache2 server to redirect some requests to glassfish on 8080:



<VirtualHost *:80>
(...)
ProxyPass /tomcat/ http://localhost:8080/
ProxyPassReverse /tomcat/ http://localhost:8080/
ProxyPass /tomcat-admin/ http://localhost:4848/
ProxyPassReverse /tomcat-admin/ http://localhost:4848/
</VirtualHost>


On http://my.server.org/tomcat/ , I can clearly see:



 GlassFish Server 3.1.2
Your server is now running


but http://my.server.org/tomcat-admin/ returns a blank screen , but I can see the HTML source of the admin page, so I suppose that some resources cannot be loaded. How should I fix this ?



Another question: if my java web application use httpS, should I just add:



ProxyPass /tomcat-secure/ http://localhost:8443/
ProxyPassReverse /tomcat-secure/ http://localhost:8443/
</VirtualHost>


?










share|improve this question
























  • What do your apache logs say?

    – ProfessionalAmateur
    Jan 9 '13 at 18:17

















1















Using that answer: How to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80



I've configured my apache2 server to redirect some requests to glassfish on 8080:



<VirtualHost *:80>
(...)
ProxyPass /tomcat/ http://localhost:8080/
ProxyPassReverse /tomcat/ http://localhost:8080/
ProxyPass /tomcat-admin/ http://localhost:4848/
ProxyPassReverse /tomcat-admin/ http://localhost:4848/
</VirtualHost>


On http://my.server.org/tomcat/ , I can clearly see:



 GlassFish Server 3.1.2
Your server is now running


but http://my.server.org/tomcat-admin/ returns a blank screen , but I can see the HTML source of the admin page, so I suppose that some resources cannot be loaded. How should I fix this ?



Another question: if my java web application use httpS, should I just add:



ProxyPass /tomcat-secure/ http://localhost:8443/
ProxyPassReverse /tomcat-secure/ http://localhost:8443/
</VirtualHost>


?










share|improve this question
























  • What do your apache logs say?

    – ProfessionalAmateur
    Jan 9 '13 at 18:17













1












1








1








Using that answer: How to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80



I've configured my apache2 server to redirect some requests to glassfish on 8080:



<VirtualHost *:80>
(...)
ProxyPass /tomcat/ http://localhost:8080/
ProxyPassReverse /tomcat/ http://localhost:8080/
ProxyPass /tomcat-admin/ http://localhost:4848/
ProxyPassReverse /tomcat-admin/ http://localhost:4848/
</VirtualHost>


On http://my.server.org/tomcat/ , I can clearly see:



 GlassFish Server 3.1.2
Your server is now running


but http://my.server.org/tomcat-admin/ returns a blank screen , but I can see the HTML source of the admin page, so I suppose that some resources cannot be loaded. How should I fix this ?



Another question: if my java web application use httpS, should I just add:



ProxyPass /tomcat-secure/ http://localhost:8443/
ProxyPassReverse /tomcat-secure/ http://localhost:8443/
</VirtualHost>


?










share|improve this question
















Using that answer: How to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80



I've configured my apache2 server to redirect some requests to glassfish on 8080:



<VirtualHost *:80>
(...)
ProxyPass /tomcat/ http://localhost:8080/
ProxyPassReverse /tomcat/ http://localhost:8080/
ProxyPass /tomcat-admin/ http://localhost:4848/
ProxyPassReverse /tomcat-admin/ http://localhost:4848/
</VirtualHost>


On http://my.server.org/tomcat/ , I can clearly see:



 GlassFish Server 3.1.2
Your server is now running


but http://my.server.org/tomcat-admin/ returns a blank screen , but I can see the HTML source of the admin page, so I suppose that some resources cannot be loaded. How should I fix this ?



Another question: if my java web application use httpS, should I just add:



ProxyPass /tomcat-secure/ http://localhost:8443/
ProxyPassReverse /tomcat-secure/ http://localhost:8443/
</VirtualHost>


?







tomcat configuration httpd mod-proxy glassfish






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:14









Community

1




1










asked Jan 9 '13 at 10:19









PierrePierre

2741413




2741413












  • What do your apache logs say?

    – ProfessionalAmateur
    Jan 9 '13 at 18:17

















  • What do your apache logs say?

    – ProfessionalAmateur
    Jan 9 '13 at 18:17
















What do your apache logs say?

– ProfessionalAmateur
Jan 9 '13 at 18:17





What do your apache logs say?

– ProfessionalAmateur
Jan 9 '13 at 18:17










1 Answer
1






active

oldest

votes


















0














Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.



I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/workers.properties. You may need something like this:



worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13


These parameters define the connection between apache and tomcat. I told tomcat to only listen to 127.0.0.1. But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.



Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:



JkWorkersFile /etc/libapache2-mod-jk/workers.properties


If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:



<VirtualHost *:80>
[...]
ServerName your.host.tld
[...]
RewriteEngine on
RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
JkMount /* ajp13_worker
[...]
</VirtualHost>


This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/workers.properties (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:



a2enmod jk
a2enmod rewrite
a2ensite 007-what-ever-host
service apache2 restart
service tomcat7 restart


and go for http://your.host.tld/abc?some=query. You'll hopefully end up with the same result as if you call http://your.host.tld:8080/YourContext/abc?some=query.



Hope that helps ;-)






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f464338%2fapache2-glassfishtomcat-redirecting-some-but-not-all-requests-on-80-to-glass%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.



    I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/workers.properties. You may need something like this:



    worker.ajp13_worker.port=8009
    worker.ajp13_worker.host=localhost
    worker.ajp13_worker.type=ajp13


    These parameters define the connection between apache and tomcat. I told tomcat to only listen to 127.0.0.1. But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.



    Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:



    JkWorkersFile /etc/libapache2-mod-jk/workers.properties


    If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:



    <VirtualHost *:80>
    [...]
    ServerName your.host.tld
    [...]
    RewriteEngine on
    RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
    JkMount /* ajp13_worker
    [...]
    </VirtualHost>


    This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/workers.properties (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:



    a2enmod jk
    a2enmod rewrite
    a2ensite 007-what-ever-host
    service apache2 restart
    service tomcat7 restart


    and go for http://your.host.tld/abc?some=query. You'll hopefully end up with the same result as if you call http://your.host.tld:8080/YourContext/abc?some=query.



    Hope that helps ;-)






    share|improve this answer





























      0














      Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.



      I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/workers.properties. You may need something like this:



      worker.ajp13_worker.port=8009
      worker.ajp13_worker.host=localhost
      worker.ajp13_worker.type=ajp13


      These parameters define the connection between apache and tomcat. I told tomcat to only listen to 127.0.0.1. But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.



      Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:



      JkWorkersFile /etc/libapache2-mod-jk/workers.properties


      If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:



      <VirtualHost *:80>
      [...]
      ServerName your.host.tld
      [...]
      RewriteEngine on
      RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
      JkMount /* ajp13_worker
      [...]
      </VirtualHost>


      This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/workers.properties (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:



      a2enmod jk
      a2enmod rewrite
      a2ensite 007-what-ever-host
      service apache2 restart
      service tomcat7 restart


      and go for http://your.host.tld/abc?some=query. You'll hopefully end up with the same result as if you call http://your.host.tld:8080/YourContext/abc?some=query.



      Hope that helps ;-)






      share|improve this answer



























        0












        0








        0







        Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.



        I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/workers.properties. You may need something like this:



        worker.ajp13_worker.port=8009
        worker.ajp13_worker.host=localhost
        worker.ajp13_worker.type=ajp13


        These parameters define the connection between apache and tomcat. I told tomcat to only listen to 127.0.0.1. But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.



        Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:



        JkWorkersFile /etc/libapache2-mod-jk/workers.properties


        If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:



        <VirtualHost *:80>
        [...]
        ServerName your.host.tld
        [...]
        RewriteEngine on
        RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
        JkMount /* ajp13_worker
        [...]
        </VirtualHost>


        This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/workers.properties (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:



        a2enmod jk
        a2enmod rewrite
        a2ensite 007-what-ever-host
        service apache2 restart
        service tomcat7 restart


        and go for http://your.host.tld/abc?some=query. You'll hopefully end up with the same result as if you call http://your.host.tld:8080/YourContext/abc?some=query.



        Hope that helps ;-)






        share|improve this answer















        Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.



        I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/workers.properties. You may need something like this:



        worker.ajp13_worker.port=8009
        worker.ajp13_worker.host=localhost
        worker.ajp13_worker.type=ajp13


        These parameters define the connection between apache and tomcat. I told tomcat to only listen to 127.0.0.1. But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.



        Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:



        JkWorkersFile /etc/libapache2-mod-jk/workers.properties


        If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:



        <VirtualHost *:80>
        [...]
        ServerName your.host.tld
        [...]
        RewriteEngine on
        RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
        JkMount /* ajp13_worker
        [...]
        </VirtualHost>


        This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/workers.properties (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:



        a2enmod jk
        a2enmod rewrite
        a2ensite 007-what-ever-host
        service apache2 restart
        service tomcat7 restart


        and go for http://your.host.tld/abc?some=query. You'll hopefully end up with the same result as if you call http://your.host.tld:8080/YourContext/abc?some=query.



        Hope that helps ;-)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 9 '13 at 18:18

























        answered Jan 9 '13 at 18:12









        binfalsebinfalse

        20615




        20615



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f464338%2fapache2-glassfishtomcat-redirecting-some-but-not-all-requests-on-80-to-glass%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos