0

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?

dreake
  • 3
  • 2

3 Answers3

2

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

xofer
  • 3,072
  • 12
  • 19
  • Thanks for replies. Indeed I need to remove it from DNS to have "no server found". And since I had deleted all vhosts it fallbacks to DocumentRoot. – dreake Sep 22 '11 at 08:52
1

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.

And then you expect

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

The DNS points to your webserver. Since there is a webserver listening, it replies with whatever it has left (HTTP 403) which probably because of forbidden directory listing.

The other places you must search are DNS servers.

Depends on though on what you want to eventually delete

user
  • 1,418
  • 8
  • 10
1

After you change apache configuration, you should reload apache: service apache2 reload.

To test which vhosts are in the current file configuration (as opposed to the running one), run: apache2ctl -D DUMP_VHOSTS -t

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83