DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Reply
 
Thread Tools Display Modes
Old 06-12-2006, 07:55 AM   #1
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default Easy virtual hosting (Mac)

If you have tried to use the OS X (Tiger) built-in web server and found it frustrating, Headdress (“Virtual hosting made easy”) from Twinsparc ($14, with a free demo) claims to make it really simple.

The software extends the Mac’s built-in networking, enabling you to develop multiple sites, offline, each with its own working URL. Designate any folder as the site root, and then the computer acts pretty much like a hosted server on the internet. Images and other links will work as if you were online.

Sites can be broadcast over your local network via Bonjour, or you can upload them to a regular server.

PHP and Apache are included with the Mac OS. I’m not sure whether you can also install MySQL for use with this. But for simple sites, it could be a great convenience, and it doesn’t cost much.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 06-12-2006, 08:42 AM   #2
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by ktinkel
PHP and Apache are included with the Mac OS. I’m not sure whether you can also install MySQL for use with this. But for simple sites, it could be a great convenience, and it doesn’t cost much.
As far as I know MySQL also comes with OS X - but not the latest version (possibly only in OS X server version though, not in the client version). But you can certainly install it. If you install a newer version than the (a) pre-installed one, be aware that the default MySQL socket location is different from what OS X assumes; you'll have to create a my.cnf file in /etc specifying the (MySQL) location (full path) of the mysql.sock file in both a [mysqld] and a [client] section:
Code:
[mysqld]
socket=/tmp/mysql.sock

[client]
socket=/tmp/mysql.sock
For PHP to communicate with local MySQL you'll also need to create a php.ini file (copy one from php.ini.default) and make sure the default socket path defined in there matches the default path in your my.cnf.

(After my MySQL socket adventures, I just talked a friend through getting manually-installed MySQL to work on his newly in stalled Tiger...)

See also:
MySQL 3.23, 4.0, 4.1 Reference Manual :: 2.5 Installing MySQL on Mac OS X; and
A.4.5. How to Protect or Change the MySQL Unix Socket File

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 06-12-2006, 09:16 AM   #3
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by iamback
As far as I know MySQL also comes with OS X - but not the latest version (possibly only in OS X server version though, not in the client version). But you can certainly install it.
Thanks for all that. I was rooting around for information in my Tiger “missing manual”, and it is surprisingly not there.

I assume you can also change the PHP to match the version used on a target real server.

As you know, you can do all this on native Tiger, but for only a single site. This little tool lets you set up multiple sites locally. That, and easy enabling of PHP seem to be its main functions (not bad at the price).

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 06-12-2006, 10:42 AM   #4
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by ktinkel
As you know, you can do all this on native Tiger, but for only a single site. This little tool lets you set up multiple sites locally. That, and easy enabling of PHP seem to be its main functions (not bad at the price).
I'm confused here... with Apache you can set up as many sites as you like (not only a single site) - so what's the difference? I don't understand what you're saying about "only a singe site".

So what does the package actually do? Just configure Apache for you? In that case, I'd say it's expensive!

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 06-12-2006, 11:05 AM   #5
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by iamback
I'm confused here... with Apache you can set up as many sites as you like (not only a single site) - so what's the difference? I don't understand what you're saying about "only a singe site".
From what I understand, the Mac OS (not the Mac OS Server version) limits you to a single site.

I haven’t tried it, myself.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 06-12-2006, 03:31 PM   #6
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by ktinkel
From what I understand, the Mac OS (not the Mac OS Server version) limits you to a single site.

I haven’t tried it, myself.
I'll ask my pal when I talk to him next.

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 06-14-2006, 04:49 AM   #7
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

OK, here goes. I asked my pal Dario, I basically got confirmation that what I reckoned would be possible actually is possible on a Mac running OS X client version.

Basically, setting up and running virtual "domains" goes like this (on pretty much any operating system):
  • Install Apache (pre-installed on OS X - even on the "client" version)
  • Set up Apache for virtual hosting by editing httpd.conf - it's not rocket science, the default httpd.conf generally is so well-commented that it explains itself for that, and there are countless references on the web anyway
  • What you do is assign a "domain" for each site you're going to run. For instance, you may want to run a local "wikka" site: you create a directory called "wikka" under your web root and then configure Apache's httpd.conf to map the "domain" name "wikka" to that directory - that's standard Apache setup
  • Now for your system to be able to go to http://wikka/ you need to tell it where to find that; normally you do that by editing the system's hosts file - which on an OS X Mac is (unsuprisingly, with *nix at its base) found in /etc - and add a line like:
    Code:
    127.0.0.1            wikka
  • Stop and restart Apache (because you changed its httpd.conf configuration) and now you should be able to browse to http://wikka/ - and get to to the files that were stored in the wikka directory under the web root (because you told Apache to map the "wikka" domain to that subdirectory

That's the generic approach. No need to purchase any application to do that - all you'd need is Apache (preinstalled on Mac OS X) and a text editor.

