Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Site development on stand-alone machine

Site development on stand-alone machine
Thread Tools
Forum Regular
Join Date: Jun 2001
Location: London, UK
Status: Offline
Reply With Quote
Feb 1, 2002, 03:28 PM
 
I have recently switched from a desktop PC to a far superior iBook, and would like to use it for the web development work that I previously used my PC for.
My problem is that I cannot find a way to host sites locally on a standalone mac. Unless all of the files for a site are held in the top level of my hard drive, whenever I use an absolute path in a link the browser cannot find the file.
On the PC I could use Microsoft Personal Web Server and set up a virtual directory for each site so it could be viewed successfully with internet explorer. I cannot do this with either Apple's Web Sharing feature or the Mac version of Personal Web Server.
There must be a solution out there - please help!
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Feb 1, 2002, 03:49 PM
 
Have you tried 127.0.0.1/virtual/path/to/site? Or localhost?

If you are storing the html files in your Sites directoy, then you will need to put ~username in front of the path. Example: if you have the file test.html in your (you are user "Bob") Sites directory, then you will need to enter:

http://127.0.0.1/~Bob/test.html

If you have the same file in the Documents directoy (/Library/WebServer/DOcuments), then you simply need:

http://127.0.0.1/test.html

In general I have found Apache to be more powerful than IIS (or it's little brother), but it doesn't have a GUI (verses IIS which doesn't have a good GUI).

This all assumes that you have turned on Apache in the first place....
     
Junior Member
Join Date: Jan 2002
Location: scandinavia
Status: Offline
Reply With Quote
Feb 4, 2002, 06:37 PM
 
Originally posted by Paco Loco:
<STRONG>On the PC I could use Microsoft Personal Web Server and set up a virtual directory for each site so it could be viewed successfully with internet explorer. I cannot do this with either Apple's Web Sharing feature or the Mac version of Personal Web Server.
There must be a solution out there - please help!</STRONG>
Hi Loco!
A virtual host setup for OSX's built-in Apache server is almost indispensable when you do local development.
That way you can "host" an infinite number of test sites and the host configuration can be setup individually for each of them. This is how you do it (for two test sites: foo_1.test and foo_2.test):
In "Netinfo manager" choose "Machines" and select "Localhost". In Edit menu choose "Duplicate" and rename the duplicate "foo_1.test". Repeat for foo_2.test.
This is similar to adding hosts in \drivers\etc\host in a Windows environment.
All you have to do now is to edit /etc/httpd/httpd.conf. Just do this (it's all at the bottom of the file):

NameVirtualHost 127.0.0.1

(note, if you have changed your documentroot put that here too):
&lt;VirtualHost 127.0.0.1&gt;
DocumentRoot /Library/WebServer/Documents
ServerName localhost
&lt;/VirtualHost&gt;

And add the two testsites:
&lt;VirtualHost 127.0.0.1&gt;
ServerAdmin your_email_address
DocumentRoot /Users/your_username/Sites/foo_1
ServerName foo_1.test
ErrorLog "/private/var/log/httpd/foo_1.site-error_log"
CustomLog "/private/var/log/httpd/foo_1.site-access_log" common
&lt;/VirtualHost&gt;

&lt;VirtualHost 127.0.0.1&gt;
ServerAdmin your_email_address
DocumentRoot /Users/your_username/Sites/foo_2
ServerName foo_2.test
ErrorLog "/private/var/log/httpd/foo_2.site-error_log"
CustomLog "/private/var/log/httpd/foo_2.site-access_log" common
&lt;/VirtualHost&gt;

Restart Apache and that should be it !! Now you have two sites to be stored in the folders foo_1 and foo_2 under /Sites, with individual error logging. Local addresses: http://foo_1 and http://foo_2.
Further server configuration can be setup individually under each virtualhost directive.
Hope this was legible!!
-jh
     
Forum Regular
Join Date: Jun 2001
Location: London, UK
Status: Offline
Reply With Quote
Feb 5, 2002, 11:01 AM
 
Thanks for the advice guys - unfortunately I am still using OS 9.1 so Apache is not an option for me... Also upgrading to OSX is simply not viable for me as I have too much OS9 software and cannot afford to upgrade it all. Also I don't really think my first generation Dual USB iBook is up to running it.
Any other ideas? - I refuse to believe that it is not possible for me to develope sites on my machine!
Thanks again, Paco.
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 5, 2002, 06:29 PM
 
Originally posted by Paco Loco:
<STRONG>Thanks for the advice guys - unfortunately I am still using OS 9.1 so Apache is not an option for me... Also upgrading to OSX is simply not viable for me as I have too much OS9 software and cannot afford to upgrade it all. Also I don't really think my first generation Dual USB iBook is up to running it.
Any other ideas? - I refuse to believe that it is not possible for me to develope sites on my machine!
Thanks again, Paco.</STRONG>
OS 9??? Don't be fooled - OS X works great on an iBook - we run a presentation machine/web server on an iBook 500 and we haven't had any problems yet. And we also use a good deal of legacy classic stuff without a hitch. Go on - be a devil

If you're still stuck, I believe that tenon do a good server for OS 9 - check their homepage.
Computer thez nohhh...
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2