I think the stupid here is our UI and we shall improve it!
This is my proposal for ns7. Letās create a new page, say Virtual hosts
. Generally, a virtual host requires a DNS record, and the right place to set it up by now is under the DNS > Alias server
page. Virtual hosts
lists the same items of DNS > Alias server
, and could also allow creating a new one. I think it is more intuitive to allow both methods of creation. In other words the two pages should offer different views of the same DB records.
When an item of Virtual hosts
is modified, the interface allows selecting the shared folders that it serves. Each shared folder can be mounted with an alias or selected as the web root of the virtual host. To persist this relation I propose to add a prop to self records in hosts DB.
ProxyPass configuration should be implemented in a similar way.
The other object that needs to be associated to virtual hosts are SSL certificates. Thereās some UI work also on that side. I think the following choices should cover all use cases:
- Optional self-signed certificate (both HTTP and HTTPS work)
- Mandatory self-signed certificate (HTTP redirects to HTTPS)
- Mandatory existing SSL certificate (uploaded, letsencryptā¦, HTTP redirects to HTTPS)
Then there are a lot of app/site specific configurations. They can be provided by additional plugins; for instance, Iām thinking about PHP ini values, like @stephdlās nethserver-php-settings does for shared folders, or URL rewriting rules. A free text-area where configuration is pasted from an howto should guarantee the command line is never required!
In the end, filesystem permissions and HTTP authentication are still controlled by the Shared folders
page. Only the āvirtual hostā features are moved to the new Virtual hosts
page.
Shared folder page could still provide HTTP (and even WebDAV) access but
- only the Apache default virtual host is configured (i.e. server IP in site URL)
- alias canāt be changed: is fixed to ibay name
- SSL certificate is always the default one