Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm doing this:

sudo ln –s /etc/apache2/sites-available/LoginProject /etc/apache2/sites-enabled/LoginProject

And I get:

ln: target `/etc/apache2/sites-enabled/LoginProject' is not a directory

/etc/apache2/sites-available/LoginProject it's a file


this command:

ls -l /etc/apache2/sites-enabled/LoginProject /etc/apache2/sites-available/LoginProject


ls: cannot access /etc/apache2/sites-enabled/LoginProject: No such file or directory
-rw-r--r-- 1 root root 526 2011-09-27 18:40 /etc/apache2/sites-available/LoginProject

edit 2:

$ls /etc/apache2/sites-available/
default  default-ssl  LoginProject

$ls /etc/apache2/sites-enabled/
share|improve this question
Can you add the ls -l /etc/apache2/sites-enabled/LoginProject /etc/apache2/sites-available/LoginProject output? – Belmin Fernandez Sep 27 '11 at 23:08
sure, there I added it – fceruti Sep 27 '11 at 23:11
up vote 4 down vote accepted

Try: sudo a2ensite LoginProject

You could also do sudo ln –s /etc/apache2/sites-available/LoginProject /etc/apache2/sites-enabled/

share|improve this answer
The file is: /etc/apache2/sites-available/LoginProject Anyway, I tried changing the order, and didn't worked – fceruti Sep 27 '11 at 23:22
Sorry that was wrong, see edit – xofer Sep 27 '11 at 23:23
Thanks! the a2ensite LoginProject worked! didn't tried the other command. It's still very weird... I really don't get it – fceruti Sep 27 '11 at 23:27
Normally, ln accepts 2 file paths and if it is more than two, the target must be a directory. I still wonder why it counts your parameters like this way!!! – SparX Sep 27 '11 at 23:33

You probably copied and pasted the ln -s command from another source and the system inserted the wrong type of -. Try deleting the - and typing it again manually.

share|improve this answer

Try quoting the directories and terminating the sudo command arguments like so:

sudo -- \ln –s "/etc/apache2/sites-available/LoginProject" "/etc/apache2/sites-enabled/LoginProject"
share|improve this answer
Nope, this didn't make the trick – fceruti Sep 27 '11 at 23:21
Made an edit. Try it again now. – Belmin Fernandez Sep 27 '11 at 23:24
I copy pasted that and got: ln: target `/etc/apache2/sites-enabled/LoginProject' is not a directory – fceruti Sep 27 '11 at 23:25
Man. I'm stomped. I've only seen that when the target exists. But your ls output shows that it does not. Wondering if it's an SELinux or ACL issue of some kind. Meh, you got it to work with @fuscata's answer. Good job :-) – Belmin Fernandez Sep 27 '11 at 23:27
Thanks for your time man, @fuscata got a solution, maybe not an answer to why that happend, but still... thanks again – fceruti Sep 27 '11 at 23:28

Try ln with single argument like below and see whether it helps,

cd /etc/apache2/sites-enabled/ ; sudo ln -s /etc/apache2/sites-available/LoginProject
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.