Y
Y
Yaroslav Alekseenko2019-03-05 00:11:32
Apache HTTP Server
Yaroslav Alekseenko, 2019-03-05 00:11:32

How to set up dynamic Virtualhost?

Good afternoon!
I'm trying to solve a problem for a local MAMP web server. I use XAMPP as the basis. The www folder contains folders like "hostname.dev" for the virtual host of the same name. All hosts are added by setting:

<Directory "/www/*/">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

<VirtualHost *>
    UseCanonicalName Off
    VirtualDocumentRoot /www/%0
</VirtualHost>

<VirtualHost _default_:443>
    ServerAdmin [email protected]
    UseCanonicalName Off
    VirtualDocumentRoot /www/%0
    SSLEngine on
    SSLCertificateFile "/Applications/XAMPP/xamppfiles/etc/ssl.crt/sslss.crt"
    SSLCertificateKeyFile "/Applications/XAMPP/xamppfiles/etc/sslss.key"
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
</VirtualHost>

Task ! Modify the settings so that the host folder contains 3 folders html, http, https. The first html is the subdomain and http and https are for defining the main host. For example, for the hostaname.dev domain, you need to create a Virtualhost with and without SSL, and also define the html.hostname.dev subdomain.
I hope I expressed myself clearly enough.
Thanks for your help, colleagues!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question