Page 1 of 1

[SOLVED] Ports point to certain directories on Apache 2.x?

Posted: Sat Jan 28, 2006 12:11 am
by phice
I'd like to point a given port (127.0.0.1:296) to a given directory in the htdocs folder. I'm sure it'd be pretty easy because you can modify the port 80 value, but I'm not definate. I'd like to have multiple ports point to different folders which is the main reason behind wanting this.

If you could help me with this, I would greatly appreciate it.

Posted: Fri Feb 03, 2006 2:16 pm
by phice
Any help guys?

Posted: Fri Feb 03, 2006 2:19 pm
by timvw

Code: Select all

<Virtualhost 127.0.0.1:123>
 DocumentRoot /var/123
</VirtualHost>

<VirtualHost 127.0.0.1:321>
 DocumentRoot /dev/network
</Virtualhost>

Posted: Fri Feb 03, 2006 2:39 pm
by phice
Are those full directory URI or relative to the htdocs folder?

Posted: Fri Feb 03, 2006 2:52 pm
by phice
Looks like you forgot the Listen variable.

Code: Select all

# 81 - /dir1/
Listen 81
<Virtualhost *:81>
	DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/dir1/"
</VirtualHost>

# 82 - /dir2/
Listen 82
<Virtualhost *:82>
	DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/dir2/"
</VirtualHost>

# 83 - /dir3/
Listen 83
<VirtualHost *:83>
	DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/dir3/"
</Virtualhost>

- Don

Posted: Fri Feb 03, 2006 3:59 pm
by timvw
I knew i forgot something, but i was too lazy to look it up (have posted VirtualHost stuff already way too many times in here).

Anyway, i believe most of my examples have a Listen 127.0.0.1:* or Listen *:80 statement... (Depending on what type of virtualhost you want)

Posted: Fri Feb 03, 2006 4:39 pm
by phice
Wouldn't 127.0.0.1:* listen to all available ports? I would think that's a bad thing unless I'm forgetting something.

Posted: Fri Feb 03, 2006 5:26 pm
by timvw
You've got a point there ;)