Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created December 20, 2011 03:36
Show Gist options
  • Save fixlr/1500118 to your computer and use it in GitHub Desktop.
Save fixlr/1500118 to your computer and use it in GitHub Desktop.
Short apache config for PHP app development. You need this because you probably already have Apache installed, and I'm jealous of Ruby.
# Load deez.
LoadModule alias_module /usr/libexec/apache2/mod_alias.so
LoadModule authz_host_module /usr/libexec/apache2/mod_authz_host.so
LoadModule dir_module /usr/libexec/apache2/mod_dir.so
LoadModule log_config_module /usr/libexec/apache2/mod_log_config.so
LoadModule mime_module /usr/libexec/apache2/mod_mime.so
LoadModule php5_module /usr/libexec/apache2/libphp5.so
LoadModule rewrite_module /usr/libexec/apache2/mod_rewrite.so
# Get down to bizness
ServerRoot "./"
Listen 3000
# I don't always set the document root to the app's "public" directory,
# but when I do I delegate to the mod_rewrite rules in github.com/fixlr/heroku-php-template
DocumentRoot "./"
# Mi casa no es su casa.
<Directory "./">
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
# Logggggs.
ErrorLog "logs/error_log"
TransferLog "logs/development_log"
LogLevel warn
LockFile "tmp/httpd.lock"
PidFile "tmp/httpd.pid"
# Duh. Kinda the point of this whole thing...
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html
@fixlr
Copy link
Author

fixlr commented Dec 20, 2011

Usage

Run from the project's directory:

httpd -d . -f development_httpd.conf -k [start|restart|stop]
  • logs/error_log is your friend.
  • Still working on a development log, start/stop script, etc.

FORK AWAY!

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