3

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.

4 Answers 4

2

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

1
  • I've never even heard of it actually, going to check it out tonight.
    – David
    Commented Nov 7, 2009 at 23:29
0

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.

2
  • 1
    My experience with working with Pylons and Rails says otherwise, its much more conveniant to be able to check a project out of source control and launch it immediately for access to some port then to check the code out, add/edit a vhost entry, and then restart the web server.
    – David
    Commented Nov 5, 2009 at 13:28
  • If you're running Windows, you may want to give Wampserver a shot. Through tray icon, you can reach several tools, like Apacha aliases and service management with a few clicks. It easies my life for sure!
    – pestaa
    Commented Nov 5, 2009 at 16:42
0

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.

3
  • localhost:{numeric port number} is still a whole hell of a lot faster then any form of vhosting unless you have some sort of internal LAN dns to provide *.dev.local names. I could be wrong but I don't think you can automatically tell Apache2's dynamic vhost module to host in incremental port numbers.
    – David
    Commented Nov 5, 2009 at 20:15
  • Perhaps not, but you can add more local IP's to your PC and use the IP-based option (httpd.apache.org/docs/2.0/vhosts/mass.html#ipbased). Also, I haven't tested, but it might be possible that (if you used port) that it would be appended to the IP-based naming somehow.
    – Kevin Peno
    Commented Nov 6, 2009 at 18:44
  • @David - no need for real DNS -- check your /etc/hosts file
    – timdev
    Commented Nov 7, 2009 at 0:48
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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