LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-09-2004, 08:31 PM   #1
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Rep: Reputation: 15
starting httpd as service


Hi,
I recently compiled and installted apache 2.0. As was successful, however, when I try to run apachectl start in /wwwroot/bin (which contains apachectl) it telles me the command is not found. Does anyone have any suggestions? If more info is needed, please let me know.

Thank you very much for any help.
 
Old 04-10-2004, 01:38 AM   #2
shubb
Member
 
Registered: Oct 2003
Location: San Francisco
Distribution: Slackware 13.37
Posts: 150

Rep: Reputation: 16
Is that the real file, or is it linked to another file? use ls -al to see if it points to another file.

Usually binary excecuable files are put into /sbin, or /usr/sbin or some directory that is in the path. Try running updatedb (may take a while) and then run locate apachectl and see if there is a file in /usr/sbin or /sbin. If so, try running that one.

Also, I'm presuming that you are running this as root?
 
Old 04-10-2004, 03:15 AM   #3
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
apachectrl is generally put into <installdir>/bin and you should copy it to /etc/init.d/httpd - that should work fine...

<edit>When you have copied it across use service httpd start to start Apache </edit>
 
Old 04-10-2004, 05:16 PM   #4
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Original Poster
Rep: Reputation: 15
Hey all,

I tried both suggestions, to no avail. I was originally trying to run apachectl as root. The only location of apachectl (other than manual pages or support/doc files is the original install location /wwwroot/bin/apachectl. I tried copy that file to /etc/httpd (there does not exisy a directory /etc/init.d/httpd) and run service httpd start and several others, and it did not work. Any other suggestions? Thanks.
 
Old 04-10-2004, 08:08 PM   #5
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
K sorry, I should've made this more clearer:

When you do cp /usr/local/apache2/bin/apachctl /etc/init.d/httpd it just copies that file to /etc/init.d and renames it to httpd... This way you can do service httpd start - The /etc/httpd directory is only for the conf files....

Hope this helps
 
Old 04-10-2004, 09:32 PM   #6
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Original Poster
Rep: Reputation: 15
Ok,
I copied apachectl into /etc/init.d as httpd and when I run [B}service httpd start[/B] it tells me that it can't find service. Just a note, I did not install apache to its default directory (/usr/local/apache2), I installed it to /wwwroot. I have to admit I am new to Linux and your help is very valuable to me.

Thanks
 
Old 04-10-2004, 09:59 PM   #7
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Ok, can you do ls -l /etc/init.d/httpd and post the results. Also, are you running service as root?

You might also want to check /etc/httpd/httpd.conf and confirm that it all points to the right place (i.e. ServerRoot = /wwwroot)...
 
Old 04-12-2004, 12:12 AM   #8
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Original Poster
Rep: Reputation: 15
[strimp099@localhost strimp099]$ cd /etc/init.d
[root@localhost init.d]# pwd
/etc/init.d
[strimp099@localhost init.d]$ ls -la
total 276
...
-rwxr-xr-x 1 root root 3061 Apr 10 21:26 httpd
---amongst others, the rest are at the bottom of this post---

[strimp099@localhost init.d]$ cd /
[strimp099@localhost /]$ su
Password:
[root@localhost /]# service httpd start
bash: service: command not found
[root@localhost /]#

I did copy apachectl into /etc/init.d as httpd and I am trying the service command as root.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.0/mod....html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/wwwroot"

Server root is /wwwroot
If you can't think of anything, maybe you could tell me how to uninstall apache and I will try again with all the default commands (yuk). Thanks for the help and trust me, I haven't given up yet


drwxr-xr-x 2 root root 4096 Apr 10 21:26 .
drwxr-xr-x 10 root root 4096 Mar 9 23:52 ..
-rwxr-xr-x 1 root root 941 Jan 24 2003 anacron
-rwxr-xr-x 1 root root 1458 Feb 24 2003 apmd
-rwxr-xr-x 1 root root 1176 Jan 24 2003 atd
-rwxr-xr-x 1 root root 9435 Jan 27 2003 autofs
-rwxr-xr-x 1 root root 1316 Feb 19 2003 crond
-rwxr-xr-x 1 root root 2312 Oct 20 05:16 cups
-rwxr-xr-x 1 root root 1506 Feb 25 2003 firstboot
-rwxr-xr-x 1 root root 10332 Feb 3 2003 functions
-rwxr-xr-x 1 root root 1541 Jan 29 2003 gpm
-rwxr-xr-x 1 root root 5025 Jan 13 2003 halt
-rwxr-xr-x 1 root root 3061 Apr 10 21:26 httpd
-rwxr-xr-x 1 news news 2797 Jan 26 2003 innd
-rwxr-xr-x 1 root root 5528 Feb 3 2003 iptables
-rwxr-xr-x 1 root root 1414 Jan 24 2003 irda
-rwxr-xr-x 1 root root 5838 Feb 3 2003 isdn
-rwxr-xr-x 1 root root 1084 Mar 31 2003 kdcrotate
-rwxr-xr-x 1 root root 1335 Jan 30 2003 keytable
-rwxr-xr-x 1 root root 481 Jul 5 2002 killall
-rwxr-xr-x 1 root root 2163 Feb 25 2003 kudzu
-rwxr-xr-x 1 root root 1354 Mar 30 2003 lircd
-rwxr-xr-x 1 root root 1671 Feb 24 2003 lisa
-rwxr-xr-x 1 root root 2151 Apr 9 2003 lpd
-rwxr-xr-x 1 root root 1772 Sep 18 2003 mysqld
-rwxr-xr-x 1 root root 2201 Jan 25 2003 named
-rwxr-xr-x 1 root root 5080 Jan 6 2003 netfs
-rwxr-xr-x 1 root root 6784 Feb 3 2003 network
-rwxr-xr-x 1 root root 4522 Jun 20 2003 nfs
-rwxr-xr-x 1 root root 2343 Jun 20 2003 nfslock
-rwxr-xr-x 1 root root 2066 Nov 12 17:59 nscd
-rwxr-xr-x 1 root root 4054 Feb 13 2003 ntpd
-r-xr-xr-x 1 root root 4590 Jan 25 2003 pcmcia
-rwxr-xr-x 1 root root 1898 Feb 24 2003 portmap
-rwxr-xr-x 1 root root 2402 Jul 28 2003 postfix
-rwxr-xr-x 1 root root 6503 Nov 4 14:45 postgresql
-rwxr-xr-x 1 root root 1062 Jan 27 2003 pxe
-rwxr-xr-x 1 root root 1516 Jun 26 2002 random
-rwxr-xr-x 1 root root 2246 Jan 6 2003 rawdevices
-rwxr-xr-x 1 root root 1782 Aug 28 2003 rhnsd
-rwxr-xr-x 1 root root 1260 Jan 25 2003 saslauthd
-rwxr-xr-x 1 root root 2444 Sep 17 2003 sendmail
-rwxr-xr-x 1 root root 1175 Jul 10 2002 single
-rwxr-xr-x 1 root root 1928 Apr 5 2003 smb
-rwxr-xr-x 1 root root 1575 Nov 11 10:38 snmpd
-rwxr-xr-x 1 root root 1131 Nov 11 10:38 snmptrapd
-rwxr-xr-x 1 root root 1353 Feb 25 2003 spamassassin
-rwxr-xr-x 1 root root 2647 Sep 17 2003 sshd
-rwxr-xr-x 1 root root 1369 Feb 7 2003 syslog
-rwxr-xr-x 1 root root 2072 Feb 28 2003 vsftpd
-rwxr-xr-x 1 root root 1555 Apr 5 2003 winbind
-rwxr-xr-x 1 root root 3428 Feb 12 13:22 xfs
-rwxr-xr-x 1 root root 2285 Apr 16 2003 xinetd
-rwxr-xr-x 1 root root 2501 Jan 25 2003 ypbind
-rwxr-xr-x 1 root root 1638 Apr 30 2003 yppasswdd
-rwxr-xr-x 1 root root 1624 Apr 30 2003 ypserv
-rwxr-xr-x 1 root root 1133 Apr 30 2003 ypxfrd
 
Old 04-12-2004, 06:21 AM   #9
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Ok, when you do a su you still don't have FULL root permissions - you MUST do a su -... I guarantee this will work... Because Sudo only allows root to access certain applications (iptables, service, to name a couple) you have to do a full su -

Oh, and by the way, Linux is an absolutely great OS - very fun BUT, yes, it does take some getting used too, specially if you've got a Windoze background - you will NEVER stop learning (not a bad thing otherwise I wouldn't have stuck with it and develop for it)

Glad to see your not giving up...

<edit>To check whether your really root do a echo $USER - if you do just a su it'll show your own username, otherwise it'll show root</edit>

Last edited by AMMullan; 04-12-2004 at 03:20 PM.
 
Old 04-12-2004, 07:31 PM   #10
strimp099
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Fedora 12
Posts: 56

Original Poster
Rep: Reputation: 15
Ahh, the perils of Linux...
Well, with much of your help, man has conquered machine. In other words, the service has started and all is well.

I sincerely thank you for your help.
 
Old 04-12-2004, 07:38 PM   #11
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Some call it perils, some call it fun

Glad I could help, and now you know that little bit more about Linux and i'm sure one day you'll have the knowledge to help out noobies too
 
  


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
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 05:07 PM
service httpd status, results in httpd dead but subsys locked squadja Red Hat 2 09-11-2004 10:31 PM
Error Starting httpd Service - Please Help Speednow Linux - Networking 3 05-24-2003 02:10 PM
Error Starting httpd Service - Please Help Speednow Linux - Newbie 0 05-24-2003 01:16 PM
httpd service not starting... F$CK!!! xgtr Slackware 1 08-20-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:49 PM.

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