How does one server run multiple http Services?

Source: Internet
Author: User
Tags subdomain subdomain name nginx reverse proxy
1. The default environment is apache, which listens to port 80 and serves the php environment. For example, how to configure tomcat and subdomain name resolution when accessing www.abc.com, so that the javaweb directory is accessed when accessing the subdomain name, for example, example.abc.com. ... 1. The default environment is apache, which listens to port 80 to serve the php environment.
For example, when you access www.abc.com, you can access the php Directory.
2. How to configure tomcat and subdomain name resolution so that the java web directory is accessed when accessing the subdomain name
For example, when you access example.abc.com, you can access the java web directory.

Answer

It should be emphasized that java and php should be resolved by tomcat and apache respectively, rather than configuring virtual directories and domain names in apache.

Modify question

Since we all reply to the use of reverse proxy, Which of the following is the most common method for implementing reverse proxy?

Reply content:

1. The default environment is apache, which listens to port 80 and serves the php environment.
For example, when you access www.abc.com, you can access the php Directory.
2. How to configure tomcat and subdomain name resolution so that the java web directory is accessed when accessing the subdomain name
For example, when you access example.abc.com, you can access the java web directory.

Answer

It should be emphasized that java and php should be resolved by tomcat and apache respectively, rather than configuring virtual directories and domain names in apache.

Modify question

Since we all reply to the use of reverse proxy, Which of the following is the most common method for implementing reverse proxy?

Because the two programs cannot listen to port 80 at the same time, it is not feasible to directly open the two programs. The solution is actually very simple: Only one program listens to port 80.
In your combination of Apache and Tomcat, you can link all websites to Apache. For websites that need to use Java, use Apache reverse proxy to Tomcat, in this way, Tomcat can access all websites without occupying port 80.
For more information, seeApache reverse proxy TomcatTechnical documentation.

Bind different domain names and then forward


  
       DocumentRoot "D:/web/www"    ServerName www.test.com    
   
            Options FollowSymLinks Indexes        AllowOverride All        Order deny,allow        Allow from 127.0.0.1        Deny from all        Require all granted    
   
  
  
       DocumentRoot "D:/web/weiphp3.0_beta/weiphp"    ServerName www.wei.com    
   
            Options FollowSymLinks Indexes        AllowOverride All        Order deny,allow        Allow from 127.0.0.1        Deny from all        Require all granted    
   
  
  
       DocumentRoot "D:/web/wx2share"    ServerName www.tbgo.com    
   
            Options FollowSymLinks Indexes        AllowOverride All        Order deny,allow        Allow from 127.0.0.1        Deny from all        Require all granted    
   
  

What does it mean to run multiple http Services? Multiple servers?

Apache proxy is the easiest way to forward data.
In the long run, the most standard is to build another server for routing, that is, the long-known Enterprise Service Bus esb.

Build an nginx reverse proxy. The proxy port is 80, and requests of different services are forwarded to the corresponding non-port 80 service through the proxy configuration.

Search
Nginx

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.