Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I already setup a conf for a site in the /etc/httpd/sites-available. However, I am wondering how can I enable this, like a2ensite in Debian, wherein the conf file will appear in the sites-enabled?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Mimicking the Debian config system isn't difficult.

  1. In your Apache config, you have to include everything in /etc/httpd/sites-enabled with the directive Include sites-enabled/*.
  2. Add the config to a file in /etc/httpd/sites-available.
  3. Activate the site in the config file by creating a link from the relevant file in /etc/httpd/sites-available into /etc/httpd/sites-enabled, which is basically the only thing that a2enable does on Debian.
share|improve this answer
    
I did ln -s but when I restart it failed to start the httpd. –  fishcracker Jan 28 '13 at 9:51
    
Please add the failure messages (and your current config, if possible) to your question. –  Sven Jan 28 '13 at 10:45
    
To clarify a bit, you need to edit your httpd.conf the directive to include the files in /etc/httpd/sites-enabled/. I have specified only the ones with a .conf extension using the following directive "Include sites-enabled/*.conf". You could also script a script to create and break the the link. –  flickerfly Aug 6 at 19:42

Activate:

ln -s /etc/httpd/sites-available/mysite.com /etc/httpd/conf.d/mysite.com

Deactivate:

unlink /etc/httpd/conf.d/mysite.com
share|improve this answer
    
I'm not sure why this was downvoted, perhaps because it doesn't include the step to actually bring those files into the config? What is here is accurate though. Also, unlink and rm are fundamentally the same. I avoid unlink as I've not come up with a scenario where it is better aside from an extremely small potential performance improvement. Details: serverfault.com/questions/38816/… –  flickerfly Aug 6 at 19:47

Your Answer

 
discard

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.