Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'd like to be able to share websites I'm developing with other users in my network using Web Sharing. I don't develop in my 'Sites' folder though, I have a separate folder for all my projects.

(Note: web sharing is working generally. If I visit http://[my-local-ip-address]/~[myusername] it shows the default local Site that I never touch.)

e.g. I use apache's httpd-vhosts.conf file and /etc/hosts to setup local domains that can be accessed by me like so:

http://mytestsite

So.. can I configure OS X Lion & apache to allow other to see them around the LAN like this?

http://[my-local-ip-address]/~mytestsite

Thanks! Ben

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Yes, you can configure Mac OS X 10.7, aka Lion, to serve multiple web sites using URLs like http://[my-local-ip-address]/~mytestsite.

The format of URL you suggest can be achieved by creating a new user for each site, and storing the web pages in that user's Sites folder.

Alternatively, you could create subfolders within your site's folder:

  • http://[my-local-ip-address]/~[myusername]/site1
  • http://[my-local-ip-address]/~[myusername]/site2
  • http://[my-local-ip-address]/~[myusername]/site3

Going another step further, you can customise the Apache httpd 2 configuration files at /etc/apache2/users/[myusername] to tweak the set up to your exact needs.

share|improve this answer
add comment

If you have all of the projects in a single folder just set Apache's DocumentRoot in /etc/apache2/httpd.conf to directory.

Or you can just put the project folders in /Library/WebServer/Documents.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.