Set up multiple domains but been redirect to one single domain

Issues related to configuring your network
Post Reply
abelwang
Posts: 2
Joined: 2017/08/09 09:22:19

Set up multiple domains but been redirect to one single domain

Post by abelwang » 2017/08/09 09:24:24

I had set up multiple domains but all domains been redirect to single domain when i visit them. i already google search but cant find any solution. here my ssl.config and httpd.config code

<VirtualHost *:443>
ServerAdmin webmaster@market-sg.com
ServerName coffeeshop88.com
ServerAlias www.coffeeshop88.com
DocumentRoot "/var/www/html/coffeeshop"
SSLEngine on
SSLCertificateFile /etc/ssl/certs/certificate.crt
SSLCertificateKeyFile /etc/ssl/certs/private.key
SSLCACertificateFile /etc/ssl/certs/ca_bundle2.crt
<Directory //var/www/html/coffeeshop >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

<VirtualHost _default_:443>
ServerAdmin webmaster@awsc.com.sg
ServerName awsc.com.sg
ServerAlias www.awsc.com.sg
DocumentRoot /var/www/html/awsc
SSLEngine on
SSLCertificateFile /etc/ssl/certs/certificate.crt
SSLCertificateKeyFile /etc/ssl/certs/private.key
SSLCACertificateFile /etc/ssl/certs/ca_bundle2.crt
<Directory /var/www/html/awsc >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

<VirtualHost _default_:443>
ServerAdmin webmaster@awsc.com.sg
ServerName wefondyou.com
ServerAlias www.wefondyou.com
DocumentRoot /var/www/html/wefondyou.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/certificate.crt
SSLCertificateKeyFile /etc/ssl/certs/private.key
SSLCACertificateFile /etc/ssl/certs/ca_bundle2.crt
<Directory /var/www/html/wefondyou.com >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

<VirtualHost _default_:443>
ServerAdmin webmaster@awsc.com.sg
ServerName djobs.com.sg
ServerAlias www.djobs.com.sg
DocumentRoot /var/www/html/djobs
SSLEngine on
SSLCertificateFile /etc/ssl/certs/certificate.crt
SSLCertificateKeyFile /etc/ssl/certs/private.key
SSLCACertificateFile /etc/ssl/certs/ca_bundle2.crt
<Directory /var/www/html/djobs >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

All visit are been redirected to awsc.com.sg
please help
Thanks!!

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Set up multiple domains but been redirect to one single domain

Post by mghe » 2017/08/09 10:25:52

Add domain to <VirtualHost your_domain:443> against '_default_'

https://httpd.apache.org/docs/2.4/vhosts/examples.html

abelwang
Posts: 2
Joined: 2017/08/09 09:22:19

Re: Set up multiple domains but been redirect to one single domain

Post by abelwang » 2017/08/09 11:46:23

i edited all to <VirtualHost *:443> it still the same. can you help me understand better?

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Set up multiple domains but been redirect to one single domain

Post by mghe » 2017/08/09 12:37:47

example: <VirtualHost google.com:443>

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Set up multiple domains but been redirect to one single domain

Post by TrevorH » 2017/08/09 13:26:44

Not tried on httpd 2.4 but on el6 you used to have to be able to resolve the domain name to an ip address that was on the box you were hosting on. So if you use a vhost called a.b.c then host a.b.c run on that machine needs to resolve to an ip that is on that machine too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply