你的位置:首页 > 软件开发 > 操作系统 > Virtual Host on Apache(Apache上建立虚拟主机)

Virtual Host on Apache(Apache上建立虚拟主机)

发布时间:2015-04-23 18:03:03
0. IntroductionUsually, we want to build two or more websites on a web server, but we have only one IP and do not want to use ports (eg. www ...

0. Introduction

Usually, we want to build two or more websites on a web server, but we have only one IP and do not want to use ports (eg. www.abc.com:8081) to visit webpages.

So, how to make www.a.com and www.b.com both point to server X.X.X.X ?

1. Environment

Ubuntu 14.04 x64

Bitnami LAMP Stack 5.4.40

2. Steps

2.0. Configure "A" records of www.a.com and www.b.com to IP X.X.X.X

2.1. Make new dirs in .../apache2/htdocs for these two sites, such as, htdocsa and htdocsb

2.2. Modify .../apache2/conf/httpd.conf, add following codes:

NameVirtualHost X.X.X.X<VirtualHost X.X.X.X:80>ServerAdmin admin@a.comDocumentRoot /opt/lampstack-5.4.40-0/apache2/htdocs/htdocsaServerName www.a.com</VirtualHost>NameVirtualHost X.X.X.X<VirtualHost X.X.X.X:80>ServerAdmin admin@b.comDocumentRoot /opt/lampstack-5.4.40-0/apache2/htdocs/htdocsbServerName www.b.com</VirtualHost>

原标题:Virtual Host on Apache(Apache上建立虚拟主机)

关键词:Apache

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录