NYCPHP Meetup

NYPHP.org

[nycphp-talk] Apache config question

Jeff jsiegel1 at optonline.net
Sat Sep 6 08:03:49 EDT 2003


Why is it that within four minutes of posting something that you
suddenly come up with the answer to your own question? Well...here's one
solution that worked. Let me know if there are better ways to do this.

I set Listen:

Listen 80
Listen 192.168.1.111:8080

I then set: NameVirtualHost 192.168.1.111

Finally...I did this.

<VirtualHost 192.168.1.111:80>
        DocumentRoot /var/www/html/clientproj1
        ServerName www.clientproj1.com
</VirtualHost>


<VirtualHost 192.168.1.111:8080>
        DocumentRoot /var/www/html/jeff
        ServerName www.myproj.com
</VirtualHost>

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of Jeff
Sent: Saturday, September 06, 2003 6:36 AM
To: 'NYPHP Talk'
Subject: [nycphp-talk] Apache config question


I'm not sure how to handle this. I'm setting up a new server at the
office. I'd like to be able to set up a directory structure like this:

	/var/www/html/clientproj1  <= for client stuff
	/var/www/html/myproj <= for whatever other project I may work on

I started effing around with virtual host (see below) which works fine
for this one instance but it's not obvious how to set up another virtual
host since I really don't have "names" for each one. I access everything
using the IP address.

This works!
<VirtualHost 192.168.1.111>
	DocumentRoot /var/www/html/clientproj1  
	ServerName www.clientproj1.com
</VirtualHost>

This DOESN'T work if combined with above. The two "overlap" according to
Apache's configtest.
<VirtualHost 192.168.1.111>
	DocumentRoot /var/www/html/myproj
	ServerName www.myproj.com
</VirtualHost>

I think the answer is buried somewhere in here
(http://httpd.apache.org/docs-2.1/vhosts/examples.html) but after trying
a few different things, e.g., 192.168.1.111:8080, I couldn't get it to
work with another subdir like "myproj." Suggestions?

Jeff

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list