Solved

Virtual Hosts on Mac Tiger

Posted on 2006-06-24
3
368 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

770 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