Apache Web server: Too many levels of symbolic links

After having this error presented to myself recently I thought it would be handy to let others know what it means!

So you’ve tried to restart/reload/start Apache on your Linux box and the following error has come up:

Too many levels of symbolic links

This is caused by one or more of the symlinks in the sites-enabled dir linking to its-self (maybe not directly but eventually ends up there :-(). I had my created my symlink using the command:

 ln -s <target> <destination>

But when I created the symlink my working directory was the same location as the file I wanted to link to, so I just typed:

ln -s somefile /var/somedir/somefile_link

Turns out this does not quite do as I had expected. (although not sure why)

The Solution

Basically the answer is to delete the symbolic link and start again this time using full path name, then is should all work:

ln -s /etc/apache2/sites-available/somefile /var/somedir/somefile_link
  • Leonardo

    Linux n00b here. I created a similar issue and you just helped me fix it.
    Thanks!

  • Magendiran

    I have also face the same issue and your instructions helped me lot to fix that issue.
    Thanks a lot.!

  • kizzard

    Thanks, you saved me some headache 🙂

  • Camilla

    Thank you very much for posting this. I recently had this issue and you helped me fix it!

  • Carlton

    Another Linux n00b here and you just saved me LOADS of time and stress. Thank you! 🙂

  • dav

    hey, thank u so much for posting this