Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to create an Apache or nginx server which simulates the response codes I want? If it is, how hard is to setup and accomplish that in Mac OS?

thanks

share|improve this question
    
Do you want to programmatically send different response to a client depedning on the request content, or do you wanto simply send (for example) a 500 to every request that comes in? –  SmallClanger Jan 21 '11 at 15:56

1 Answer 1

up vote 0 down vote accepted

I don't know of any normal webserver that does that, but it's certainly possible to achieve that with mod_python:

http://www.modpython.org/live/current/doc-html/pyapi-handler.html

This requires a little programming, but you just need to return appropriate code from the handler() function (which normally handles HTTP requests). I have quite often done this sort of stuff while web app programming and it just works.

share|improve this answer

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.