0

I have been trying to host 2 site site A and site B in apache web server the configuration are given bellow:

Site A

<VirtualHost sitea.com.au:443> ServerName "sitea.com" ServerAlias sitea.com DocumentRoot "/home/sitea.com" ....... </VirtualHost> 

Site B

<VirtualHost siteb.com.au:443> ServerName "siteb.com" ServerAlias siteb.com DocumentRoot "/home/siteb.com" ....... </VirtualHost> 

The issue I am facing is: Site A https requests are working properly, but for site B all the request are redirected to site A. When I remove the site A configuration file, site B is working properly. Individually sites are working fine, but together they are causing issue.

6
  • 1
    Why do you have names in the <VirtualHost>? Commented Apr 20, 2015 at 17:50
  • I have tried removing the name too like <VirtualHost *:443> but still not working Commented Apr 20, 2015 at 17:55
  • Michael Hampton has right, with *:443 should it work, your current version doesn't help anything. What are doing the ""-s after your ServerName? They doesn't look really okay. Try to use simply siteb.com, instead of "siteb.com". Commented Apr 20, 2015 at 18:00
  • Thanks Michael and peterh, tried that removing " " but it didn't helped Commented Apr 20, 2015 at 18:08
  • What gives an apachectl -S? Can you see both of your vhosts in its output? Commented Apr 20, 2015 at 18:09

1 Answer 1

1

Noticed that you have: ServerName "sitea.com"

So is the site sitea.com.au or is it sitea.com? And more importantly, how are you attempting to access the site(s) in a browser? Are you using the FQDN's that are properly defined in your conf file?

As mentioned above, you should change your VirtualHost lines to be as it should be IP:Port, it is the ServerName that should denote the FQDN that is coming in.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.