Linux server Apache one IP, one port, method for building multiple websites.

Source: Internet
Author: User

Locate Apache-tomcat-6.0.14\conf\server.xml, and then add this snippet to the following services:

XML code
<!--the new project configuration here--
<service name= "Pro" >
<connector port= "8090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8444"/>
<connector port= "9999" protocol= "ajp/1.3" redirectport= "8444"/>
<engine name= "Pro" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" resourcename= "Userdatabase"/>
<context docbase= "D:/pro/webroot" path= ""/>
</Host>
</Engine>
</Service>

<!--the new project configuration here--
<service name= "Pro" >
<connector port= "8090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8444"/>
<connector port= "9999" protocol= "ajp/1.3" redirectport= "8444"/>
<engine name= "Pro" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" resourcename= "Userdatabase"/>
<context docbase= "D:/pro/webroot" path= ""/>
</Host>
</Engine>
</Service>
The above d:/pro/webroot is my project WebRoot path, everyone can modify themselves, another pro is also customized.


The detailed text reads as follows:



XML code
<?xml version= ' 1.0 ' encoding= ' utf-8 '?>

<server port= "8005" shutdown= "Shutdown" >

<listener classname= "Org.apache.catalina.core.AprLifecycleListener" sslengine= "on"/>
<listener classname= "Org.apache.catalina.core.JasperListener"/>
<listener classname= "Org.apache.catalina.mbeans.ServerLifecycleListener"/>
<listener classname= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>

<GlobalNamingResources>
<resource name= "Userdatabase" auth= "Container"
Type= "Org.apache.catalina.UserDatabase"
description= "User database that can be updated and saved"
factory= "Org.apache.catalina.users.MemoryUserDatabaseFactory"
Pathname= "Conf/tomcat-users.xml"/>
</GlobalNamingResources>

<!--above is the default configuration--

<!--This method is configured by default--

<service name= "Catalina" >
<connector port= "8008" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>

<connector port= "8009" protocol= "ajp/1.3" redirectport= "8443"/>
<engine name= "Catalina" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm"
Resourcename= "Userdatabase"/>
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
</Host>
</Engine>
</Service>

<!--the new project configuration here--
<service name= "Pro" >
<connector port= "8090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8444"/>
<connector port= "9999" protocol= "ajp/1.3" redirectport= "8444"/>
<engine name= "Pro" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" resourcename= "Userdatabase"/>
<context docbase= "D:/pro/webroot" path= ""/>
</Host>
</Engine>
</Service>

</Server>

<?xml version= ' 1.0 ' encoding= ' utf-8 '?>

<server port= "8005" shutdown= "Shutdown" >

<listener classname= "Org.apache.catalina.core.AprLifecycleListener" sslengine= "on"/>
<listener classname= "Org.apache.catalina.core.JasperListener"/>
<listener classname= "Org.apache.catalina.mbeans.ServerLifecycleListener"/>
<listener classname= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>

<GlobalNamingResources>
<resource name= "Userdatabase" auth= "Container"
Type= "Org.apache.catalina.UserDatabase"
description= "User database that can be updated and saved"
factory= "Org.apache.catalina.users.MemoryUserDatabaseFactory"
Pathname= "Conf/tomcat-users.xml"/>
</GlobalNamingResources>

<!--above is the default configuration--

<!--This method is configured by default--

<service name= "Catalina" >
<connector port= "8008" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>

<connector port= "8009" protocol= "ajp/1.3" redirectport= "8443"/>
<engine name= "Catalina" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm"
Resourcename= "Userdatabase"/>
Unpackwars= "true" autodeploy= "true"
Xmlvalidation= "false" Xmlnamespaceaware= "false" >
</Host>
</Engine>
</Service>

<!--the new project configuration here--
<service name= "Pro" >
<connector port= "8090" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8444"/>
<connector port= "9999" protocol= "ajp/1.3" redirectport= "8444"/>
<engine name= "Pro" defaulthost= "localhost" >
<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" resourcename= "Userdatabase"/>
<context docbase= "D:/pro/webroot" path= ""/>
</Host>
</Engine>
</Service>

</Server>

Linux server Apache one IP, one port, method for building multiple websites.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.