Last active
December 22, 2015 15:39
-
-
Save tsertkov/6494295 to your computer and use it in GitHub Desktop.
Daemontools (http://cr.yp.to/daemontools.html) run script for starting apache. Service directory basename is passed to apache via -D command line option and can be checked with <IfDefine>. For example for the script located at "/etc/service/php55/run" "php55" is defined with -D.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SNAME=${PWD%/*} | |
SNAME=${SNAME##*/} | |
exec 2>&1 | |
exec \ | |
env -i PATH=/bin:/usr/bin PHPRC=/opt/apache-dev/servers/$SNAME \ | |
setuidgid www-dev \ | |
/opt/apache-dev/bin/httpd -D FOREGROUND -D $SNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfDefine php54> | |
LoadModule php5_module modules/libphp54.so | |
Listen 8081 | |
ServerRoot /opt/apache-dev/servers/php54 | |
</IfDefine> | |
<IfDefine php55> | |
LoadModule php5_module modules/libphp55.so | |
Listen 8082 | |
ServerRoot /opt/apache-dev/servers/php55 | |
</IfDefine> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment