I have a web server running on my home computer to serve up my personal website.
I recently switched from Ubuntu to Fedora. I enabled httpd and it showed the default page on http://localhost. I added an index.html to /var/www/html, and that showed up fine.
Next, I added a VirtualHost (in /etc/httpd/conf.d/example.conf for example.com and added it to my hosts file. My second site shows up fine at example.com, but it also shows up at localhost.
I haven't made any changes at all to the default httpd.conf, so DocumentRoot is still /var/www/html.
Here is the contents of my example.conf file:
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias *.example.com
# Indexes + Directory Root.
# DirectoryIndex index.html
DocumentRoot /home/user/example/
# CGI Directory
# ScriptAlias /cgi-bin/ /home/drj/wordpress/cgi-bin/
# <Location /cgi-bin>
# Options +ExecCGI
# </Location>
# Logfiles
ErrorLog logs/wordpress-error.log
CustomLog logs/wordpress-access.log combined
</VirtualHost>
<Directory /home/drj/wordpress>
AllowOverride All
Require all granted
</Directory>
I copied this directly from my original config in Ubuntu, changing only the paths for the logs.