As part of my job I have to install and uninstall Apache quite frequently for our apprentices, sometimes with PHP, sometimes without.
Because of this, I made an installer. I don't mean a collection of scripts, but a real installer like you would use for any other software.
https://imgur.com/a/QjeJtRGI originally didn't intend for it to be used publicly but I changed a few things to make it suitable. Notable features:
- Created a page for update checks and download of installer bundles. There's currently only one installer but I intend for it to grow over time
- Made installer more foolproof (It should stop the service when you try to update a running instance for example)
- Added ability to create firewall rules
- It will create the configuration files and php.ini if not present but will never overwrite them
- php.ini is dynamically changed to reflect a custom path selection by the user
- Post install notes that provide some troubleshooting hints and explain the problems that can arise from running Apache as "Local Service"
- Digital signature. Note: Only the installer and uninstaller are currently signed. I can sign all Apache+PHP binaries in the installer upon popular request but it should not be necessary
- Made PHP optional
- Added the license and changes file
- Permission hardening can be reversed and reapplied at any time
- Removes firewall rules again when you uninstall
- The contents of "htdocs" are never deleted when uninstalling in case you need them later
- Apache is run under an unprivileged "Local Service" user instead of a god account
- It should work if there are spaces in the path name (I still recommend you don't)
I can include all the optional modules if requested. I do not plan on creating 32 bit installers.
The default server configuration has been slightly changed:
- Apache is configured to use PHP as a CGI module using the ScriptAlias/ContentType model. This is always present, even if you don't install PHP, but in that case it has no effect
- index.php added to the automatic directory index
- inclusion of conf/extra/httpd-mpm.conf is enabled by default
The PHP configuration is as follows:
- The base is the development PHP ini file
- Custom "temp" and "session" paths so PHP doesn't pollutes the Windows temp directory
- Safer session handling (user can't create their own id, the id is not accessible from JS)
- Configured a CA file that's in sync with Windows (at the time of creating the setup)
If interested, you can obtain the setup here:
https://cable.ayra.ch/apache/Feedback is encouraged. Thank you.