I try to run a cgi-script on my webserver (Ubuntu 12.04). But always when I type the URL in my Browser I get an Error Message "404 Not Found"

I tried to install the CGI-Mod for Apache2 but all the tutorials on google are like chinese language for me.

Can somebody tell me what i have to do?

  • Could you provide more details, like what laanguage is the CGI written, what software is it, what URL are you typing in etc. The more information you provide the more it helps us to find a good solution for you.
    – qbi
    Jan 17, 2013 at 20:08

1 Answer 1


You have to learn some Chinese. At least, try following a tutorial until you get stuck, and then post here to tell us which tutorial you were following and where you got stuck.

If you just want to run a CGI script, you don't need a web server for that. You can use w3m for that:

w3m -o cgi_bin=/path/to/cgi-bin file:/cgi-bin/script.cgi

Details about that syntax are here.

One option with Apache is to use the ScriptAlias directive.

However, first you may wish to publish a "basic "test.html" file in the web server root directory, and make sure you access that. Then move on to trying a CGI script.

Of course, check the web server logs if something goes wrong. Reviewing the logs for a "not found" result may reveal exactly which directory the web server is checking in instead of one you thought, which could lead the configuration fix that you need.

Your Answer

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

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