Skip to content

Commit

Permalink
Enable mod_rewrite if it isn't already
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcherry committed Jun 4, 2015
1 parent c2a5cf3 commit 3f5f5c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ USER_AP_FORCE_CFG="/etc/apache2/other/${USER}_zforce.conf"
USER_AP_CFG="/etc/apache2/other/${USER}_hosts.conf"
USER_LAGENT_ROOT="/Users/$USER/Library/LaunchAgents"
LOAD_PHP_CFG="/etc/apache2/other/load_php.conf"
LOAD_REWRITE_CFG="/etc/apache2/other/load_rewrite.conf"
LOAD_VHOST_ALIAS_CFG="/etc/apache2/other/load_vhost_alias.conf"

DNS_BIN_PATH="$EASY_PHP_DEV_ROOT/bin/easy_php_dev_dns"
Expand Down Expand Up @@ -61,6 +62,11 @@ enable () {
echo "php_flag short_open_tag on" | sudo tee -a $LOAD_PHP_CFG > /dev/null 2>&1
echo "</IfModule>" | sudo tee -a $LOAD_PHP_CFG > /dev/null 2>&1

echo "- Enabing mod_rewrite"
echo "<IfModule !rewrite_module>" | sudo tee $LOAD_REWRITE_CFG > /dev/null 2>&1
echo "LoadModule rewrite_module libexec/apache2/mod_rewrite.so" | sudo tee -a $LOAD_REWRITE_CFG > /dev/null 2>&1
echo "</IfModule>" | sudo tee -a $LOAD_REWRITE_CFG > /dev/null 2>&1

echo "- Enabing mod_vhost_alias"
echo "<IfModule !vhost_alias_module>" | sudo tee $LOAD_VHOST_ALIAS_CFG > /dev/null 2>&1
echo "LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so" | sudo tee -a $LOAD_VHOST_ALIAS_CFG > /dev/null 2>&1
Expand Down Expand Up @@ -124,6 +130,9 @@ disable() {
echo "- Disabing PHP"
sudo rm $LOAD_PHP_CFG > /dev/null 2>&1

echo "- Disabing mod_rewrite"
sudo rm $LOAD_REWRITE_CFG > /dev/null 2>&1

echo "- Disabing mod_vhost_alias"
sudo rm $LOAD_VHOST_ALIAS_CFG > /dev/null 2>&1

Expand Down

0 comments on commit 3f5f5c5

Please sign in to comment.