tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Smith <jl...@coolbluei.com>
Subject help newbie with virtual hosts
Date Mon, 21 Jan 2002 20:35:54 GMT
Hi,

I am really just getting started with apache/tomcat and java in general. I
tried searching the archives but i really think i have a hard time of
knowing what to ask, so i am sorry if i ask something that has been
answered before.

so i kind of inhereted a dell server with the wirex package installed on
it. this has tomcat/apache allready running on it i just need to tweak a
few things to get the virtual host to work right.

the domains have a directory structure like this
domain.com
domain.com/docs	# this is where you are supposed to put all of your web
		# documents
domain.com/java	# this is where you put your jsp pages and you can access
		# them via http://domain.com/java/


I am trying to get it so that when you first go to http://domain.com it
goes to the java directory. So i first tried changing the DocumentRoot in
http.conf but then this wouldnt pass the jsp files off and they would just
show all of the code. I tried messing around with a few other things but i
just cant get this to work. my other problem is dealing with aliases like
if i want http://domain.com http://www.domain.com
http://www.otherdomain.com to all point to the same thing what do i need
to do? I of course added in my http.conf ServerAlias www.domain.com etc
and then i thought i needed to just add a <Alias> to the server.xml file
but that didnt seem to work.

here is what my virtual host looks like:

<VirtualHost 255.255.255.255>
        ServerName domain.com
        ServerAlias www.domain.com mail.domain.com
        DocumentRoot /home/domains/domain.com/java
        ErrorLog /home/domains/domain.com/logs/domain.com-error_log
        CustomLog /home/domains/domain.com/logs/domain.com-access_log
common
        Bandwidth all 640000
        BandwidthModule On
        MinBandwidth all -1
<Directory "/home/domains/domain.com/java">
                AllowOverride All 
</Directory>
        <IfModule mod_cgi.c>
                #ScriptAlias   /cgi-bin/
"/home/domains/domain.com/cgi-bin/"
        </IfModule>
        <Directory "/home/domains/domain.com/cgi-bin">
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
        </Directory>
        <IfModule mod_php4.c>
                php_flag engine On
        </IfModule>
        AddType text/html .shtml
        AddHandler server-parsed .shtm
        # Is the Jakarta (JK) Module installed? This allows access to
        # the Tomcat Engine (/usr/local/tomcat) to serve up Servlets
        # and JSP files ....
        #
        # In the code below, we make an alias of /java to go to the
        # Jakarta engine. However, files not in the WEB-INF directory
        # (like gif images and static HTML files, but not JSP files)
        # should be simply served up by Apache ...
        <IfModule mod_jk.c>
                JkLogFile
/home/domains/domain.com/logs/domain.com-java_log
                JkLogLevel warn
                JkMount /*.jsp  ajp12
                #JkMount /java/*.jsp  ajp12
                Alias /java /home/domains/domain.com/java
                #Alias / /home/domains/domain.com/java
                <Directory "/home/domains/domain.com/java">
                Options Indexes FollowSymLinks
</Directory>
        <Location /java/WEB-INF/ >
                AllowOverride None
                deny from all
        </Location>
        JkMount /java/* ajp12
        #JkMount /*.jsp ajp12
        </IfModule>
</VirtualHost>

#########################################################

and then my server.xml file looks like this:

	<Host name="domain.com">
                <!-- Tomcat 3.2-specific entry to have the engine work -->
                <!-- with virtually hosted domain: domain.com -->
                
                <!-- jake added 20020121 -->
                <Alias>www.domain.com</Alias>
            
                <Context path="/java"
                        docBase="/home/domains/domain.com/java" />
        </Host>



thank you for any help

jake


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message