Configuration of virtual hosts and multiple domain names in Lighttpd

Source: Internet
Author: User
Lighttpd is also a lightweight and good web server. like apachehttpserver, when I first used lighttpd in, lighttpd supported flv streaming media playback and anti-leeching, so we need to use it. Today, we will focus on how to configure the settings of multiple virtual hosts and domain names. take the V1.7 version of Lighttpd as an example: 1. configure multiple virtual hosts to open the Lighttpd installation project.

Lighttpd is also a lightweight and good web server. like apachehttpserver, when I first used lighttpd in, lighttpd supported flv streaming media playback and anti-leeching, so we need to use it. Today, we will focus on how to configure multiple virtual hosts and domain name settings. take Lighttpd V1.7 as an example:

1. configure multiple virtual hosts

Open the etc/Lighttpd. conf file in the lighttpd installation directory, and add the following section at the end:

 
 
  1. $HTTP["host"] == "test.mzone.cc"{
  2.    server.document-root = "/webapps/mzone/test"
  3.    server.errorlog = "/usr/local/lighttpd/logs/mzone-test-error.log"
  4.    accesslog.filename = "/usr/local/lighttpd/logs/mzone-test-access.log"
  5. }

If you need multiple virtual hosts, set multiple replication segments.

2. multiple domain names direct to the same directory

Sometimes we need to configure multiple domain names for the same application, then we can use the following section for configuration:

 
 
  1. $HTTP["host"] =~ "^(app1\.mzone\.cc|app2\.mzone\.cc)$"{
  2.    server.document-root = "/webapps/mzone/app"
  3.    server.errorlog = "/usr/local/lighttpd/logs/mzone-app-error.log"
  4.    accesslog.filename = "/usr/local/lighttpd/logs/mzone-app-access.log"
  5. }

Note that this is different from the configuration of a single domain name: The former uses=The latter uses= ~In this way, we have completed the configuration of multiple domain names for one application, and then restarted lightpd.


Related Article

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.