I am trying to get Aegir working on CentOS 5. I followed the manual instructions and everything was going well until I tried to start apache. When I run the command:
/sbin/service httpd start
I get the following error:
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/aegir.conf: Permission denied
I have been all over the Internet trying to find out what I'm doing wrong and I cannot find anything that has helped me solve this. I have tried different permission settings and I cannot get anything to work with that either. I have also tried wiping everything and reinstalling everything using the manual process and I go through everything just fine, until I try to start the httpd service.
If I remove the symlink mentioned in the manual then I can start the httpd service fine and I get the Apache test page showing in my browser. However, I'd really like to get Aegir working.
Does anyone have any advice/tips for me to get this working?
Thanks!
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedOdd, what are the permissions on the synlinked file, i.e. could you post the results of:
and
Comment #2
bocaj CreditAttribution: bocaj commentedHi Steven,
Thanks for your quick response! I meant to post the permissions in my initial post and completely spaced it out. Here is what you requested:
Also here is the aegir.conf symlink in /etc/httpd/conf.d/ (in case that's helpful at all):
Before posting initially I tried changing /var/aegir/config/server_master/apache.conf permissions to 777 just to see if that was the issue and I still received the same permission denied error when trying to restart apache.
Also, while trying to figure things out I copied the apache.conf file from /var/aegir/config/server_master/ to /etc/httpd/conf.d/ and removed the aegir.conf symlink. I then got the following permission denied error:
Here is the permissions for pre.d:
All directories in /var/aegir/config/server_master have this permission. I'm not sure (obviously) if that is intended or not.
Thanks again for your help! I'm very excited to begin using Aegir!
Comment #3
theMusician CreditAttribution: theMusician commentedI ran into this error as well when doing an install on a RedHat6 VM. If you run the command with sudo I bet the error goes away. When I installed Aegir on my production VM I didn't get the error. It took me several install attempts to make it work properly. Are you starting Apache as the Aegir user or as your normal user? Don't forget to give your Aegir user sudo permissions for httpd. I am not sure if Cent OS 5 supports the apachectl syntax but give apachectl -k start a try and see if you get the same error.
Comment #4
bocaj CreditAttribution: bocaj commented@theMusician: Thanks for your reply. I have already tried starting apache as all users on the system (including root). No matter what user I use, I get the same permission denied error. I did try again just now just to make sure and it is still the same. All of the permissions seem to be fine so I don't know what I'm missing. Thanks again for your suggestion!
I did try restarting the entire server multiple times as well, just in case that's what was hanging me up, but the issue still persists.
Comment #5
theMusician CreditAttribution: theMusician commentedHmmm... Well just to see if this can be narrowed down. Does the same error occur for all of the following commands, please forgive me if this is erroneous syntax for centOS5.
httpd -k start
httpd -k stop
apachectl -k graceful
apachectl -k start
apachectl -k stop
Please give it a whirl as both the aegir user and as a super user. Thanks. Once this is solved, it runs great and it really is worth it.
Comment #6
theMusician CreditAttribution: theMusician commented@bocaj I looked back through my install notes, most of which I posted here as RedHat6 specific steps but I did see that when I created my aegir user through the gui and assigned it to the apache group it never worked. Only when I created my user on the command line and assigned a group with -g etc... did it work. I am not sure how you have your OS setup but staying out of the gui worked for me.
Comment #7
bocaj CreditAttribution: bocaj commented@theMusician: Thanks for your continued help!
Here is the response from each of the commands you asked about:
Regarding comment #6, I do not have a GUI installed on this server. Everything I have done has been through the command line.
Any other suggestions/ideas would be greatly appreciated. I'm excited to get started with Aegir!
Comment #8
bocaj CreditAttribution: bocaj commentedI finally got this working!! For anyone else that stumbles across this with the same issue, this is the post that I found that finally gave me the "green light": http://forums.fedoraforum.org/archive/index.php/t-106655.html.
Basically, all I needed to do was run this command:
on the apache.conf file in /var/aegir/config/server_master directory and everything is now working beautifully! (Maybe this should be included in the "Common installation problems" document on Aegir's website? Or maybe it's not common, but it sure made me pull my hair out for several hours!)
Maybe turning off SELinux would have done the same thing (or a better alternative?), but I'm just glad it's all working!
Now on to learning Aegir! Any tips?! ;)
Comment #9
Steven Jones CreditAttribution: Steven Jones commented@bocaj I'm glad that you got to the bottom of your issues, anyone can edit the documentation on the community site, you can just sign up and edit away! Please add your note if you feel others would benefit.
Comment #10
cridenour CreditAttribution: cridenour commentedHaving the same issue as the OP. However, using
httpd -k start
works!
I'm afraid that when Aegir needs to reboot apache, it won't be able to. How could httpd (from root) work but apachectl (from root) not work?
Running on RHEL 5.7, Apache 2.2.3.
Thanks!
Comment #11
theMusician CreditAttribution: theMusician commented#8 Great to see another solution bubble up. This still seems like a permissions error at some point in the installation. chcon is a new command for me.
#10 What does httpd -k restart do? For each server, you can set the command to use for apache. I personally, really like graceful. Have you installed Apache the standard way on RH?
Best of luck
Comment #12
anarcat CreditAttribution: anarcat commentedThis seems like a documentation issue, related to security contexts in Selinux. I encourage @bocaj to update the documentation and close this support request.
Comment #13
bocaj CreditAttribution: bocaj commentedUpdated "Common installation problems" page...
http://community.aegirproject.org/node/462#CentOS_aegir.conf_permission_...
Comment #14
cridenour CreditAttribution: cridenour commentedI updated my provision module to use httpd -k instead of apachectl and it worked great. Thanks for the help.
Comment #15
anarcat CreditAttribution: anarcat commentedThanks for the quick update!