• How to enable (configure) virtual hosts on Mac OSX 10.4

    From TPK@tim.kern@comcast.net to comp.sys.mac.system on Saturday, April 22, 2006 13:35:43
    From Newsgroup: comp.sys.mac.system

    Greetings,
    I deal with a number of websites. Traditionally I fire up my server and
    develop to it from another machine. Lately, I wanted to use my Mac G4
    Powerbook (Mac OS X 10.4.6) as both server and development machine. I
    started reading that the G4 has Apache installed and that all I needed
    to do is configure the "httpd.conf" file so that I could develop
    several sites simultaneously.

    My first attempt failed. Personal Web Sharing would hang and never
    start and I had to restore the httpd.conf file.

    My questions are:
    How do I modify the Apache httpd.conf file properly to support more
    than one website?
    And
    What other modifications might I need to do to my G4 (such as the
    NetInfo Manager) in order for it to support multiple websites?

    I have read several articles, but apparently I didn't follow them
    closely enough.

    Can anyone explain what I need to do or point me to a few set-up
    articles that are layperson friendly?

    Here is what I did previously...

    File: httpd.conf

    Original Lines:

    #NameVirtualHost *:80
    #<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>

    Modified to:

    NameVirtualHost 127.0.0.1:80

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/dummy-host.example.com
    ServerName localhost
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/personal
    ServerName local.mynametest.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/personalsecure
    ServerName local.mynamesecure.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    This modification resulted in Apache (Personal Web Service) not
    starting up properly.

    Thank you,

    TPK

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Michael Vilain@vilain@spamcop.net to comp.sys.mac.system on Saturday, April 22, 2006 14:59:59
    From Newsgroup: comp.sys.mac.system

    In article <1145738143.548261.235430@g10g2000cwb.googlegroups.com>,
    "TPK" <tim.kern@comcast.net> wrote:

    Greetings,
    I deal with a number of websites. Traditionally I fire up my server and develop to it from another machine. Lately, I wanted to use my Mac G4 Powerbook (Mac OS X 10.4.6) as both server and development machine. I
    started reading that the G4 has Apache installed and that all I needed
    to do is configure the "httpd.conf" file so that I could develop
    several sites simultaneously.

    My first attempt failed. Personal Web Sharing would hang and never
    start and I had to restore the httpd.conf file.

    My questions are:
    How do I modify the Apache httpd.conf file properly to support more
    than one website?
    And
    What other modifications might I need to do to my G4 (such as the
    NetInfo Manager) in order for it to support multiple websites?

    I have read several articles, but apparently I didn't follow them
    closely enough.

    Can anyone explain what I need to do or point me to a few set-up
    articles that are layperson friendly?

    Here is what I did previously...

    File: httpd.conf

    Original Lines:

    #NameVirtualHost *:80
    #<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>

    Modified to:

    NameVirtualHost 127.0.0.1:80

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/dummy-host.example.com
    ServerName localhost
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/personal
    ServerName local.mynametest.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    <VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /Users/myname/Sites/personalsecure
    ServerName local.mynamesecure.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>

    This modification resulted in Apache (Personal Web Service) not
    starting up properly.

    Thank you,

    TPK

    The interface to change these files is a text editor and the O'Reilly
    book Apache, the Definitive Guide (http://www.ora.com). If you're going
    to be configuring Apache on your system, I'd pick up a copy of that book.

    You'll have to configure your network to assign separate IP addresses to
    the various sites hosted on your system. I did this from the Network
    System Preference. Use the last option on the drop-down menu--Network
    Port Configurations. I just created a separate configuration and IP
    address for each site.

    Use that IP address in the /etc/httpd/users/<dev account shortname>.conf Don't change the httpd.conf for anything but the modules you enable or
    if you want circulating log files (I built cronolog for this http://cronolog.org/). You can setup separate accounts for the web
    sites or just create separate DocumentRoot directories in your
    development account.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Tom Harrington@tph@pcisys.no.spam.dammit.net to comp.sys.mac.system on Saturday, April 22, 2006 16:18:45
    From Newsgroup: comp.sys.mac.system

    In article <1145738143.548261.235430@g10g2000cwb.googlegroups.com>,
    "TPK" <tim.kern@comcast.net> wrote:

    Greetings,
    I deal with a number of websites. Traditionally I fire up my server and develop to it from another machine. Lately, I wanted to use my Mac G4 Powerbook (Mac OS X 10.4.6) as both server and development machine. I
    started reading that the G4 has Apache installed and that all I needed
    to do is configure the "httpd.conf" file so that I could develop
    several sites simultaneously.

    My first attempt failed. Personal Web Sharing would hang and never
    start and I had to restore the httpd.conf file.

    My questions are:
    How do I modify the Apache httpd.conf file properly to support more
    than one website?

    For what it's worth, you don't actually have a Mac OS X problem, you
    have an Apache problem. You might get more useful responses in a forum
    more focused on Apache.

    I don't know much about configuring virtual hosts, but a couple of
    things would be useful for general-purpose Apache work:

    1. Anytime anything goes wrong, check the log files at /var/log/httpd/, because Apache's error messages are often quite useful.

    2. When editing the configuration file, check on your edits using
    "apachectl configtest", which will help pinpoint any errors you may have
    made.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 2.0: Delocalize, Repair Permissions, lots more.
    See http://www.atomicbird.com/
    --- Synchronet 3.18b-Win32 NewsLink 1.113