Solved

Virtual Hosts on Mac Tiger

Posted on 2006-06-24
3
357 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
Comment Utility
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now