Laravel / Auto virtual host: add all folders in public as virtual host but no the public folder


  • | 173 points

    For some reason Largaon is creating all folders in the public folder root in laravel as virtual hosts:

    alt text

    Check all files publics are virtual hosts

    alt text


  • | 2024 points

    By default, the Document Root for Laragon is c:\laragon\www

    0_1600886982755_upload-e1906a26-1c47-4862-8b4a-e63baf03c874

    For largon to work its magic new projects should be directly under the document root. e.g. c:\laragon\www\honeyMail

    For your file structure, I'm guessing all your projects are on your E drive, maybe laravel projects and symfony projects etc. If so you would need to change the laragon document root to E: then stop and start laragon.

    You would then need to manually create your .conf files, one for each of your laravel projects. Laragon will automatically create one for auto.laravel.dev.conf in C:\laragon\etc\apache2\sites-enabled, take copies of this file, rename the copy and edit as required e.g.

    <VirtualHost *:80>
        DocumentRoot "E:/laravel/honeymeilArgon/honeyMail/public/"
        ServerName honeymail.dev
        ServerAlias *.honeymail.dev
        <Directory "E:/laravel/honeymeilArgon/honeyMail/public/">
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    

    Then add 127.0.0.1 honeymail.dev to your hosts file (click the H in Largon to easily open hosts)

    I hope this helps.


  • | 173 points

    Thanks for you reply, but now im getting this error when i use honeymail.dev: net::ERR_CERT_COMMON_NAME_INVALID

    I edited my hostname file and add 127.0.0.1 honeymail.dev

    For some reason when laragon starts delete the file. auto.laravel.dev.conf


  • | 2024 points

    ... im getting this error when i use honeymail.dev: net::ERR_CERT_COMMON_NAME_INVALID
    That sounds like a certificate error.

    • In Laragon preferences try changing your Hostname from (name).dev to {name}.local (or .test). As .dev is a valid domain name now.
    • Update your .conf and hosts file.
    • Laragon: Stop and Start All
    • Check your connection using HTTP (e.g. http://honeymail.local)
    • Troubleshoot your https connection - search the forum for certificate problems.

    For some reason when laragon starts delete the file. auto.laravel.dev.conf

    That's probably Laragon not detecting an index.php or index.html in the directory, so it doesn't auto-create the .conf file or thinks the config is invalid, so deletes it.

    • Rename any manually created .conf files from auto.{name}.dev.conf to manual.{name}.local.conf
    • You could optionally create an index.html with a list fo your projects in E:\laragon

    The manual ones will persist when Laragon starts.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.