Solved

Virtual Hosts on Mac Tiger

Posted on 2006-06-24
3
376 Views
Last Modified: 2013-11-18
I am running Mac Tiger (10.4) with the default Apache server. I am trying to set up virtual hosts and have followed directions from a number of different sources but cannot get this to work. My goal is to use my local machine as a development machine for a few websites so I need about 4 virtual hosts. In the httpd:
NameVirtualHost 127.0.0.1
#
# 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 *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot /Library/Webserver/Documents
ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot /Library/Webserver/Documents
ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot /localsite
ServerName localsite
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot /
ServerName testsite
</VirtualHost>

1. All of the examples I read about use www.example.com as a path. I do not understand why. It seems like you could just use folder names.
2.  I am getting A 403 Forbidden error.
3. Can an expert help me with this. Please post specific instructions and apparently there is a difference between Panther setup and TIger setup. I am using NetInfoManager to add the dns. I am not sure what that means but one of the instructions said to do so.

0
Comment
Question by:MarleneAyers
3 Comments
 
LVL 2

Accepted Solution

by:
alexsergeyev earned 250 total points
ID: 16980668
You have two "localhost" blocks. That isn't right.

UseCanonicalName Off

All hostnames should be resolvable to IP address 127.0.0.1 (testsite and localsite)

Directive
    DocumentRoot /

is really dangerous, are you sure that you wanted to make Apache serving root filesystem directory?

If /Library/Webserver/ is your main directory to place sites under it, you might want to add/check block in config similar to:

<Directory "/Library/Webserver">
    Options Indexes FollowSymLinks MultiViews Includes
    # AllowOverride All # if you want to use .htaccess files or other value from manual
    Order allow,deny
    Allow from all
</Directory>

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question