0
votes

1) I created a copy of the default configuration file and renamed it to "livrets.com" (inside the /etc/apache2/sites-available directory)

2) I edited it as follow :

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName livrets.com
        ServerAlias www.livrets.com

        DocumentRoot /var/www/livrets.com/htdocs
        <Directory /var/www/livrets.com/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

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

3) I enabled it running sudo a2ensite livrets.com

4) I created directory /var/livrets.com/htdocs giving it 777 attributes (to be sure) and my user as owner : sudo chown -R fred:fred /var/www

5) I created an index.html file in /var/www/livrets.com/htdocs

6) I restarted apache

Still, when I type livrets.com URL in my browser, it does not display my /var/www/livrets.com/htdocs/index.html file.

Any idea ?

1

1 Answers

0
votes

You forgot to add an entry to your hosts file that tells your machine where to "look" when you are typing "livrets.com in your browser's address bar.

By default your machine will use the domain's DNS entry. By adding the following line to your hosts file...

127.0.0.1    livrets.com

...you are telling your machine, whenever you type "livrets.com" in your browser's address bar, to look at your own machine (127.0.0.1).

The "hosts" file is located at the /etc/ directory if you are using Linux, if you are on a Windows PC then it's at C:\Windows\System32\Drivers\etc\hosts, or at /private/etc/ if you are using a Mac.