improved apache.sh script