Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

This works so that works properly but also works.Is there a way to restrict virtual host so that it's not listen on port 80 for the servername

share|improve this question

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.

share|improve this answer
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 i want to acept connection :443 for one subdomain and reject for :80 on that subdomain,while listening on port 80 for another subdomain. – Aditya Shukla Feb 19 '11 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... – voretaq7 Feb 19 '11 at 1:23
One solution i am thinking of involves mod_rewrite and whenever i redirect to the way like your blog post about bsd and linux .Are you on twitter:).I would like to follow you. – Aditya Shukla Feb 19 '11 at 1:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.