Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How do you set up virtual hosting with different ports?

How do you set up virtual hosting with different ports?
Thread Tools
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Feb 23, 2003, 12:09 PM
 
I want to host 2 web sites on my computer. My main one works fine (port 80). I set up one for port 8080 but it just ends up at the port 80 site. heres what i changed in /etc/httpd/httpd.conf:

Code:
# Use name-based virtual hosting. # NameVirtualHost 127.0.0.1 Listen 80 <VirtualHost 127.0.0.1> DocumentRoot /Library/WebServer/Documents ServerName localhost </VirtualHost> Listen 8080 <VirtualHost 127.0.0.1:8080> DocumentRoot /Library/WebServer/Documents/roan/ ServerName www.roan.site # ServerName localhost:8080 </VirtualHost>
do i have to add a 'NameVirtualHost 127.0.0.1:8080' ?

thanks

-daveninja.com
daveninja.com
     
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Feb 23, 2003, 10:21 PM
 
Are you pasting exactly what you have in httpd.conf? The syntax for those VirtualHost directives is totally wrong...
     
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Feb 24, 2003, 10:16 AM
 
Originally posted by mrbiiggy2:
Are you pasting exactly what you have in httpd.conf? The syntax for those VirtualHost directives is totally wrong...
Yeha, thats what i got in httpd.conf, i copied it from some site. what am i missing/what do it need in there?

thanks
-dave

Editted: I fixed part of the code, the {} signs for 'greater-than'/'lessthan' signs
(Last edited by DaveNinja; Feb 24, 2003 at 12:40 PM. )
daveninja.com
     
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Feb 25, 2003, 12:59 AM
 
I put the Listen way up at the top of httpd.conf, then the virtual host entries almost at the end. Here's an example that works fine for me when using http://localhost:8080 in chimera.

{VirtualHost 127.0.0.1:8080}
ServerName localhost
DocumentRoot "/home/wind/wind-www"
{/VirtualHost}
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:49 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2