skip to Main Content

I’m attempting to configure simpleSAMLphp within a MAMP/Apache environment on Windows 10 and below is my httpd-vhosts.conf file:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot C:/MAMP/htdocs
</VirtualHost>

<VirtualHost *:80>
    ServerName simplesamlphp
    DocumentRoot C:/MAMP/htdocs/pro-dashboard

    Alias /simplesaml C:/MAMP/simplesamlphp/www

    <Directory C:/MAMP/simplesamlphp/www>
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

And here is my /etc/hosts file:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

# Virtual Hosts
    127.0.0.1   simplesamlphp

Apache starts via MAMP totally fine without including this httpd-vhosts.conf file in my httpd.conf file, but as soon as its included, Apache will not start so the issue appears to be with httpd-vhosts.conf. No errors are shown in the apache_error.log file. My Apache version is 2.2 so I believe my Directory directives in my second VirtualHost are correct.

I’ve tried double quoting the DocumentRoot’s, directory paths etc, and also tried backslashes over forward slashes. I spent most of yesterday trying to figure this out while scouring the web but nothing I found has made this work.

Any help is much appreciated!

2

Answers


  1. Chosen as BEST ANSWER

    So oddly enough, taking out what I had in httpd-vhosts.conf and simply putting it in my httpd.conf file makes Apache start back up.


  2. Try this modified config
    The path in Directory header same as DocumentRoot!

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot C:/MAMP/htdocs
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerName simplesamlphp
        DocumentRoot C:/MAMP/htdocs/pro-dashboard
    
        Alias /simplesaml C:/MAMP/simplesamlphp/www
    
        <Directory C:/MAMP/htdocs/pro-dashboard>
            Order allow,deny
            Allow from all
            AllowOverride All
        </Directory>
    
    </VirtualHost>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search