LinuxQuestions.org
Help answer threads with 0 replies.
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 05-24-2006, 10:33 AM   #1
danthach
LQ Newbie
 
Registered: May 2006
Posts: 2

Rep: Reputation: 0
need help with apach virtual hosts ssl/non ssl sites


Hi, I have been struggling for days trying to figure out why I can add another non-secure site to my server machine. Im using Apache 2.0 and have site1 using SSL using ports 80 and 443. I need to add a new site2 on port 80. Everytime I type in the site2, I always get the site1. Yes, I have searched the forum, and havent had luck solving my problem. Here is my httpd.conf file. Can someone help please!

Listen 192.168.1.102:80
Listen 192.168.1.102:443
Listen 192.168.1.101:80

<VirtualHost 192.168.1.102:443>
# General setup for the virtual host
DocumentRoot "E:/Programs/Apache Server 2.0/Apache2/test/oscommerce2.2ms2/catalog"
ServerName site1:443
ServerAdmin me
ErrorLog logs/error_log
TransferLog logs/access_log

# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
</virtualhost>

<VirtualHost 192.168.1.101:80>
SSLEngine off
ServerName site2:80
ServerAlias skylightstudios.net *.skylightstudios.net
DocumentRoot "E:/Programs/Apache Server 2.0/Apache2/skylight_studios"
</VirtualHost>
 
Old 05-24-2006, 10:48 AM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
I'm assuming site1 is listed in httpd.conf first, although you have not shown it. In that case, my first suspicion would be that the host headers are not making it to Apache properly.

If I may over-simplify: When Apache receives a request, it looks to see if there is only one site on the requested IP. If so, it serves it. If not, it checks the host headers. If there is a match between the the IP address and host headers in the requests, it servers that site. If there is no match, it serves the first site listed in httpd.conf.

Try changing "ServerName site2:80" to just "ServerName site2" and see if that resolves the issue.
 
Old 05-24-2006, 11:01 AM   #3
danthach
LQ Newbie
 
Registered: May 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Hey, thanks for the help. But it didnt work, I get this error.

Forbidden
You don't have permission to access / on this server.

I think I tried every possible solution out there and I still cant get this figured out. BTW, Im a n00b. What are host headers?
 
Old 05-25-2006, 06:40 AM   #4
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
Host headers are additional information sent by a browser to a web server in its request. Behind the scenes, the browser's request for http://site1/index.html really looks like this:
Code:
GET /index.html HTTP/1.1
Host: site1
This allows for name-based hosting, where multiple websites can be hosted on a single IP address.

As for your error, I am assuming you are still trying to get to site2. In that case, I would check the permissions on the directory
E:/Programs/Apache Server 2.0/Apache2/skylight_studios

The Apache user needs to have read and execute permissions on that folder. The Apache user is normally "apache" or "nobody" on *nix systems, not sure on Windows. See if you have either of those users. If not, the Apache installation probably created a default site in E:\Programs\Apache Server 2.0\Apache2, maybe at E:\Programs\Apache Server 2.0\Apache2\var\www\html. If so, check the permissions on that directory to get you going in the direction.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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-ssl setup virtual hosts notolerance Linux - Software 3 12-22-2005 04:20 PM
Apache + SSL + Virtual Hosts otisthegbs Linux - Software 3 10-05-2004 07:59 PM
Mulltiple SSL Virtual Hosts w/Apache jrbush82 Linux - Software 3 04-12-2004 02:49 PM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 09:48 PM
How to have SSL on two different pages/sites? Manuel-H Linux - General 1 08-05-2003 08:53 AM


All times are GMT -5. The time now is 10:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration