Hi I have setup a test machine so that it should host two sites
 
 
But only one (http://admin) is accessible and the other one is not. Can you give any pointers.
 
I set up virtual hosts as (httpd.conf):
 
NameVirtualHost *:80
 
<VirtualHost *:80>
ServerName admin
ServerAdmin [EMAIL PROTECTED]
DocumentRoot E:/admin.support.cp.net/html/
ErrorDocument 404 E:/admin.support.cp.net/notfound.html
ErrorLog logs/admin.support.cp.net-error_log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/admin.support.cp.net-access_log combined
Alias /icons/ E:/admin.support.cp.net/icons/
ScriptAlias /cgi-bin/ E:/admin.support.cp.net/cgi-bin/
<Directory "E:/admin.support.cp.net/html">
 Options FollowSymLinks Includes
 DirectoryIndex index.html index.jsp
 AllowOverride AuthConfig
</Directory>
AddType text/x-server-parsed-html .html
</VirtualHost>
 
<VirtualHost *:80>
     DocumentRoot E:/support1.cp.net
     ServerName support
     ServerAdmin [EMAIL PROTECTED]
     ErrorLog logs/support-error_log
     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
     LogFormat "%h %l %u %t \"%r\" %>s %b" common
     LogFormat "%{Referer}i -> %U" referer
     LogFormat "%{User-agent}i" agent
     CustomLog logs/support-access_log combined
     Alias /pdf/ E:/support1.cp.net/content/pdf/
     Alias /images/ E:/support1.cp.net/images/    
     ScriptAlias /cgi-bin/ E:/support1.cp.net/cgi-bin/    
     ErrorDocument 404 E:/support1.cp.net/notfound.jsp
     # Allow Server Side includes (SSI)  
     <Directory "E:/support1.cp.net">    
        Options FollowSymLinks Includes
        AllowOverride AuthConfig
        allow from all
     </Directory>
     AddType text/x-server-parsed-html .html
</VirtualHost>
 
Similarly I added following to server.xml:
 
<Host Name="support">
  <Context path="" docBase="E:/support1.cp.net" debug="0" reloadable="true" />
  </Host>
 <Host Name="admin">
  <Context path="" docBase="E:/admin.support.cp.net" debug="0" reloadable="true" />
  </Host>
 
I also added lines to the "hosts" file on that machine:
 
<IP-Address> admin
<IP-Address> support.
 
Thanks Mayuresh.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
   Copyright 1999-2004 The Apache Software Foundation
 
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<Server>

    <!-- You can add a "home" attribute to represent the "base" for 
         all relative paths. If none is set, the TOMCAT_HOME property
         will be used, and if not set "." will be used.
         webapps/, work/ and log/ will be relative to this ( unless 
         set explicitely to absolute paths ).
      -->
    <ContextManager workDir="work" >

      <!-- ==================== Global modules ==================== -->
        <LoaderInterceptor11  useApplicationLoader="true" />

        <TrustedLoader />

        <LogSetter name="tc_log" timestamps="true"
		   verbosityLevel="INFORMATION"  />

        <LogEvents enabled="false" />
        
        <!-- Backward compat: read the Context declarations from server.xml-->
        <ContextXmlReader config="conf/server.xml" />

        <!-- Separated Context -->
        <ContextXmlReader config="conf/apps.xml" />

        <AutoDeploy source="modules" target="modules" 
		    redeploy="true" />

        <AutoWebApp dir="modules" host="DEFAULT" trusted="true"/>

        <AutoDeploy source="webapps" target="webapps" />

        <AutoWebApp dir="webapps" host="DEFAULT" />

        <PolicyLoader securityManagerClass="java.lang.SecurityManager"
		      policyFile="conf/tomcat.policy" />

        <SimpleMapper1 />

        <SessionExpirer checkInterval="60" />
        <!-- For development you can use randomClass="java.util.Random" -->
        <SessionIdGenerator randomClass="java.security.SecureRandom" 
                            randomFile="/dev/urandom" />


        <!-- ========== context processing modules ========== -->

        <!-- This will be the "default" profile 
             ( all except the "global" modules can be set per context )
          -->
        <LogSetter name="servlet_log" 
		   timestamps="true"
		   verbosityLevel = "INFORMATION"
		   path="logs/servlet-${yyyyMMdd}.log" 
		   />

        <LogSetter  name="JASPER_LOG"
		   timestamps="true" 
		   path="logs/jasper-${yyyyMMdd}.log" 
		   verbosityLevel = "INFORMATION"  />

        <WebXmlReader validate="true" />

        <ErrorHandler showDebugInfo="true" />

        <WorkDirSetup cleanWorkDir="false" />
<!-- Test -->
        
        <Host Name="support">
        	<Context path="" docBase="E:/support1.cp.net" debug="0" reloadable="true"/>
        </Host>
        
        <Host Name="admin">
	       	<Context path="" docBase="E:/admin.support.cp.net" debug="0" reloadable="true"/>
        </Host>

        <Jdk12Interceptor /> 

        <!-- Non-standard invoker, for backward compat. ( /servlet/* ) -->
        <InvokerInterceptor /> 

        <!-- you can add javaCompiler="jikes" -->
        <JspInterceptor keepGenerated="true"
			largeFile="false"
			useJspServlet="false"
			/>
        
        <StaticInterceptor listings="true"
                           useAcceptLanguage="true"
                           useCharset="locale" />
        
        <ReloadInterceptor fullReload="true" />

        <SimpleSessionStore maxActiveSessions="-1" />

        <AccessInterceptor />

        <CredentialsInterceptor />

        <SimpleRealm  filename="conf/users/global-users.xml" />

       <!-- UnComment the following and comment out the
            above to get a JDBC realm.
            Other options for driverName: 
              driverName="oracle.jdbc.driver.OracleDriver"
              connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
              connectionName="scott"
              connectionPassword="tiger"

              driverName="org.gjt.mm.mysql.Driver"
              connectionURL="jdbc:mysql://localhost/authority"
              connectionName="test"
              connectionPassword="test"

            "connectionName" and "connectionPassword" are optional.
        -->
        <!--
        <JDBCRealm
            debug="99" 
	    driverName="sun.jdbc.odbc.JdbcOdbcDriver" 
	    connectionURL="jdbc:odbc:TOMCAT" 
	    userTable="users" 
            userNameCol="user_name" 
            userCredCol="user_pass" 
	    userRoleTable="user_roles" 
            roleNameCol="role_name" />
        -->

        <LoadOnStartupInterceptor />

        <Servlet22Interceptor />


        <!-- Tag pooling support.
             To enable the reuse of tag handlers as described in
             the JSP spec, uncomment the following.  If your pages
             use a lot of custom tags, you should see a nice performance
             gain.
             
             Note that placing the interceptor here will enable
             Tag pooling for all of the web applicatitions loaded -
             this may be a bad thing if all tags are not coded to
             handle reuse. To enable pooling only for specific web
             applications i.e. Contexts, place the interceptor inside of 
             the Context's definition.
             
             To view information about tag usage uncomment the tag
             LogSetter. Set verbosityLevel to DEBUG to see everytime
             a tag is obtained and released.
        -->
        <!--
        <LogSetter  name="tag_pool_log" timestamps="true" 
            path="logs/tagpool-${yyyyMMdd}.log" 
            verbosityLevel="INFORMATION" />

        <TagPoolManagerInterceptor />
        -->

        <!-- Request processing -->

        <DecodeInterceptor /> 

        <!-- If you are running SSL and wish to verify Tomcat sessions 
             against SSL sessions, use checkSSLSessionId="true"
             Default is checkSSLSessionId="false" -->
        <SessionId cookiesFirst="true" noCookies="false" /> 

        <!-- Automatic config generation
             Set noRoot="false" if you wish to have Tomcat try to take
               control of the external web server's root context.
               Additonal configuration of the external web server may be
               required for this to be successful.
             Note: Configuration files are not written as part of the
               default startup behvior.  Append "jkconf" to the startup
               command to have Tomcat initialize, write the config files,
               then exit. This may be done while Tomcat is running.
          -->
        <ApacheConfig noRoot="true" />
        <IISConfig noRoot="true" />
        <NSConfig noRoot="true" />

         <!-- Uncoment for apache-style logs 
              Attributes: logFile, flush, format
        <AccessLogInterceptor/>
          -->
      <!-- ==================== Connectors ==================== -->

       <!-- old http adapter. Attributes:
               secure - use SSL ( https )
               keystore, keypass - certs for SSL
               port 
               reportedname - Server name to send back to browser
                              by default report Tomcat Web Server ...
                              set an empty string to avoid sending server header 
        -->
        <!-- Uncomment this if useing a 1.1 JDK
        <Http10Connector   port="9090" 
			   secure="false"
			   maxThreads="100"
			   maxSpareThreads="50"
			   minSpareThreads="10" />
        -->
        <!--
            Uncomment this for SSL support. You _need_ to set up a
            server certificate if you want this to work, and you
            need JSSE. See tomcat-ssl-howto.html for more detailed
            instructions.

            1. Make the JSSE jars available to Tomcat, either by making
               them an installed extension or by adding them to the
               Tomcat CLASSPATH.
            2. Do: keytool -genkey -alias tomcat -keyalg RSA
               RSA is essential to work with Netscape and IIS.
               Use "changeit" as password. ( or add keypass attribute )
               You don't need to sign the certificate.
         -->
        <!--
        <Http10Connector  port="8443" secure="true" />
        -->

        <!--
	    HTTP 1.1 support using the Coyote adapter and
	    and Http11 processor from jakarta-tomcat-connectors.

	    Note: CoyoteConnector supports the same attributes as
	          Http10Connector
  	    -->
	 
        <CoyoteConnector   port="9090" 
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false"  acceptCount="100"
               debug="0" connectionTimeout="20000" 
               disableUploadTimeout="true" />

	    <!-- Note : To disable connection timeouts, set connectionTimeout value
	     to -1 -->
		
		<!-- Note : To use gzip compression you could set the following properties :
		
				   compression="on" 
				   compressionMinSize="2048" 
				   noCompressionUserAgents="gozilla, traviata" 
				   compressableMimeType="text/html,text/xml"
		-->

        <!--
             JNI connector. It assumes the library is located in 
             TOMCAT_HOME/bin/native/jni_connect.[dll, nlm, so]. or in LD_LIBRARY_PATH.
             For different paths set "nativeLibrary" parameter.

             The JniConnector will be self-enable only if JNI mode is detected.
         -->
        <JniConnector /> 


        <!-- Apache AJP12 support. This is also used to shut down tomcat.
             Parameter "address" defines network interface this Interceptor
             "binds" to. Add it if you want to "bind" to just "127.0.0.1".
             
             address="127.0.0.1"
             
             Parameter "tomcatAuthentication", controls if Tomcat honors 
             ( and uses ) auth done in HTTP Server or not, when true Tomcat does 
             not use in any way auth information provided by the HTTP Server. 
             true is the default. 
             
             tomcatAuthentication="false"
             
          -->
        <Ajp12Connector	 port="8007" />

        <!-- Apache AJP13 support (mod_jk)
             Parameter "address" defines network interface this Interceptor
             "binds" to. Add it if you want to "bind" to just "127.0.0.1".

             address="127.0.0.1"

             Parameter "tomcatAuthentication", controls if Tomcat honors 
             ( and uses ) auth done in HTTP Server or not, when true Tomcat does 
             not use in any way auth information provided by the HTTP Server. 
             true is the default. 
             
             tomcatAuthentication="false"
          -->
        <!-- old JK support.  Uncomment if you need to use a 1.1 JDK     
        <Ajp13Connector port="8009" />
	-->

        <!-- Jk2 support using coyote.    -->
        <CoyoteConnector processorClassName="org.apache.jk.server.JkCoyoteHandler" 
                          port="8009" />

      <!-- 
           Context definitions can be placed here ( not recommended ) or 
           in separate files. The ContextXmlReader will read all context
           definitions ( you can customize the "base" filename ). 
 
           The default is conf/apps-[name].xml.
 
           See conf/apps-examples.xml and conf/apps-admin.xml  
       -->

    </ContextManager>
</Server>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to