Apache hosts; how to remove host name

apache-2.2hosts

I have two domains that are redirected to my server IP. I removed (I think) all entires from /etc/apache/sites-available/* that was responsible for resolving those host names.

Now when I'm trying to use this domains, they still redirects to this IP (and it's OK since domains are still assigned to it) but to certain folder I don't know and it results with 403.

What I expect:

When I type the domain name in browser it should end with no server found.

Are there any other places that I must search to eventually delete something?

Best Answer

Apache will use the default configuration if there are no virtual hosts that match (or if virtual hosting is not enabled). You can find the directory with grep -ri DocumentRoot /etc/apache. The 403 error is likely caused by an empty DocumentRoot with Options -Indexes.

However, it sounds like you do not want to host any domains on this machine. If so, turn off Apache, remove any Listen directive (grep -ri Listen /etc/apache) or uninstall it.


NOTE the above assumes that Apache config files are located in /etc/apache However IIRC, the sites-available dir indicates that you're running Apache 2+ so, you may need to change paths to /etc/apache2

Related Topic