LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-02-2013, 10:09 AM   #1
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Rep: Reputation: Disabled
Exclamation Apache2 permission denied error on start


Hello,

I am extremely new to linux but I have the basic concepts down, I have a problem with apache2 on start, The error logs strangely show nothing related to what it says, all it says is:

* Starting web server apache2 /usr/sbin/apache2ctl: 139: /usr/sbin/apache2ctl: /etc/apache2: Permission denied
Action 'start' failed.
The Apache error log may have more information.

But as I said the error logs show nothing related. At one point it said there was no favicon.ico file which is not relevant and I fixed that. If you need anything else I would be glad to supply it, Also it may have to do with the whole httpd.conf thing which really confuses me any help on that too would be greatly appreciated.



Thanks for reading ,
bengalman211

Last edited by bengalman211; 07-02-2013 at 10:15 AM.
 
Old 07-02-2013, 01:10 PM   #2
slipstreamed
Member
 
Registered: Nov 2010
Posts: 60

Rep: Reputation: 24
Are you starting apache2 as a normal user? have you tried starting it as root?
 
Old 07-03-2013, 04:46 PM   #3
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Yes I have tried to start it as root and anything else I could think I even changed the permission of the files to my user
 
Old 07-04-2013, 12:28 AM   #4
slipstreamed
Member
 
Registered: Nov 2010
Posts: 60

Rep: Reputation: 24
run
Code:
httpd -s
what does it say?
check for SELinux
what distribution are you using? also start apache again and post the error log
 
Old 07-05-2013, 11:35 AM   #5
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
httpd -s returns the following:


No command 'httpd' found, did you mean:
Command 'xttpd' from package 'xtide' (universe)
Command 'http' from package 'httpie' (universe)
httpd: command not found

I am using linux mint 14 MATE


When I start apache2 the error log returns the following


[Thu Jun 13 11:25:17 2013] [notice] caught SIGTERM, shutting down


Notice that date is completely off it makes no sense so basically it isn't returning anything

I MIGHT be looking at the wrong file could you point me to where it might be?

Last edited by bengalman211; 07-05-2013 at 11:37 AM.
 
Old 07-06-2013, 03:32 AM   #6
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
Post the output of below command

check whether apache2 syntax ok message

#apache2ctl -t


List of all virtual hosts and default servers configuration

#apache2ctl -S

have you checked our apache logs & error logs .Which gives you hints to resolve
 
Old 07-06-2013, 04:45 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by bengalman211 View Post
(..) I even changed the permission of the files to my user
That's nice but it's wrong. I suggest you restore ownership and access rights before doing anything else because you're unnecessarily complicating things that way.
 
Old 07-06-2013, 08:33 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,494

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Has Apache ever worked or is this your first attempt at installing?
What method did you use to install? Did you use something like tasksel from the Software Manager? I know in Ubuntu and some of its derivatives you can install LAMP with a single command which includes any dependencies. What are the user:group in the /var/www directory/sub-directories?
 
Old 07-07-2013, 08:24 PM   #9
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
@arun5002


Both of the commands you suggested to run return the following:

*************-Laptop ~ $ apache2ctl -t
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
/usr/sbin/apache2ctl: 171: /usr/sbin/apache2ctl: /etc/apache2: Permission denied
Action '-t' failed.
The Apache error log may have more information.


*************-Laptop ~ $ apache2ctl -S
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
/usr/sbin/apache2ctl: 171: /usr/sbin/apache2ctl: /etc/apache2: Permission denied
Action '-S' failed.
The Apache error log may have more information.


Thanks for your support

@unSpawn


I have restored ownership thanks for telling me this....I was a little shakey for doing that Although I thought it was right because when I start apache2 one of the errors that came up was a Permission Denied error so I assumed Well if I give myself ownership That should fix it, I was wrong Thanks



@yancek


This is my first time installing it and I think I only installed Apache2....with

$Sudo apt-get install apache2
 
Old 07-08-2013, 11:46 AM   #10
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Although I thought it was right because when I start apache2 one of the errors that came up was a Permission Denied error
Quote:
* Restarting web server apache2 /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)


I guess that you are trying to start Apache with non root priviledge .

Try the below commands



#sudo service apache2 restart


#sudo apache2ctl -t


Quote:
*************-Laptop ~ $ apache2ctl -t
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
/usr/sbin/apache2ctl: 171: /usr/sbin/apache2ctl: /etc/apache2: Permission denied
Action '-t' failed.
The Apache error log may have more information.
 
Old 07-09-2013, 08:53 PM   #11
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by arun5002 View Post
I guess that you are trying to start Apache with non root priviledge .

Try the below commands



#sudo service apache2 restart


#sudo apache2ctl -t
****************-Laptop ~ $ sudo service apache2 restart
[sudo] password for ********:
/usr/sbin/apache2ctl: 161: /usr/sbin/apache2ctl: /etc/apache2: Permission denied
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
 
Old 07-09-2013, 09:19 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
What does '\ls -ald /usr/sbin/apache2ctl /etc/apache2 /var/www /var/log /var/log/apache2' return?
 
Old 07-10-2013, 12:18 PM   #13
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
What does '\ls -ald /usr/sbin/apache2ctl /etc/apache2 /var/www /var/log /var/log/apache2' return?
************-Laptop ~ $ \ls -ald /usr/sbin/apache2ctl /etc/apache2 /var/www /var/log /var/log/apache2


drwxr-xrwx 7 MyUser adm 4096 Jul 2 10:10 /etc/apache2
-rwxr-xr-x 1 MyUser root 6185 Jul 5 12:54 /usr/sbin/apache2ctl
drwxr-xr-x 16 root root 4096 Jul 10 10:23 /var/log
drwxr-x--- 2 MyUser adm 4096 Jun 17 01:54 /var/log/apache2
drwxr-xr-x 2 root root 4096 Jul 4 16:05 /var/www

Last edited by bengalman211; 07-10-2013 at 12:19 PM. Reason: Clarity
 
Old 07-10-2013, 02:09 PM   #14
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by bengalman211 View Post
Code:
drwxr-xrwx  7  MyUser  adm   4096  Jul   2  10:10  /etc/apache2
-rwxr-xr-x  1  MyUser  root  6185  Jul   5  12:54  /usr/sbin/apache2ctl
drwxr-x---  2  MyUser  adm   4096  Jun  17  01:54  /var/log/apache2
Reread post #7 and follow that advice.
 
Old 07-11-2013, 01:09 AM   #15
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
How would I go about setting all the files back to default owner/group?

---------- Post added 07-11-13 at 02:10 AM ----------

Should I switch everything to root owner/group?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
/etc/init.d/apache2 start ---> permission denied david008 Linux - Newbie 4 11-12-2008 11:13 AM
permission denied error mjalalynia Linux - Desktop 2 07-26-2008 01:28 AM
Permission Denied Error ckurowic Linux - Server 7 05-18-2007 03:33 AM
permission denied error endezeichen Linux - General 5 12-20-2003 06:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration