LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-30-2005, 10:30 AM   #1
belorion
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 124

Rep: Reputation: 16
Apache ssl on only *one* vhost


Hello everyone. I recently got Apache (1.0.49) up and running with openssl and everything seems to be working just fine.

I have one vhost I wanted working over SSL. All others I want to be standard http. So, I have my 1 vhost (foo.mydomain.com) listening on port 443, all others listen on 80.

For arguments sake:

foo.mydomain.com:443
mydomain.com:80
bar.mydomain.com:80

However, *all* requests sent over https:// go to foo.mydomain.com instead of say mydomain.com or bar.mydomain.com (it catches *everything*, even thissubdomaindoesntexist.mydomain.com). I don't want anything to work over SSL except requests sent specifically to foo.mydomain.com.

My first thought was to specify this in my vhost directive:

<VirtualHost foo.mydomain.com:443>
ServerName foo.mydomain.com

instead of

<VirtualHost *:443>
ServerName foo.mydomain.com

But it still grabs *all* https requests. So then I thought I might create a second vhost that also listens on 443 (ala <VirtualHost *:443>) which has a document root equivalent to mydomain.com's docroot, but still, foo.mydomain.com:443 is catching *everything*

Any idea what to do? I don't want any https requests to go through unless foo.mydomain.com is specified exactly.
 
Old 12-01-2005, 03:59 PM   #2
babysparrow
Member
 
Registered: Nov 2005
Location: Worcestershire,UK
Distribution: Used nearly all but now just using Lubuntu 18.04lts and 20.04 lts
Posts: 94

Rep: Reputation: 19
I hope your apache version is not 1.0.49 as you stated (!?).

First thing is that you're using name based virtual hosting.

For accuracy it's best - IMHO - to use ip based virtual hosts. (<Virtualhost nn.nn.nn.nn:nnn>)

If you GET / from hostname.blah.cxm:443 , apache will be resolving hostname.blah.cxm to the real ip and that ip will always be the same one and so it will end up at - you guessed it ... -> ip:443.


I'll have a fiddle when I've more time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache vhost problem jelgavchik Linux - Software 4 04-27-2008 04:45 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
vhost in apache jelgavchik Linux - Networking 3 02-07-2005 06:41 PM
Apache 2 vhost and permissions basse- Linux - Software 1 04-05-2004 07:48 AM
apache 1.3 vhost z4Rilla Linux - Software 0 08-03-2003 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration