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 > macOS > OK, here's a REAL question...

OK, here's a REAL question...
Thread Tools
crystalthunder
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Mar 7, 2002, 08:00 PM
 
Now that my server is in full swing, I have a DNS server pointing two domain names to the same machine. What is the best way to direct each domain name to a given directory on my server?
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
kidtexas
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status: Offline
Reply With Quote
Mar 7, 2002, 08:06 PM
 
I assume you mean web serving. Setup a virtual server in Apache. I would check Apache pages on the web, but it goes something like this in the /etc/httpd/httpd.conf file. Just uncomment (remove the #) in front of the NameVirtualHost * line, and then reproduce (without #'s) <VirtualHost *> block.

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> #
# Use name-based virtual hosting.
#
NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#&lt;VirtualHost *&gt;
# #ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# #ServerName <A HREF=<font color = red>"http:<font color = brown>//www.example.com"</font> TARGET=_blank>www.example.com</A> </font>
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#&lt;/VirtualHost&gt; </font>[/code]

Mine looks something like this:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
&lt;VirtualHost *&gt;
ServerAdmin [email protected]
DocumentRoot /Library/WebServer/folder
ServerName your.domainname.com
&lt;/VirtualHost&gt; </font>[/code]
     
crystalthunder  (op)
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Mar 7, 2002, 11:23 PM
 
Ok. Thank you very much! I knew it had something to do w/ virtual hosts, and you explained it perfectly to me. I'll try it out first thing tomorrow!
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
crystalthunder  (op)
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Mar 8, 2002, 12:38 AM
 
BTW, you seem pretty experienced in the httpd.conf file. You wouldn't happen to add another default directory page would you? I'm almost posotive that isn't the correct term for what I want, but I am talking about whenever you access a directory from the web, the server goes to the index.html or index.htm. How do I add, for example, index.php? What I mean is how can I make it so when I go into a directory how can I make the server open the index.php file instead of just list the directory? Thank you again!
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
prolix
Forum Regular
Join Date: Oct 2000
Location: my powerbook :)
Status: Offline
Reply With Quote
Mar 8, 2002, 01:06 AM
 
i took this from the config on my linux box, but it should be hte same in osX

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
&lt;IfModule mod_dir.c&gt;
DirectoryIndex default.htm index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
&lt;/IfModule&gt;
#

just add whatever ones you want and restart apache and you're good to go
     
mftalon
Forum Regular
Join Date: Apr 2001
Location: Boise
Status: Offline
Reply With Quote
Mar 8, 2002, 02:19 AM
 
That is correct however that I found out after a little frustration that the macosxserver.conf file overrides the directory index settings of the httpd.conf file.

So I added it to both just to be safe.
You have to wonder...
www.creativebush.com
     
crystalthunder  (op)
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status: Offline
Reply With Quote
Mar 8, 2002, 03:10 AM
 
Thanks!
15" PowerBook G4 1.5 GHZ w/ 128MB VRAM
512MB DDR SDRAM 1 SODIMM
80GB 5400 RPM HD
Mac OS X 10.3.4
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 10:45 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,