LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Which is the right implementation for a web-app, an admin and the default Tomcat pag (https://www.linuxquestions.org/questions/linux-server-73/which-is-the-right-implementation-for-a-web-app-an-admin-and-the-default-tomcat-pag-892967/)

elect 07-21-2011 10:02 AM

Which is the right implementation for a web-app, an admin and the default Tomcat pag
 
Hi all, since I am pretty newbie on deploying web applications and manage server I ask you which is the right (and secure) implementation if I would like to have (using Tomcat behind Apache):


- my application on http://x.x.x.x/
- my admin application on http://x.x.x.x:x
- the default Tomcat page on i.e. http://x.x.x.x/tomcat

at the moment I just set in my /etc/apache2/sites-available/default the following:

Code:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
       
        DocumentRoot /usr/share/tomcat5.5/webapps/MyApp/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /usr/share/tomcat5.5/webapps/MyApp/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>


So in this way i can have it on http://x.x.x.x/, but I dont know if I am doing it right or less..

But my admin app is at http://x.x.x.x:8180/admin and tomcat at http://x.x.x.x:8180

elect 07-21-2011 05:20 PM

Why if I set

Quote:

DocumentRoot /usr/share/tomcat5.5/webapps/MyApp/

Servlets dont work, while if I mount it with


Quote:

JkMount /app ajp13_worker
JkMount /app/* ajp13_worker
Everything works fine? (but it's on http://x.x.x.x/app and NOT on http://x.x.x.x/ )

elect 07-25-2011 08:40 AM

Quote:

Originally Posted by elect (Post 4421757)
Why if I set




Servlets dont work, while if I mount it with




Everything works fine? (but it's on http://x.x.x.x/app and NOT on http://x.x.x.x/ )


I learnt something new...

basically Apache can only serve the app like a static page, this is why servlets dont work..

However right now I am trying to play with the "Context".. but it seems that also if I modify the app.xml to another path, it doesnt work (that is the app is still accessible on the old address e.g.: still x.x.x.x:8180/myapp instead x.x.x.x:8180/myapp1)


I looked for the conf files for the contexts in


In the $CATALINA_BASE/conf/context.xml file: the Context element information will be loaded by all webapps.
In the $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host.
In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. The default web application may be defined by using a file called ROOT.xml.


Unluckly without success...

where else may I find them?


All times are GMT -5. The time now is 11:09 AM.