Jerielle
Jerielle

Reputation: 7520

URL wont direct correctly

I have a problem with my vhost names. I am setuping a vhost in CentOS based OS. In the host file I added 2 vhost URL. And I also edit the httpd.conf file. I added the vhost directory. I restarted the httpd and I opened the URL in the browser. But it doesn't go to my page. It redirect to other page. Asking for hostnames. Here's my setup.

In my httpd.conf I have this:

<VirtualHost *:80>
    DocumentRoot /data/APACHE/html/metro
    ServerName store6.giftregistry.com.ph
    ServerAlias store6.giftregistry.com.ph
    <Directory "/data/APACHE/html/metro">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /data/APACHE/html/metro
    ServerName store7.giftregistry.com.ph
    ServerAlias store7.giftregistry.com.ph
    <Directory "/data/APACHE/html/metro">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

In the hosts file I have this:

10.128.0.63       store6.giftregistry.com.ph
10.128.0.63       store7.giftregistry.com.ph

Is there a mistake with my code?

Upvotes: 0

Views: 24

Answers (1)

Gabriel Amram
Gabriel Amram

Reputation: 2790

add

NameVirtualHost *:80

on top..

documentation : http://httpd.apache.org/docs/2.2/vhosts/name-based.html

Upvotes: 1

Related Questions