LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1108|回复: 6

问一个关于Apache做网站的多域名访问问题!

[复制链接]
发表于 2005-2-28 15:17:06 | 显示全部楼层 |阅读模式
本人现有一台linux服务器。最近笔者把这个服务器重按装了系统,(因为这台服务器有一条专线联接,平时也闲着。本人想做一个web服务来使用。当时做的时候只是想自己使用,所以我把我的文件都放到了apache指定的根目录里了。域名做一个IP映射就可以了。可最近几个非常要好的朋友知道我的空间是自己的服务器,就事逼着我给开个空间。谁要都是我的好朋友呢?开就开吧。可是他们每个人都有自己的域名。想实现一个域名映射。这一步难着了。我以前用的收费空间。人家是可以在一个IP上映射多个IP的。可我不清楚这里面都要做那些工作。请高手帮忙指点一下。
我本人在此感谢您啦。希望 愿指点的朋友,说的稍清楚一点谢谢了。
发表于 2005-2-28 15:39:29 | 显示全部楼层
APACHE的虚拟主机系统。
这种功能很常见,看一下apache的说明文档就可以完成了。
非常方便。
回复 支持 反对

使用道具 举报

发表于 2005-2-28 15:52:34 | 显示全部楼层
以下是关于apahce的配置文件, 关于虚拟主机的.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

以下我用的用域名区分的:
NameVirtualHost 218.7.1.123:80
<VirtualHost www.longyu.com>  
    ServerAdmin pcstart@126.com  
    DocumentRoot /usr/local/tomcat/webapps/ROOT
    ServerName www.longyu.com
#    ErrorLog logs/dummy-host.example.com-error_log  
#    CustomLog logs/dummy-host.example.com-access_log common  
</VirtualHost>  

<VirtualHost msyl.longyu.com>
    ServerAdmin pcstart@126.com
    DocumentRoot /usr/local/tomcat/webapps/ROOT/msyl
    ServerName mysl.longyu.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-1 16:24:47 | 显示全部楼层
谢谢!搞定了。
回复 支持 反对

使用道具 举报

发表于 2005-3-1 16:40:49 | 显示全部楼层
楼主能不能给我开一个空间啊?

keke.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-5 01:04:20 | 显示全部楼层
可以。但只支持PHP、HTML数据库是MYSQL的。。。
行吗?空间是网通的。。10M。。不是很快。啊。。
回复 支持 反对

使用道具 举报

发表于 2005-3-5 11:19:50 | 显示全部楼层
行啊
感谢
我加你的QQ
谢谢了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表