Now, Dario didn't use that - instead used the "NetInfo Manager" app (short name: NetInfo) - which comes as a utility with Mac OS X. Somehow, this serves as a replacement for using the /etc/hosts file (I don't know how) - but the effect is the same. So using this approach, what you do is:
  • Set up Apache for virtual hosting (as before)
  • Use NetInfo to tell the system about the "virtual" domain (instead of editing /etc/hosts which will remain untouched)

To use this web server from another networked machine now, the principle is (again on pretty much any operating system):
  • edit its /etc/hosts file to tie the "wikka" "domain" not to 127.0.0.1 but to the IP address of the machine running the Apache web server;
  • OR Mac-specific: use NetInfo to do this mapping instead

Now this last step (using the server from another networked machine) is just my conjecture - Dario has only one machine running OS X 'Tiger' with Apache, with a virtual site at http://wikka/ - and he used NetInfo (his /etc/hosts file seems untouched). But since Mac OS X has a standard /etc/hosts file, I see no reason why that wouldn't work equally well to connect to a server on a networked machine. Though I suspect you may not be able to use NetInfo and use the hosts file for mapping - at least not combine both mechanisms on a single machine. Dario suspects NetInfo is just a GUI to some config file - but it isn't the hosts file...

Apart from the existence of a "NetInfo" utility on Mac OS X there is no difference with the principle of how this works on both *nix (including Linux) and Windows. On (laptop) Alan I have an Apache webserver, set up for a bunch of virtual domains and subdomains. I can access them with the browser using all of those (sub)domains because I've also added all of them to the hosts file on Alan (mapping them to 127.0.0.1). From (desktop) Grace, I can reach all of those (sub)domains as well, because I've edited her hosts file to map those (sub)domains to Alan's IP address. And so on...

For more information on running virtual hosts on a Mac, try this Google search Dario gave me, which brings up a load of resources. [Edit: this article pretty much sums up what I've just explained as basic principle - including editing your hosts file!]

Conclusion: don't pay for a package when you already have it for free... Or: Mac OS X has *nix at its core - just use it!

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog

Last edited by iamback; 06-14-2006 at 06:38 AM. Reason: corrected typo in path
iamback is offline   Reply With Quote
Old 06-14-2006, 06:08 AM   #8
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by iamback
OK, here goes. I asked my pal Dario, I basically got confirmation that what I reckoned would be possible actually is possible on a Mac running OS X client version.
. . .
Conclusion: don't pay for a package when you already have it for free... Or: Mac OS X has *nix at its core - just use it!
Whew! Thanks for all that — very illuminating. Makes me feel like setting up a server of my own — at the very least, it might help me understand better what goes on at host servers that I need to deal with.

I had always heard that the limit was one on OS X. Maybe that is old news (or maybe I was confused about something).


Now how would you make these public servers? (Sounds kind of scary, actually, but perhaps it could be on a computer surrounded by firewalls?)



::

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 06-14-2006, 06:28 AM   #9
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by ktinkel
I had always heard that the limit was one on OS X. Maybe that is old news (or maybe I was confused about something).
I suspect that simply refers to the default Apache configuration + (maybe) default NetInfo configuration. But both (and the hosts file, and lookupd) are configurable.

Quote:
Originally Posted by ktinkel
Now how would you make these public servers? (Sounds kind of scary, actually, but perhaps it could be on a computer surrounded by firewalls?)
If by "public" you mean "on the web" and not "on the local network" (which I think is all Headdress refers to) then you definitely need more. A firewall, for starters; and an actual registered domain, and a DNS server that ties that domain to the public IP address of your computer/network on the Internet. (Or don't use a domain but just an IP address - but you'd still need a properly-set up firewall). Don't go there unless you really know what you're doing...

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 06-14-2006, 07:45 AM   #10
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by iamback
If by "public" you mean "on the web" and not "on the local network" (which I think is all Headdress refers to) then you definitely need more. A firewall, for starters; and an actual registered domain, and a DNS server that ties that domain to the public IP address of your computer/network on the Internet. (Or don't use a domain but just an IP address - but you'd still need a properly-set up firewall). Don't go there unless you really know what you're doing...
Sounds like good advice! It just appeals to me notionally — the 21st century version of going off to an island or a big farm in the middle of nowhere and being completely self-sufficient. (I wasn’t too willing to do that either, when it came right down to it!)

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dedicated virtual server: when/why? ktinkel Web Site Building & Maintenance 27 07-11-2006 12:10 PM
ASmallOrange, inexpensive hosting ktinkel Web Site Building & Maintenance 4 04-20-2006 05:52 PM
GoDaddy hosting experiences ? Daudio Web Site Building & Maintenance 32 04-19-2006 12:40 PM
Easy online favicon (.ico) maker ktinkel Web Site Building & Maintenance 25 05-31-2005 02:57 PM
Hosting company recommendations, please annc Web Site Building & Maintenance 51 03-14-2005 02:58 AM


All times are GMT -8. The time now is 05:56 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.