host multiple websites on one server apache ubuntu
host multiple websites on one server apache ubuntu
Alibabacloud.com offers a wide variety of articles about host multiple websites on one server apache ubuntu, easily find your host multiple websites on one server apache ubuntu information here online.
We all know that if we want to set multiple domain names or host names on a single machine, we need to use name-based virtual hosts. So how should we set it? This is the problem that this guide is trying to solve. There is
How to enable and disable a site
A2ensite site name a2dissite site name
Name-based (distinguished by domain name) virtual host
After
program to access the http://www.company1.com/ When index.html, the request header that is issued contains the following contents:
Get/index.html http/1.1
Host:www.company1.com
.....
After the WWW server program receives this request, it can check the "host:" Statement to determine which virtual host the client request is a service, and then further processing.
$ Sudo a2dismod: View enabled modules
$ Sudo apt-cache search libapache2-mod: search all modules
Apache2 of Ubuntu makes good configuration for providing support for virtual hosts. If your server has only one website, you can use the virtual host without modifying the configuration. If there are multiple
Today I studied how to bind multiple domain names to a single host in Apache and use port 80. To put it bluntly, multiple websites are run on one host, and the website domain names are all port 80.
The specific method is as follow
${apache_log_dir}/access.log combined
# for more configuration files from conf-available/, which is
# enabled or disabled at a global level, it's possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it had been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
If there are two domain names, respectively hello.abc.com and play.abc.com, you need to bind these two domain names toIP is 219.13.34.32 on the server1. First you need to specify the domain name and IP correspondence in the Domain Name Vendor Management page2.WEB Server Configuration Good lamp environment3. Put the corresponding source code into the/usr/local/apache/htdocs directory, respectively named uplo
virtual host
#声明主机头必须加这条指令, No person host header configuration does not take effect
#VirtualHost节点下面ServerName就是要绑定的域名, DocumentRoot represents the directory to which this domain name refers
#本机测试的话请在hosts中进行域名绑定如 127.0.0.1 www.mysite1.com
namevirtualhost *:8080
After the configuration, restart the Apache service, browser input www.mysite1.com:8080, will
about ApacheApache http Server is an outstanding representative of open source software projects, providing web browsing services based on standard HTTP network protocols, in the WAB The server sector has maintained over half of its share over the long term. Apache servers can run on Linux,UNIX,Windows multiple oper
.
LogLevel warn
CustomLog/var/log/apache2/access. log combined
The bold part is the key point.(3) release site# Ln-s/etc/apache2/sites-available/default-me/etc/apache2/sites-enabled/001-default
(4) restart the service#/Etc/init. d/apache2 restart
(5) testHttp: // localhost: 8000/
If the access is normal, the configuration is correct.
The code is as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~# Virtual Hosts## If you want to maintain mu
1. Virtual directoryEach Internet service can be published from multiple directories, a virtual server can have one host directory and any number of other publishing directories, and other publishing directories are called virtual directories.Specifies the customer URL address that the service submits to the customer as a directory tree for the entire publishing
establishment of a DNS server to parse, here I will two Web Services module into the DNS configuration file, a total of three files need to be configured, before the first to determine that they installed the bind package, the three files are/etc/named.conf/etc/ named.rfc1912, .../var/named/.------5) After the DNS file configuration is complete, you can restart both services.6) Access by using Windows domainFour uses different ports for access1) Add
Apache is the world's most used Web server software. It can run on almost all widely used computer platforms and is one of the most popular Web server-side software due to its widespread use across platforms and security. It is fast, reliable, and can be augmented with simple APIs to compile perl/python and other interpreters into the
reference [1. /autogen. sh has a path parameter in one line, but it is found that the actual input path parameter will prompt that this parameter cannot be found, so it is canceled. After installation, the path is under/usr/local/bin.
3. Install the xsp Server
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.10.tar.bz2tar -xjvf xsp-2.10.tar.bz2cd xsp-2.10./configuremakesudo make installcd ..
For more information, see./configure in [1 ].
4. insta
There are many ways to place multiple websites on a server. For example, in IIS of Win2003, each Web site is identified by three parts (IP address, port number, Host header name) to receive and respond to requests, we usually use the Host Header, that is, the IP address and
志
To modify the DNS resolution master configuration file
vim/etc/named.conf Front number for Vim editor serial number
Listen-on Port 53 {192.168.100.101;}; Modify the server address for your own IP address
allow-query {any;}; The listening port is for all
Vim/etc/named.rfc1912.zones Modifying a zone configuration file
Add two forward parsing
echo "NameServer 192.168.100.101" >/etc/resolv.conf Add DNS Resolution
DNS resolu
1. Domain-based virtual host (same IP and port for different domains)Provide the domain name of the virtual Web site to the DNS service so that when you access any of these virtual Web sites, you end up accessing the same IP address.2. Port-based virtual host (same IP on different ports)Typically used only for the same Web site, the names and IP addresses of their sites are often the same, but different TCP
client program to access the http://www.company1.com/ When index.html, the request header that is issued contains the following contents:
Get/index.html http/1.1
Host:www.company1.com
.....
After the WWW server program receives this request, it can check the "host:" Statement to determine which virtual host the client request is a service, and then further p
① Installing the Apache server$ sudo apt-get update$ sudo apt-get install apache2② Configuring a single IP multi-site$ sudo vi/etc/apache2/sites-available/000-default.conf#DocumentRoot/var/www/html comment out the line$ cat/etc/apache2/sites-available/000-default.conf|grep-v "#"ServerAdmin [email protected]ServerName www.tian.comDocumentRoot "/var/www/tian.com"Errorlog ${apache_log_dir}/error.logCustomlog $
# 1, if you open the virtual host, this must have (IP: port), found #NameVirtualHost *:80 modified to: Namevirtualhost 127.0.0.1:80 # 2, modify A standalone server is one that can build multiple websites, an IP address, a port
The method of this article probably can find the solution on the net, just is not very clear, in this in order to reduce the netizen like I so careless less take a detour, I wrote the next simple and clear process of setting up.
First of all, my server's environment:
Windows 2003 Server
apache_2.0.48
php4.2
(Our server is independent IP, the server does not insta
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.