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 > Apache on OS X client -- how to create seperate "sites" based on port

Apache on OS X client -- how to create seperate "sites" based on port
Thread Tools
Dedicated MacNNer
Join Date: Jan 2001
Location: Meida, PA USA
Status: Offline
Reply With Quote
Jun 19, 2002, 04:06 PM
 
Ok. So I have the apple hand me down ver. of Apache running with lots of goodies I added or enabled (PHP, MySQL. Perl, CGI, etc.)

Right now I put all the files for my copy of ASD in /Library/WebServer/Documents/ and it works well. However I have two other sites I'm working on (my personal one and a client)

What I am hoping to do is create
/Library/WebServer/mikezornek/
/Library/WebServer/drexel/

and create two new sites in apache, give them different ports (so i can call 127.0.0.1:1212 and get mikezornek and another port to get to drexel

One of the main reasons I want to do this is I really enjoy using absolute paths like /style.css in html and php.
~ Mike
--
Personal Site: MikeZornek.com
Other Interests: WebDevWiki.com
     
Mac Elite
Join Date: Dec 2001
Location: Durham, NC
Status: Offline
Reply With Quote
Jun 23, 2002, 03:27 AM
 
[This reply assumes you've dealt a little with editing your apache config file. If not, skim the docs or just read the comments in the default config file...] Doing what you need is pretty simple, though I don't remember where I found the instructions:
1. open your /etc/httpd/httpd.conf for editing.
2. Add a Listen directive for the port number; that is, for port, say, 3000, add a line that says
Listen 3000
3. Add a <VirtualHost> directive. The opening tag would say <VirtualHost _default_:3000> (usting the same example port number).. inside the <VirtualHost> container, you want a "Port 3000" directive and a DocumentRoot directive pointing to the desired directory. Add whatever else you need to inside the <VirtualHost> directive.
4. Repeat steps 2 and 3 as needed for additional ports..

Note: the "Listen" line goes in the main body of the config file, not in any container-style directives.. There should already be some commented Listen lines in the file, so I just added one below those..
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by zorn:
<strong>Ok. So I have the apple hand me down ver. of Apache running with lots of goodies I added or enabled (PHP, MySQL. Perl, CGI, etc.)

Right now I put all the files for my copy of ASD in /Library/WebServer/Documents/ and it works well. However I have two other sites I'm working on (my personal one and a client)

What I am hoping to do is create
/Library/WebServer/mikezornek/
/Library/WebServer/drexel/

and create two new sites in apache, give them different ports (so i can call 127.0.0.1:1212 and get mikezornek and another port to get to drexel

One of the main reasons I want to do this is I really enjoy using absolute paths like /style.css in html and php.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">
     
   
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 10:31 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