I am try to configure virtual hosts, but the tutorial from DO doesn't works.

I use this tutorial from DO but, it doesn’t works:

I see that the structure of virtual host file configuration (Eg: example.config) is different that the tutorial is showing.

<VirtualHost *:80> ServerAdmin webaster@domain DocumentRoot /var/www/html

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

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

    <IfModule mod_dir.c>
        DirectoryIndex index.php index.cgi index.html index.xhtml index.htm


What is the problem?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @georodrigues,

It should be okay to use the following virtual host

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

It’s let’s say simpler than what you’ve posted. Having said that, you can use the one you’ve provided as well.

Can you confirm what’s the exact issue you are experiencing?

Regards, KDSys