 |
 |
How do you set up virtual hosting with different ports?
|
 |
|
 |
|
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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}
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |