Question

In line with this question: Lightweight web app server for PHP?

The above question has been asked numerous times and answered exactly the same in all the cases I've found using google. My question is similar to a degree but with a different desired goal: On demand development instances.

I have come up with a somewhat questionable solution to host arbitrary directories in my user account for the purpose of development testing. I am not interested in custom vhosts but looking to emulate the behaviour I get when using paster or mongrel for Python & Ruby respectively.

Ubuntu 9.10 TOXIC@~/ >APACHE_RUN_USER=$USER APACHE_RUN_GROUP=www-data apache2 -d ~/Desktop/ -c "Listen 2990"

Is there a better solution, could I do something similar with nginix or lighttpd?

Note: The above won't work correctly for stock environments without a copied & altered httpd.conf.

Update: The ideal goal is to mimic Paster, Webbrick, and Mongrel for rapid local development hosting. For those light weight servers, it takes less then a minute to get a working instance running ( not factoring any DB support ). Apache2 vhost is great but I've been using Apache2 for over ten years and it would be some sort of abomination hack to setup a new entry in /etc/hosts unless you have your own DNS, in which case a wildcard subdomain setup would probably work great. EXCEPT one more problem, it's pretty easy for me to know what is being hosted ( ex. by paster or mongeral ) just doing a sudo netstat -tulpn while there would be a good possibility of confusion in figure out which vhost is what.

Was it helpful?

Solution 4

http://code.google.com/p/phpmvchelpers/wiki/script_serve

This is what I was looking to accomplish, the hack I made up isn't perfect but its functional. Needs a couple more hours work to get the re-write rules dialed in and some more brush up work but its functional for Kohana & CakePHP... still working on Recess framework though.

OTHER TIPS

Have you looked at nanoweb? It looks like it might fit your requirements:

  1. Written in php, so once its up and running, serving pages should be pretty fast
  2. Can be installed and run from a user's home directory

Note: I haven't tried it myself, I'm pretty happy using apache, but I thought I'd pass the info along

If you're looking for a lightweight solution only to save yourself time, I suggest you shouldn't.

You save time and probably lots and lots of headaches if you stick to the ol' LAMP software packages when it comes to development machines.

Dynamically Configured Mass Virtual Hosting from Apache 2.x documentation may be an answer to your question.

I agree that development configuration should be as close as possible to production environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top