Q
Q
Quber2016-01-26 12:01:54
Web servers
Quber, 2016-01-26 12:01:54

Why does only the first virtualhost work in Apache?

I have several virtualhost settings in httpd.conf for different sites. So after restarting Apache, only the configuration that is higher than the others always works. Tried swapping them around, same effect.
Everyone has the same config, only the site names change:

<VirtualHost *:80>
  ServerName sait.local

  DocumentRoot /Applications/MAMP/htdocs/sait.local
  ServerAdmin [email protected]
  ServerAlias *.sait.local
  CustomLog /Applications/MAMP/htdocs/sait.local/app/logs/apache.access.log combined
  ErrorLog /Applications/MAMP/htdocs/sait.local/app/logs/apache.error.log

  <FilesMatch "\.ph(p[3-5]?|tml)$">
    SetHandler application/x-httpd-php
  </FilesMatch>
  <FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
  </FilesMatch>
  php_admin_value sendmail_path "/Applications/MAMP/htdocs/sait.local/app/emails/send -t -i -f [email protected]"
  php_admin_value upload_tmp_dir "/Applications/MAMP/htdocs/sait.local/web/uploads/temp"

    <Directory /Applications/MAMP/htdocs/sait.local>
        Options FollowSymLinks
        php_admin_flag engine on
        Options +Includes -ExecCGI
    </Directory>
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FernandoErrNando, 2016-01-26
@Quber

Is the NameVirtualHost directive set in the main config?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question