Skip to content

Instantly share code, notes, and snippets.

@thwarted
Created November 27, 2013 07:58
Show Gist options
  • Save thwarted/7672130 to your computer and use it in GitHub Desktop.
Save thwarted/7672130 to your computer and use it in GitHub Desktop.
minimum Apache command line to start up a single shot web server with directory indexes and logging to the terminal. Uses compiled in default for ServerRoot (so modules can be found)
httpd \
-f /dev/null \
-C 'LoadModule autoindex_module modules/mod_autoindex.so' \
-C 'LoadModule log_config_module modules/mod_log_config.so' \
-C 'LoadModule dir_module modules/mod_dir.so' \
-C "DocumentRoot $( readlink -f .)" \
-C 'Listen 7000' \
-C 'ErrorLog /dev/stdout' \
-C 'PidFile /tmp/pidfile' \
-C 'LogFormat "%h %l %u %t \"%r\" %>s %b" common' \
-C 'CustomLog /dev/stdout common' \
-D FOREGROUND
@sarnobat
Copy link

sarnobat commented Jul 5, 2014

Very helpful. Thank you. I hate using the conf file. This worked for me in Ubuntu 12.04 (though without the extra modules you can't list directories):

apache2 \
    -f /dev/null \
    -C "DocumentRoot $PWD" \
    -C 'Listen 7000' \
    -C 'PidFile /tmp/pidfile' \
    -C 'ErrorLog /dev/stdout' 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment