<![CDATA[Latest posts for the topic "nhiều virtualhost trên chung 1 ip, cần giúp"]]> /hvaonline/posts/list/24.html JForum - http://www.jforum.net nhiều virtualhost trên chung 1 ip, cần giúp # abc.net virualhost # <VirtualHost abc.net:80> ServerAdmin root@localhost DocumentRoot /home/tiger/www/abc.net/ ServerName abc.net ServerAlias abc.net ErrorLog logs/abc.net-error_log CustomLog logs/abc.net-access_log common <Directory /> Order Deny,Allow Deny from all Options None AllowOverride None </Directory> <Directory /home/tiger/www/abc.net/> Order Allow,Deny Allow from all Options -ExecCGI -FollowSymLinks -Indexes AllowOverride All </Directory> </VirtualHost> # def.com virtualhost # <VirtualHost def.com:80> ServerAdmin root@localhost DocumentRoot /home/tiger/www/def.com/ ServerName def.com ServerAlias def.com def.net ErrorLog logs/def.com-error_log CustomLog logs/def.com-access_log common <Directory /> Order Deny,Allow Deny from all Options None AllowOverride None </Directory> <Directory /home/tiger/www/def.com/> Order Allow,Deny Allow from all Options -ExecCGI -FollowSymLinks -Indexes AllowOverride All </Directory> </VirtualHost>   cái này là httpd.conf của mình. mỗi lần restart httpd thì bị Starting httpd: [Mon Mar 11 23:58:57 2013] [warn] VirtualHost abc.net:80 overlaps with VirtualHost def.com:80, the first has precedence, perhaps you need a NameVirtualHost directive nó báo là một chuyện, mỗi lần vào def.com thì toàn bị trỏ vô trang chủ của abc.net :( còn đây là hosts file của mình
xxx.xxx.xxx.xxx abc.net abc def.com def.net 
mong các bác giúp -:|- ]]>
/hvaonline/posts/list/44398.html#274020 /hvaonline/posts/list/44398.html#274020 GMT
nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274021 /hvaonline/posts/list/44398.html#274021 GMT nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274023 /hvaonline/posts/list/44398.html#274023 GMT nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274025 /hvaonline/posts/list/44398.html#274025 GMT nhiều virtualhost trên chung 1 ip, cần giúp Code:
ServerName def.com
ServerAlias def.com def.net
thành Code:
ServerName www.def.com
ServerAlias www.def.com www.def.net
ok. Nhưng nếu để như cũ thì đúng là khi truy cập def.com sẽ trỏ sang abc.net]]>
/hvaonline/posts/list/44398.html#274028 /hvaonline/posts/list/44398.html#274028 GMT
nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274029 /hvaonline/posts/list/44398.html#274029 GMT nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274030 /hvaonline/posts/list/44398.html#274030 GMT nhiều virtualhost trên chung 1 ip, cần giúp Code:
ServerName def.com
ServerAlias def.com def.net
nên nó sẽ trỏ sang abc.net. Theo mình nghĩ nếu bạn thay đổi thứ tự của 2 vituarlhost thì sẽ xảy ra điều ngược lại đấy :D ]]>
/hvaonline/posts/list/44398.html#274031 /hvaonline/posts/list/44398.html#274031 GMT
nhiều virtualhost trên chung 1 ip, cần giúp Code:
# abc.net virualhost #

<VirtualHost *:80>

    ServerAdmin root@localhost
    DocumentRoot /home/tiger/www/abc.net/
    ServerName www.abc.net
    ServerAlias www.abc.net
    ErrorLog logs/abc.net-error_log
    CustomLog logs/abc.net-access_log common

<Directory />
  Order Deny,Allow
  Deny from all
  Options None
  AllowOverride None
</Directory>
<Directory /home/tiger/www/abc.net/>
  Order Allow,Deny
  Allow from all
  Options -ExecCGI -FollowSymLinks -Indexes
  AllowOverride All
</Directory>

</VirtualHost>

# def.com virtualhost #

<VirtualHost *:80>

    ServerAdmin root@localhost
    DocumentRoot /home/tiger/www/def.com/
    ServerName www.def.com
    ServerAlias www.def.com www.def.net
    ErrorLog logs/def.com-error_log
    CustomLog logs/def.com-access_log common

<Directory />
  Order Deny,Allow
  Deny from all
  Options None
  AllowOverride None
</Directory>
<Directory /home/tiger/www/def.com/>
  Order Allow,Deny
  Allow from all
  Options -ExecCGI -FollowSymLinks -Indexes
  AllowOverride All
</Directory>

</VirtualHost>

# hyj.org virtualhost #

<VirtualHost *:80>

    ServerAdmin root@localhost
    DocumentRoot /home/tiger/www/hyj.org/
    ServerName www.hyj.org
    ServerAlias www.hyj.org
    ErrorLog logs/hyj.org-error_log
    CustomLog logs/hyj.org-access_log common

<Directory />
  Order Deny,Allow
  Deny from all
  Options None
  AllowOverride None
</Directory>
<Directory /home/tiger/www/hyj.org/>
  Order Allow,Deny
  Allow from all
  Options -ExecCGI -FollowSymLinks -Indexes
  AllowOverride All
</Directory>

</VirtualHost>
vẫn bị]]>
/hvaonline/posts/list/44398.html#274032 /hvaonline/posts/list/44398.html#274032 GMT
nhiều virtualhost trên chung 1 ip, cần giúp Code:
<VirtualHost *:80>
    DocumentRoot "/var/www/html/abc.net"
    ServerName www.abc.net
    ServerAlias www.abc.net abc.net
    ErrorLog logs/abc-error_log
    CustomLog logs/abc-access_log common
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "/var/www/html/def.net"
    ServerName www.def.net
    ServerAlias www.def.net def.net
    ErrorLog logs/def-error_log
    CustomLog logs/def-access_log common
</VirtualHost>
Chú ý dòng Code:
ServerAlias www.def.net def.net
Nhớ xoá cache browser]]>
/hvaonline/posts/list/44398.html#274035 /hvaonline/posts/list/44398.html#274035 GMT
nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274036 /hvaonline/posts/list/44398.html#274036 GMT nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274037 /hvaonline/posts/list/44398.html#274037 GMT nhiều virtualhost trên chung 1 ip, cần giúp Starting httpd: [Mon Mar 11 23:58:57 2013] [warn] VirtualHost abc.net:80 overlaps with VirtualHost def.com:80, the first has precedence, perhaps you need a NameVirtualHost directive   http://httpd.apache.org/docs/2.2/mod/core.html#namevirtualhost]]> /hvaonline/posts/list/44398.html#274040 /hvaonline/posts/list/44398.html#274040 GMT nhiều virtualhost trên chung 1 ip, cần giúp /hvaonline/posts/list/44398.html#274057 /hvaonline/posts/list/44398.html#274057 GMT nhiều virtualhost trên chung 1 ip, cần giúp NameVirtualHost *:80 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. # # # 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 *:80> # 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> mặc định bị comment out, mò mẫm 1 hồi, bỏ comment của cái này ra, mọi thứ chạy yên ổn, mất luôn cái warn _default_ VirtualHost overlap on port 80. còn khai báo virtualhost thì mình để là <VirtualHost *:80> cám ơn các bác giúp đỡ ^^]]> /hvaonline/posts/list/44398.html#274145 /hvaonline/posts/list/44398.html#274145 GMT