Redirect Apache to Tomcat on Vesta CP









up vote
0
down vote

favorite












I have a VPS server with Ubuntu 18 O.S. In this VPS I have installed VESTA CP, which comes with Apache 2 and Nginx. After that I have intalled Tomcat 9(port 8082) to serve a Java Spring based webapp.
If I enter the address "serverIP:8082/AppFolder" I can access the app, but I want to redirect the apache server to the tomcat one, so I can write the domain name and load the webapp.



I have tried .htaccess file but it shows an apache error page. I have no permission to view this file is the message.



What can I do to solve this?



-Nginx config:



location / gz

location /error/
alias /home/admin/web/webapp.com/document_errors/;


location @fallback
proxy_pass http://IP:8080;



-Apache config:



<VirtualHost IP:8080>

ServerName webapp.com
ServerAlias www.webapp.com
ServerAdmin info@webapp.com
DocumentRoot /home/admin/web/webapp.com/public_html
ScriptAlias /cgi-bin/ /home/admin/web/webapp.com/cgi-bin/
Alias /vstats/ /home/admin/web/webapp.com/stats/
Alias /error/ /home/admin/web/webapp.com/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/webapp.com.bytes bytes
CustomLog /var/log/apache2/domains/webapp.com.log combined
ErrorLog /var/log/apache2/domains/webapp.com.error.log
<Directory /home/admin/web/webapp.com/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/webapp.com/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/webapp.com/stats>
AllowOverride All
</Directory>

<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>

IncludeOptional /home/admin/conf/web/apache2.webapp.com.conf*

</VirtualHost>


Thanks.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a VPS server with Ubuntu 18 O.S. In this VPS I have installed VESTA CP, which comes with Apache 2 and Nginx. After that I have intalled Tomcat 9(port 8082) to serve a Java Spring based webapp.
    If I enter the address "serverIP:8082/AppFolder" I can access the app, but I want to redirect the apache server to the tomcat one, so I can write the domain name and load the webapp.



    I have tried .htaccess file but it shows an apache error page. I have no permission to view this file is the message.



    What can I do to solve this?



    -Nginx config:



    location / gz

    location /error/
    alias /home/admin/web/webapp.com/document_errors/;


    location @fallback
    proxy_pass http://IP:8080;



    -Apache config:



    <VirtualHost IP:8080>

    ServerName webapp.com
    ServerAlias www.webapp.com
    ServerAdmin info@webapp.com
    DocumentRoot /home/admin/web/webapp.com/public_html
    ScriptAlias /cgi-bin/ /home/admin/web/webapp.com/cgi-bin/
    Alias /vstats/ /home/admin/web/webapp.com/stats/
    Alias /error/ /home/admin/web/webapp.com/document_errors/
    #SuexecUserGroup admin admin
    CustomLog /var/log/apache2/domains/webapp.com.bytes bytes
    CustomLog /var/log/apache2/domains/webapp.com.log combined
    ErrorLog /var/log/apache2/domains/webapp.com.error.log
    <Directory /home/admin/web/webapp.com/public_html>
    AllowOverride All
    Options +Includes -Indexes +ExecCGI
    php_admin_value open_basedir /home/admin/web/webapp.com/public_html:/home/admin/tmp
    php_admin_value upload_tmp_dir /home/admin/tmp
    php_admin_value session.save_path /home/admin/tmp
    </Directory>
    <Directory /home/admin/web/webapp.com/stats>
    AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
    RMode config
    RUidGid admin admin
    RGroups www-data
    </IfModule>
    <IfModule itk.c>
    AssignUserID admin admin
    </IfModule>

    IncludeOptional /home/admin/conf/web/apache2.webapp.com.conf*

    </VirtualHost>


    Thanks.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a VPS server with Ubuntu 18 O.S. In this VPS I have installed VESTA CP, which comes with Apache 2 and Nginx. After that I have intalled Tomcat 9(port 8082) to serve a Java Spring based webapp.
      If I enter the address "serverIP:8082/AppFolder" I can access the app, but I want to redirect the apache server to the tomcat one, so I can write the domain name and load the webapp.



      I have tried .htaccess file but it shows an apache error page. I have no permission to view this file is the message.



      What can I do to solve this?



      -Nginx config:



      location / gz

      location /error/
      alias /home/admin/web/webapp.com/document_errors/;


      location @fallback
      proxy_pass http://IP:8080;



      -Apache config:



      <VirtualHost IP:8080>

      ServerName webapp.com
      ServerAlias www.webapp.com
      ServerAdmin info@webapp.com
      DocumentRoot /home/admin/web/webapp.com/public_html
      ScriptAlias /cgi-bin/ /home/admin/web/webapp.com/cgi-bin/
      Alias /vstats/ /home/admin/web/webapp.com/stats/
      Alias /error/ /home/admin/web/webapp.com/document_errors/
      #SuexecUserGroup admin admin
      CustomLog /var/log/apache2/domains/webapp.com.bytes bytes
      CustomLog /var/log/apache2/domains/webapp.com.log combined
      ErrorLog /var/log/apache2/domains/webapp.com.error.log
      <Directory /home/admin/web/webapp.com/public_html>
      AllowOverride All
      Options +Includes -Indexes +ExecCGI
      php_admin_value open_basedir /home/admin/web/webapp.com/public_html:/home/admin/tmp
      php_admin_value upload_tmp_dir /home/admin/tmp
      php_admin_value session.save_path /home/admin/tmp
      </Directory>
      <Directory /home/admin/web/webapp.com/stats>
      AllowOverride All
      </Directory>

      <IfModule mod_ruid2.c>
      RMode config
      RUidGid admin admin
      RGroups www-data
      </IfModule>
      <IfModule itk.c>
      AssignUserID admin admin
      </IfModule>

      IncludeOptional /home/admin/conf/web/apache2.webapp.com.conf*

      </VirtualHost>


      Thanks.










      share|improve this question













      I have a VPS server with Ubuntu 18 O.S. In this VPS I have installed VESTA CP, which comes with Apache 2 and Nginx. After that I have intalled Tomcat 9(port 8082) to serve a Java Spring based webapp.
      If I enter the address "serverIP:8082/AppFolder" I can access the app, but I want to redirect the apache server to the tomcat one, so I can write the domain name and load the webapp.



      I have tried .htaccess file but it shows an apache error page. I have no permission to view this file is the message.



      What can I do to solve this?



      -Nginx config:



      location / gz

      location /error/
      alias /home/admin/web/webapp.com/document_errors/;


      location @fallback
      proxy_pass http://IP:8080;



      -Apache config:



      <VirtualHost IP:8080>

      ServerName webapp.com
      ServerAlias www.webapp.com
      ServerAdmin info@webapp.com
      DocumentRoot /home/admin/web/webapp.com/public_html
      ScriptAlias /cgi-bin/ /home/admin/web/webapp.com/cgi-bin/
      Alias /vstats/ /home/admin/web/webapp.com/stats/
      Alias /error/ /home/admin/web/webapp.com/document_errors/
      #SuexecUserGroup admin admin
      CustomLog /var/log/apache2/domains/webapp.com.bytes bytes
      CustomLog /var/log/apache2/domains/webapp.com.log combined
      ErrorLog /var/log/apache2/domains/webapp.com.error.log
      <Directory /home/admin/web/webapp.com/public_html>
      AllowOverride All
      Options +Includes -Indexes +ExecCGI
      php_admin_value open_basedir /home/admin/web/webapp.com/public_html:/home/admin/tmp
      php_admin_value upload_tmp_dir /home/admin/tmp
      php_admin_value session.save_path /home/admin/tmp
      </Directory>
      <Directory /home/admin/web/webapp.com/stats>
      AllowOverride All
      </Directory>

      <IfModule mod_ruid2.c>
      RMode config
      RUidGid admin admin
      RGroups www-data
      </IfModule>
      <IfModule itk.c>
      AssignUserID admin admin
      </IfModule>

      IncludeOptional /home/admin/conf/web/apache2.webapp.com.conf*

      </VirtualHost>


      Thanks.







      java apache tomcat nginx vesta






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 18:50









      Pedro

      456




      456






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Finally I have found an answer...editing the config file of nginx:



          proxy_pass http://IP:8082; <--TOMCAT PORT
          root /home/admin/web/webapp.com/public_html; <--JSP PAGES PATH


          Default config file has the Apache port and apache html pages path.
          I suppose this can be done using apache proxy_mod, but I don´t know which way is better...if anyone can explain the two ways(via apache or via nginx) I apreciate it.






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            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',
            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%2fstackoverflow.com%2fquestions%2f53242303%2fredirect-apache-to-tomcat-on-vesta-cp%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








            up vote
            0
            down vote













            Finally I have found an answer...editing the config file of nginx:



            proxy_pass http://IP:8082; <--TOMCAT PORT
            root /home/admin/web/webapp.com/public_html; <--JSP PAGES PATH


            Default config file has the Apache port and apache html pages path.
            I suppose this can be done using apache proxy_mod, but I don´t know which way is better...if anyone can explain the two ways(via apache or via nginx) I apreciate it.






            share|improve this answer
























              up vote
              0
              down vote













              Finally I have found an answer...editing the config file of nginx:



              proxy_pass http://IP:8082; <--TOMCAT PORT
              root /home/admin/web/webapp.com/public_html; <--JSP PAGES PATH


              Default config file has the Apache port and apache html pages path.
              I suppose this can be done using apache proxy_mod, but I don´t know which way is better...if anyone can explain the two ways(via apache or via nginx) I apreciate it.






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Finally I have found an answer...editing the config file of nginx:



                proxy_pass http://IP:8082; <--TOMCAT PORT
                root /home/admin/web/webapp.com/public_html; <--JSP PAGES PATH


                Default config file has the Apache port and apache html pages path.
                I suppose this can be done using apache proxy_mod, but I don´t know which way is better...if anyone can explain the two ways(via apache or via nginx) I apreciate it.






                share|improve this answer












                Finally I have found an answer...editing the config file of nginx:



                proxy_pass http://IP:8082; <--TOMCAT PORT
                root /home/admin/web/webapp.com/public_html; <--JSP PAGES PATH


                Default config file has the Apache port and apache html pages path.
                I suppose this can be done using apache proxy_mod, but I don´t know which way is better...if anyone can explain the two ways(via apache or via nginx) I apreciate it.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 at 17:17









                Pedro

                456




                456



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242303%2fredirect-apache-to-tomcat-on-vesta-cp%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

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    ReactJS Fetched API data displays live - need Data displayed static

                    政党