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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

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

Post 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.
Last edited by phice on Fri Feb 03, 2006 2:54 pm, edited 2 times in total.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Any help guys?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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>
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

Are those full directory URI or relative to the htdocs folder?
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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)
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You've got a point there ;)
Post Reply