LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-25-2007, 08:42 PM   #1
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Rep: Reputation: 15
httpd: Bad user name apache


Hi all,

I just installed Apache 1.3.37 on Ubuntu 6.06 minimal. It is in a chroot jail, along with PHP (and MySQL is in another chroot jail). I copied over the /etc/passwd and /etc/group files and they're in the jail, and I removed all of the other options. I am getting the "bad user name apache" error. Here is my etc/passwd file:

Code:
apache:x:1002:107::/chroot/apache:/bin/false
pwchk doesn't come up with any errors on this, so I know it's okay.

Here's the group file.

Code:
apache:x:107:
As far as I can tell, everything is okay, but for some reason, Apache doesn't want to start up. I am trying to start it up via the "chroot /chroot/apache /usr/local/apache/bin/httpd" command.

Thank you,

Splenden
 
Old 03-26-2007, 01:23 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
if apache is to listen on port 80 you have to run it as root. If you dont want to run it as root change the port in httpd.conf (but maybe im wrong - dont know whether chrooting changes that) i guess u better use /usr/local/apache/bin/apachectl start to start the server anyway
is there a user apache on your system?

Last edited by j-ray; 03-26-2007 at 01:28 AM.
 
Old 03-26-2007, 12:19 PM   #3
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
I am running it as root using the chroot command (which runs it as the current user - which is root). chrootuid changes the user to run it, so I'm not using that due to the 1024 port limitation.

As shown in my passwd and group file, there is a user apache on my system. It exists in both my true /etc/passwd and /etc/group and the one on the chroot.

Thank you,

Splenden
 
Old 03-26-2007, 12:31 PM   #4
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
I've ruled it out to something inside the chroot jail itself. Apache starts up fine whenever I try to start it up without the chroot jail limitation, and when I do so, it serves pages fine, too.

Permissions are being worked on. I made everything the permissions of the real /etc/passwd, /etc/group, and /etc/shadow and it still throws the bad user name error for some reason. I also removed the user name and it threw a bad group name error. It seems like it can't read /etc/passwd or /etc/group.

Splenden
 
Old 03-27-2007, 12:07 AM   #5
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Solved.

The problem was, I was missing a library. I did an strace and found the missing library that I didn't find via ldd and put it on the chroot, and it works now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
httpd: bad group name RichM Linux - General 1 02-23-2006 01:08 PM
bad httpd settings? buehler Linux - Software 1 04-24-2005 02:43 PM
httpd: bad group name { nobody | nogroup } itnix Linux - Software 3 04-21-2005 02:27 AM
bad user name httpd CyberEd Linux - Newbie 3 09-19-2003 03:19 PM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM

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

All times are GMT -5. The time now is 07:16 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