Question

I setup the Apache virtual hosts but when i reach the domain, the server show the default page (/var/www/html)

Posted March 12, 2020 152 views
ApacheWordPressDNSDeployment

I`m trying to setup a doplet for wordpress apps. So, i create a virtual host for my site which has this configurations:

UseCanonicalName On
<VirtualHost *:80>
        ServerAdmin mikhaelipcn@gmail.com

        ServerName revistaestilooff.com.br
        ServerAlias www.revistaestilooff.com.br

        DocumentRoot /var/www/estilo_off/

        <Directory /var/www/estilo_off/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

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

After add this config with a2ssite and disable the 000-default with a2dssiste, i restar the apache2 but when i type the domain on browser, i`m getting the default page at /var/www/html

1 comment
  • into the error.log from apache:

    AH00112: Warning: DocumentRoot [/var/www/html/estilo_off] does not exist

    AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

    maybe its a permission issue?

    drwxr-sr-x 5 root www-data 4096 Mar 11 13:37 estilo_off
    drwxr-xr-x 5 www-data www-data 4096 Mar 10 20:50 html
    drwxr-xr-x 2 www-data www-data 4096 Jan 28 23:01 html.old

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there @mikhaelipcn,

What happens if you run an Apache config test with:

sudo apachectl-t 

Also the DocumentRoot should be specified without a trailing slash:

        DocumentRoot /var/www/estilo_off
        <Directory /var/www/estilo_off>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

After that change, try to restart Apache and test the site again.

Let me know how it goes!
Regards,
Bobby

  • when i run sudo apachectl -t:

    AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

  • i`m taking timeout when i try to acccess the site right now… maybe is server issue?

  • well, nothing changes )= i’m still getting the default page

    • Hi there @mikhaelipcn,

      What I could suggest is checking the content of your sites-enabled folder:

      sudo ls -l /etc/apache2/sites-enabled
      

      And make sure that you have a symlink for your estilo_off Vhost enabled there.

      Feel free to share the output here.

      It should look something like this:

      • ls -l /etc/apache2/sites-enabled/
      • total 36
      • lrwxrwxrwx 1 root root 35 Oct 3 08:46 your-vhost-name.conf -> ../sites-available/your-vhost-name.conf

      Basically in your sites-enabled folder, you should have a symlink for your estilo_off Vhost pointing to the /etc/apache2/sites-available folder, this is how Apache knows that it should load that particular Vhost.

      Regards,
      Bobby

Submit an Answer