Skip to main content

Starting httpd: execvp: No such file or directory [FAILED]

I downloaded the source for the latest Apache HTTP and installed it

1. ./configure --enable-so
2. make
3. make install

When I ran
# /usr/local/apache2/bin/apachectl start
it was fine.
But it began to show errors when I tried to run
# /etc/init.d/httpd start

My /etc/init.d/httpd is as follows

. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting httpd: "
daemon httpd -DSSL
echo
touch /var/lock/subsys/httpd
;;
stop)
echo -n "Shutting down http: "
killproc httpd
echo
rm -f /var/lock/subsys/httpd
rm -f /usr/local/apache2/logs/httpd.pid
;;
status)
status httpd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading httpd: "
killproc httpd -HUP
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0


I have done
# chkconfig --add httpd
# chkconfig httpd on
# service httpd start

This command returned the following error:
[root@localhost conf]# service httpd start
Starting httpd: execvp: No such file or directory [FAILED]
I've double checked the path of apache installation and the one that I have specified in the init script.It was fine.
The solution is just simple
You can work on it in two ways.

1. Create a soft link to /usr/local/apache/bin/httpd under some System PATH
# ln -s /usr/local/apache/bin/httpd /usr/sbin/httpd
Then start httpd using the service command
2. Include the Apache Binary PATH into the /etc/init.d/functions file
Append /usr/local/apache/bin to the line similar to
PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
Thereafter it should look like
PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/apache2/bin"
Then start httpd using the service command

Apart from this always be aware of Permission too.
Follow ups
Plug.Org
mail-archives.apache.org

Comments

This falls into the "don't laugh at me too hard category", but I recently had a similar error with sshd. By a simple typo, after doing a "find / -name sshd", I figured out that I managed to move the entire directory "/usr/sbin" to be a sub-directory of mysql, including the sshd executable. That's what I get for upgrading MySQL after working 18 straight hours... hope this tip helps.

Popular posts from this blog

Check remote UDP connectivity from Linux

Hi there, You all know how to check TCP port connectivity from a Linux or UNIX machine to a remote machine using telnet as per th example below $ telnet 127.0.0.1 25 but we can't adopt TELNET to check UDP connectivity. Linux and most of the UNIXes come with a network layer utility called nc (abbreviation for netcat) which is very useful to check UDP connectivity and to explore a lot with both TCP and UDP. An example is shown below # nc -v -u -z -w 3 172.24.16.131 123 Connection to 172.24.16.131 123 port [udp/ntp] succeeded!

Squid dead but subsys locked

# /etc/init.d/squid status squid dead but subsys locked # df -h # rm -rf /var/run/squid.pid # rm -rf /var/lock/subsys/squid # tail -f /var/log/messages # tail -f /var/log/squid/cache.log # /etc/init.d/squid start 2007/12/28 09:57:16| Starting Squid Cache version 2.5.STABLE6 for i386-redhat-linux-gnu... 2007/12/28 09:57:16| Process ID 26701 2007/12/28 09:57:16| With 1024 file descriptors available 2007/12/28 09:57:16| DNS Socket created at 0.0.0.0, port 33056, FD 4 2007/12/28 09:57:16| Adding nameserver 202.XX.XX.XXX from /etc/resolv.conf 2007/12/28 09:57:16| Adding nameserver 202.XX.XX.XXX from /etc/resolv.conf 2007/12/28 09:57:16| Adding nameserver 192.168.0.254 from /etc/resolv.conf 2007/12/28 09:57:16| User-Agent logging is disabled. 2007/12/28 09:57:16| Referer logging is disabled. 2007/12/28 09:57:16| Unlinkd pipe opened on FD 9 2007/12/28 09:57:16| Swap maxSize 102400 KB, estimated 7876 objects 2007/12/28 09:57:16| Target number of buckets: 393 2007/12/28 09:57:16| Using 8192

postfix/smtp connect to gmail.com[64.233.171.83]: Connection timed out (port 25) server dropped connection without sending the initial SMTP greeting

Postfix has been configured fine. The mail is working in the local Domain - mydomain.com But when I try to send mails to outer domains,it produces the following "TIMEOUT" errors in /var/log/mail/info Nov 5 23:02:43 mydomain postfix/pickup[30923]: 419941C678: uid=555 from= Nov 5 23:02:43 mydomain postfix/cleanup[31536]: 419941C678: message-id=<20071106050243.419941C678@mydomain.com> Nov 5 23:02:43 mydomain postfix/qmgr[22926]: 419941C678: from= , size=330, nrcpt=1 (queue active) Nov 5 23:03:13 mydomain postfix/smtp[31538]: connect to yahoo.com[66.94.234.13]: Connection timed out (port 25) Nov 5 23:03:13 mydomain postfix/smtp[31538]: connect to yahoo.com[216.109.112.135]: server dropped connection without sending the initial SMTP greeting (port 25) Nov 5 23:03:13 mydomain postfix/smtp[31538]: 419941C678: to= , relay=none, delay=30, status=deferred (connect to yahoo.com[216.109.112.135]: server dropped connection without sending the initial SMTP greeting) N