Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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.

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 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. –  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 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. –  Aditya Shukla Feb 19 '11 at 1:35

Your Answer

 
discard

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.