0

I have set up virtual host in the config file so that VirtualHost ipaddress:443 ServerName abc.xyz.com

This works so that https://abc.xyz.com works properly but http://abc.xyz.com also works.Is there a way to restrict virtual host so that it's not listen on port 80 for the servername abc.xyz.com?

1 Answer 1

1

Yes: Change your Listen directives in your apache configuration (and optionally specify specific IP addresses and ports in your VirtualHost directives).
See the Apache documentation for more information.

3
  • Thanks for the reply .I understand listen directive will determine the pots and ip on which the apache webserver wil listem for requests.I have one webserver , 1 ip address and multiple subdomains.so i want to acept connection :443 for one subdomain and reject for :80 on that subdomain,while listening on port 80 for another subdomain. Commented Feb 19, 2011 at 0:32
  • @Aditya there is no way I'm aware of to do what you're asking with 1 IP -- If someone hits that IP on port 80 they'll get the site listening on that port. You could do a NameVirtualHost and redirect the appropriate name to the SSL site, but that's about the best I can come up with... Commented Feb 19, 2011 at 1:23
  • One solution i am thinking of involves mod_rewrite and whenever abc.xyz.com i redirect to abc.xyz.com.By the way like your blog post about bsd and linux .Are you on twitter:).I would like to follow you. Commented Feb 19, 2011 at 1:35

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.