LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-15-2005, 06:33 PM   #1
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Rep: Reputation: 30
apache vhosts w/ namevirtualhosts ans ssl


I have played with a number of different configurations and just cannot get this worked out. I guess I would be happy to implement a way for apache to serve up nothing if the match is not perfect. But just to get it to serve one default port 80 page would be great.

Basically I have:

listen 80
listen 443
listen 888

namevirtualhosts 192.168.0.1:80

<virtualhost 192.168.0.1:80>
servername mydomain.com
</virtual host>

<virtualhost 192.168.0.1:80>
servername anotherdomain.com
</virtualhost>

<virtualhost 192.168.0.1:80>
servername webmail.anotherdomain.com
</virtual host>

<virtualhost 192.168.0.1:443>
servername webmail.mydomain.com
SSLEngine on
</virtualhost>

<virtualhost 192.168.0.1:888>
servername database.mydomain.com
SSLEngine on
</virtual host>

Basically apache is picking the closest match for each http and https. So if I enter http://webmail.mydomain.com it serves mydomain.com which is the firs http in the list. It is making the request on port 80.

If I enter https://mydomain.com it serves webmail.mydomain.com. There has to be a way to handle people not entering the correct protocol.

I would be happy with a catch everything but a perfect match where I could redirect or something.

I appreciate any ideas.

Tom
 
Old 02-16-2005, 02:06 AM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Look into redirect. mod_rewrite is needed by apache for that to happen.

-twantrd
 
Old 02-16-2005, 05:15 AM   #3
eagles-lair
Member
 
Registered: Nov 2004
Location: Adelaide, Australia
Distribution: Lindows/Linspire, SuSE, PC-BSD, ubuntu, puppy
Posts: 239

Rep: Reputation: 30
The Apache users email list is a great source of help. I currently run 13 vhosts on a 1.3.28 or on a 1.3.31 (both on removeable drives on the same machine - with a minimum of fuss.

If you get badly stuck, we could talk privately about detail in your httpd.conf file that might be the problem.

I run a D-Link DSL-504 router with port forwarding on port 80. There was no difficulty setting that up, either.

Get back to me if you need to, I'm no expert
 
Old 02-17-2005, 04:31 PM   #4
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Original Poster
Rep: Reputation: 30
I finally broke down and used two of my public ip's to solve this. The all the port 80 stuff resolves to one ip and is sorted out by namevirtuahost directive. The each ssl virtual host then gets its own ip. Now if the client enters http for a ssl enabled page (or conversly https for a port 80) it of course resolves but times out because my firewall explicitly names 443 (or 80) port for fowarding.

Just seems like there would be a solution other than burning ip's. I will need them back soon so please offer up any ideas
 
Old 02-17-2005, 08:48 PM   #5
nazdrowie
Member
 
Registered: Oct 2004
Distribution: Debian
Posts: 39

Rep: Reputation: 15
I'm no expert by any means, but it definitely sounds like your problem is related to the fact that you can't run SSL with name-based virtual hosts:

http://httpd.apache.org/docs-2.0/vhosts/name-based.html

(check the second bullet from the top, which says:
"Name-based virtual hosting cannot be used with SSL secure servers because of the nature of the SSL protocol.")
 
Old 02-17-2005, 09:10 PM   #6
eagles-lair
Member
 
Registered: Nov 2004
Location: Adelaide, Australia
Distribution: Lindows/Linspire, SuSE, PC-BSD, ubuntu, puppy
Posts: 239

Rep: Reputation: 30
nazdrowie that's what it looks like from here too.

The main problem with Apache documentation is the amount of it (so much) and not knowing where of many places you can find the bit you need right now!

And as mentioned before, their user lists are very forgiving towards people who have looked and not found the answers.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Vhosts in apache please. GEEF Linux - Software 2 10-29-2004 07:18 PM
SSL and vhosts wolftechmn Linux - Security 6 01-08-2004 08:42 AM
apache 2.0.44 vhosts sqn Slackware 4 06-19-2003 12:54 AM
apache vhosts question sqn Linux - Networking 0 04-01-2003 04:27 PM
Vhosts on RH 8.0 - Apache 2.0.40 Drogo Linux - Software 5 02-06-2003 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:49 PM.

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