Skip to content

[Feat] [4.x] Apache Support (Beta)#1122

Draft
RichardAnderson wants to merge 8 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/apache
Draft

[Feat] [4.x] Apache Support (Beta)#1122
RichardAnderson wants to merge 8 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/apache

Conversation

@RichardAnderson
Copy link
Copy Markdown
Member

@RichardAnderson RichardAnderson commented May 25, 2026

This pull request introduces support for Apache as a webserver alongside Nginx and Caddy, refactors the webserver configuration generation system for extensibility, and updates related logic throughout the codebase.

NOTE: Many updates in the PR improve support for additional web servers, and remove hard-coded elements and IDs.

@RichardAnderson RichardAnderson changed the title [Feat] [4.1.x] Apache Support (Beta) [Feat] [4.x] Apache Support (Beta) May 25, 2026
@RichardAnderson RichardAnderson marked this pull request as ready for review May 25, 2026 22:02
@RichardAnderson RichardAnderson requested a review from Copilot May 25, 2026 22:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Apache (beta) as a supported webserver alongside Nginx and Caddy, and refactors vhost/config generation to be webserver-driven via a configGenerator() abstraction. It also updates site settings behavior and SSH templates/tests to cover Apache-specific operations (install, splash, vhost generation, verification handling, logs, and basic auth).

Changes:

  • Introduces App\Services\Webserver\Apache plus Apache SSH templates (install/uninstall, vhost CRUD, SSL creation, splash).
  • Refactors webserver config generation via Webserver::configGenerator() and makes htpasswd path webserver-dependent (basicAuthDir()).
  • Adds/updates PHPUnit coverage for Apache install, config generation, verification blocks, basic auth behavior, service logs, and vhost template defaults.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/SSH/Services/Webserver/DeploySplashTest.php Adds Apache splash deployment SSH assertions.
tests/Unit/Actions/Webserver/GenerateApacheConfigTest.php New unit tests for Apache vhost generation edge-cases (FPM, auth, ACME, redirects, verification, force-SSL).
tests/Unit/Actions/Service/InstallTest.php Adds Apache install test expectations (systemd override).
tests/Feature/Webserver/VerificationBlockTest.php Adds Apache verification block coverage.
tests/Feature/SiteSettings/VhostTemplateTest.php Ensures default vhost template matches active webserver (nginx/apache/caddy).
tests/Feature/SiteSettings/BasicAuthTest.php Verifies Apache writes htpasswd file on basic auth update.
tests/Feature/ServiceLogsTest.php Adds expectations for Apache log catalogue entries.
resources/views/ssh/services/webserver/shared/write-basic-auth-file.blade.php Generalizes htpasswd file ownership to a webserverUser.
resources/views/ssh/services/webserver/shared/remove-basic-auth-file.blade.php New shared script to remove htpasswd file idempotently.
resources/views/ssh/services/webserver/apache/vhost.mustache New Apache Mustache vhost template.
resources/views/ssh/services/webserver/apache/uninstall-apache.blade.php New Apache uninstall script.
resources/views/ssh/services/webserver/apache/install-apache.blade.php New Apache install script (modules, envvars, systemd override).
resources/views/ssh/services/webserver/apache/get-vhost.blade.php New script to read an Apache vhost file.
resources/views/ssh/services/webserver/apache/delete-site.blade.php New script to disable/remove Apache site and delete path.
resources/views/ssh/services/webserver/apache/default-vhost.blade.php New default “splash” vhost for Apache.
resources/views/ssh/services/webserver/apache/create-vhost.blade.php New script to enable site, configtest, and reload Apache.
resources/views/ssh/services/webserver/apache/create-path.blade.php New script to create site path and set perms.
resources/views/ssh/services/webserver/apache/create-letsencrypt-ssl.blade.php New certbot webroot SSL creation script for Apache.
resources/views/ssh/services/webserver/apache/create-custom-ssl.blade.php New script to write custom cert/key for Apache.
resources/js/pages/site-settings/index.tsx Enables Basic Auth UI section for Apache sites.
app/Services/Webserver/Webserver.php Extends interface with configGenerator() + basicAuthDir().
app/Services/Webserver/Nginx.php Implements generator + basicAuthDir; switches to shared htpasswd removal.
app/Services/Webserver/Caddy.php Implements generator + basicAuthDir (null).
app/Services/Webserver/Apache.php New Apache webserver implementation (install/uninstall/vhost/ssl/logs/splash).
app/Services/Webserver/AbstractWebserver.php Centralizes static type(): 'webserver' for webservers.
app/Providers/ServiceTypeServiceProvider.php Registers Apache service type metadata and config path.
app/Models/Site.php Makes htpasswdPath() webserver-aware and nullable.
app/Http/Controllers/SiteSettingController.php Uses site->webserver()->configGenerator() for default vhost template.
app/Actions/Webserver/GenerateApacheConfig.php New Apache config generator implementation.
app/Actions/Webserver/AbstractGenerateConfig.php Adds overridable formatConfig() and handles nullable htpasswd path.
app/Actions/Site/UpdateVhostTemplate.php Uses webserver’s configGenerator() to compare against defaults.
app/Actions/Site/UpdateBasicAuth.php Writes htpasswd for any webserver that exposes a basic auth dir; uses shared scripts.

Comment thread resources/views/ssh/services/webserver/apache/delete-site.blade.php Outdated
@RichardAnderson RichardAnderson marked this pull request as draft May 26, 2026 09:26
@RichardAnderson
Copy link
Copy Markdown
Member Author

Once site-stats is merged, just need to make the branch for access log locations generic in this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants