N
N
Nick Bukovskiy2017-09-06 11:02:30
Apache HTTP Server
Nick Bukovskiy, 2017-09-06 11:02:30

The apache server does not see index.php when I set up virtual hosts, what am I doing wrong?

Added virtual host (teaser.mydomain.com.conf) to sites-available

<VirtualHost *:80>
        ServerName teaser.mydomain.com
        ServerAdmin [email protected]
        ServerAlias www.teaser.mydomain.com
        DocumentRoot /home/bukovskiy.n/teaser/public/index.php

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

added to hosts, added sudo a2ensite teaser.mydomain.com.conf
when restarting the server it says it doesn't see the index file, but it's there

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Kotelnikov, 2017-09-06
@sonterix

DocumentRoot should not point to a file, but to a directory serving as the root for the host.
The default file when navigating to this directory is specified using DirectoryIndex .
Those. in your case:

DirectoryIndex index.php
DocumentRoot /home/bukovskiy.n/teaser/public

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question