Heim  >  Artikel  >  Backend-Entwicklung  >  apache 虚拟ip,apacheip_PHP教程

apache 虚拟ip,apacheip_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:21:43980Durchsuche

apache 虚拟ip,apacheip

 

参考 http://blog.sina.com.cn/s/blog_5d8ca1e90100hnpv.html

 

 
    DocumentRoot  C:/xampp/htdocs/yiyunmap
    ServerName 127.0.0.1:80   
 
 
 
 
    DocumentRoot C:/xampp/htdocs/user  
    ServerName 127.0.0.2:80   



 

 
    Options Indexes FollowSymLinks Multiviews   
    AllowOverride All   
    Order Allow,Deny   
    Allow from all   
 
 
 
    Options Indexes FollowSymLinks Multiviews   
    AllowOverride All   
    Order Allow,Deny   
    Allow from all   
 

Linux基于IP地址的虚拟主机配置Apache服务

步骤一:为主机中的不同网卡设置各自的IP地址
# ifconfig eth0 192.168.149.1
# ifconfig eth0:1 192.168.149.2
步骤二:在httpd.conf配置文件中,为每个虚拟主机设置不同

配置段

ServerAdmin root@abc.com
DocumentRoot /www/abc
ServerName www.abc.com


ServerAdmin root@good.com
DocumentRoot /www/good
ServerName www.good.com

步骤三:为不同的虚拟站点创建主页文件
# echo 'Welcome to abc' > /www/abc/index.html
# echo 'Welcome to GOOD' > /www/good/index.html
步骤四:重新启动Apache服务
# service httpd restart
 

虚拟IP,公司做了一个apache+tomcat集群,但如果apache宕掉,集群就失效了,现在说是用虚拟IP

apache主要是应用层的软件,LVS主要是网络层和传输层的软件。虽然都可以做转发,但定位不同:
apache主要功能还是WEB服务,在高可用和可扩展方面是比较弱的,其转发功能是为了扩展而实现的附加功能;
LVS是基于linux内核的负载均衡系统,结合keepalived,或heartbeat+Ldirectord,或红帽piranha等高可用套件,在负载均衡、高可用和可扩展方面是专业的,常用于高并发WEB服务。
 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/853718.htmlTechArticleapache 虚拟ip,apacheip 参考 http://blog.sina.com.cn/s/blog_5d8ca1e90100hnpv.html VirtualHost 127.0.0.1:80 DocumentRoot C:/xampp/htdocs/yiyunmap ServerName 127.0.0.1:80 /Virtu...

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn