|
|
OK, here's a REAL question...
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jan 2001
Location: usa
Status:
Offline
|
|
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.
#
#<VirtualHost *>
# #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
#</VirtualHost> </font>[/code]
Mine looks something like this:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
<VirtualHost *>
ServerAdmin [email protected]
DocumentRoot /Library/WebServer/folder
ServerName your.domainname.com
</VirtualHost> </font>[/code]
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2000
Location: my powerbook :)
Status:
Offline
|
|
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.
#
<IfModule mod_dir.c>
DirectoryIndex default.htm index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
</IfModule>
#
just add whatever ones you want and restart apache and you're good to go
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2001
Location: Boise
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Sep 2001
Location: Cedar Rapids, Iowa
Status:
Offline
|
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|