Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Oct 05, 2011 2:45 pm 
Offline
Senior Newbie

Joined: Thu Jan 20, 2011 1:03 pm
Posts: 13
Hi guys,

How is it I can have a site that appears on site-enabled but doesn't appear in sites-available? Then when I add it to sites-available and try to a2ensite the site, I get an Error which reads: the site is not properly enabled: /etc/apache2/sites-enabled/thewebsite.com is a real file, not touching it.

Apache actually says, "a real file, not touching it".

Not sure what to do.


Top
   
 Post subject:
PostPosted: Wed Oct 05, 2011 2:52 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
You might have placed the file in sites-enabled by accident. The best thing I can think of is copy the files from sites-enabled and sites-available elsewhere and disable everything in sites-enabled. After that, make sure that sites-enabled is empty and make sure that the correct files are in sites-available. From there, enable the sites you want and restart apache.

_________________
Kris the Piki Geeker


Top
   
 Post subject:
PostPosted: Wed Oct 05, 2011 3:34 pm 
Offline
Senior Newbie

Joined: Thu Jan 20, 2011 1:03 pm
Posts: 13
Thanks Piki,

I've got six sites running now which I'd rather not have to disable everything...but if it's as easy as a2ensite to enable them...well, I can do that.

But I'm not clear on how to empty the sites-enabled? Is there a cmd for this?


Top
   
PostPosted: Wed Oct 05, 2011 3:44 pm 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
mco2669 wrote:
Apache actually says, "a real file, not touching it".


I think it wants a link in that directory, not a "real file". Move the file to sites-available and link to it from sites-enabled, then try again.

James


Top
   
 Post subject:
PostPosted: Wed Oct 05, 2011 6:29 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
mco2669 wrote:
Thanks Piki,

I've got six sites running now which I'd rather not have to disable everything...but if it's as easy as a2ensite to enable them...well, I can do that.

But I'm not clear on how to empty the sites-enabled? Is there a cmd for this?


I've only seen a2ensite in reference to Debian, so I don't know if Debian has a command to disable sites, but I doubt that would help anyway if the actual files are in sites-enabled.

The first step would to see which files are in sites-enabled, and which are somewhere else and linked to sites-enabled. The first command is: (adjust the directory, I don't know where your sites-enabled and sites-available are)
Code:
ls -la /etc/apache/sites-enabled

This will display the file permissions, owner of the files, file size, date, file name, and then where the files are linked to (if any). For the files that do NOT show any links (which will be indicated by an arrow "->" then the file they are linked to), move these files to sites-available (again, adjust for your setup and file names):
Code:
mv /etc/apache/sites-enabled/yoursite.com /etc/apache/sites-available

After you do that for all the files that are NOT links, you should be fine and a2ensite should help you re-enable your sites. If you want to be completely certain it's fixed, do:
Code:
rm -f /etc/apache/sites-enabled/*

(again, adjust for your setup)
That will remove all the enabled sites, and a2ensite should work to re-enable them. You shouldn't need to do that, but if you want to be completely sure, it wouldn't hurt.

The reason that the files in sites-enabled should link to the files in sites-available is because in most cases, it's pointless to have two copies of the same file, and it's easier to link to the file and have changes take effect as soon as you restart apache rather than having to copy the file every time you need to change it. a2ensite is a script to make it easy to take a file that's already in sites-available and link it to sites-enabled without having to type out the command for creating the link (the command is easy to remember, it can just be a bit lengthy).

_________________
Kris the Piki Geeker


Top
   
 Post subject:
PostPosted: Thu Oct 06, 2011 10:33 am 
Offline
Senior Newbie

Joined: Thu Jan 20, 2011 1:03 pm
Posts: 13
Thanks for the explanation Piki. I did what you said and re-enabled them.
Looks to be working fine. Thanks, again.


Top
   
 Post subject:
PostPosted: Thu Oct 06, 2011 11:06 am 
Offline
Senior Member

Joined: Mon Dec 20, 2010 11:37 pm
Posts: 76
Piki wrote:
I've only seen a2ensite in reference to Debian, so I don't know if Debian has a command to disable sites


There is an a2dissite command :)
For modules, there are a2enmod and a2dismod.

Those commands just create symlink from sites/mods-available to sites/mods-enabled (or remove symlink from sites/mods-enabled using a2dissite/mod)


Top
   
 Post subject: Re:
PostPosted: Sun Dec 09, 2012 3:56 am 
Offline
Senior Newbie

Joined: Wed Oct 17, 2012 2:18 am
Posts: 6
drpks wrote:
There is an a2dissite command :)
For modules, there are a2enmod and a2dismod.

Those commands just create symlink from sites/mods-available to sites/mods-enabled (or remove symlink from sites/mods-enabled using a2dissite/mod)


Thanks that helped me!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group