Bug Report: Virtual Server Creation Fails When Domain Matches Hostname
SYSTEM INFORMATION | |
---|---|
OS type and version | Ubuntu 24.04 LTS |
Webmin version | 2.402 |
Virtualmin version | 7.30.8 |
Webserver version | Apache 2.4.58 (check with: apache2 -v) |
Related packages | Let’s Encrypt, certbot, mod_ssl |
Issue Description
I encountered an issue when trying to create a virtual server with the same domain name as the server hostname.
Steps to Reproduce
- Fresh Virtualmin installation on Ubuntu 24.04 LTS
- Server hostname set to:
example.mydomain.com
- Attempted to create a Virtual Server with domain:
example.mydomain.com
Error Message
Failed to create virtual server : You cannot create a new domain with example.mydomain.com name, unless option Setup ACME SSL certificate for hostname is first disabled in Virtualmin Configuration ⇾ SSL settings page
Note: This exact error occurs when trying to create a virtual server with the same domain name as the server hostname.
Configuration Details
SSL Configuration Path: Webmin ⇾ Webmin Configuration ⇾ SSL Encryption ⇾ Let's Encrypt
In the “Let’s Encrypt validation method” section:
- Selected: Apache virtual host
- Chose the server hostname:
example.mydomain.com
Unexpected Behavior
After configuring the SSL settings as described above, a directory was created:
/home/._default_hostname/
This appears to be incorrect behavior. The directory structure shows:
drwxr-x--- 11 _default_hostname _default_hostname 4096 Apr 20 14:31 ._default_hostname
Expected vs Actual Behavior
Expected:
- Should be able to create a virtual server with the same name as hostname
- OR provide clear guidance on how to properly configure this scenario
- Directory should be created with proper domain name, not
._default_hostname
Actual:
- Error prevents virtual server creation
- Mysterious
._default_hostname
directory created - Apache configuration points to wrong directory paths
Current Apache Configuration Issues
The generated Apache virtual host configuration contains:
DocumentRoot /home/._default_hostname/public_html
ScriptAlias /cgi-bin/ /home/._default_hostname/cgi-bin/
Instead of the expected:
DocumentRoot /home/example.mydomain.com/public_html
ScriptAlias /cgi-bin/ /home/example.mydomain.com/cgi-bin/
Impact
This issue causes:
- Virtual server creation failure
- Incorrect directory structure
- Apache misconfiguration
- Subdomain functionality problems (webmail, admin, autodiscover not working)
Questions
- Is this the intended behavior when hostname matches the desired virtual server domain?
- What is the correct procedure for creating a virtual server with the same name as the server hostname?
- Why is the
._default_hostname
directory created and how should it be handled? - Should the SSL hostname configuration be different when planning to use the same domain for virtual servers?
Workaround Attempted
Currently considering renaming the incorrectly created directory:
sudo mv /home/._default_hostname /home/example.mydomain.com
But this feels like a hack rather than a proper solution.
Request
Could someone please clarify:
- The correct workflow for this scenario
- Whether this is a bug or intended behavior
- Best practices for hostname vs virtual server domain naming
Any guidance would be greatly appreciated!
Additional Context
Timeline of events:
- Fresh Virtualmin 7.30.8 installation on Ubuntu 24.04 LTS
- Server hostname configured as:
example.mydomain.com
- Configured Let’s Encrypt in Webmin with “Apache virtual host” method
- Selected server hostname (
example.mydomain.com
) in the SSL configuration - This automatically created the problematic
._default_hostname
directory - Later attempt to create Virtual Server with same domain name fails with the error above
- Apache configuration incorrectly points to
._default_hostname
instead of proper domain directory
Key observation: The ._default_hostname
directory appears to be created during the SSL hostname configuration process, not during Virtual Server creation attempt.
Current filesystem state:
# In /home/ directory:
drwxr-x--- 11 _default_hostname _default_hostname 4096 Apr 20 14:31 ._default_hostname
drwxr-x--- 13 example.mydomain.com example.mydomain.com 4096 Jul 13 20:21 example.mydomain.com
Note: The domain directory (example.mydomain.com
) exists but has a typo (missing character), which suggests Virtualmin created it incorrectly or there was user error during domain creation process.
Additional Information
If you need any additional configuration files, logs, or system information, please let me know and I’ll provide them.