Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Now that I have upgraded to apache2, the conf files and httpd are in /usr/local/apache2. The old files, /etc/rc.d/init.d/httpd and /etc/httpd/conf/httpd.conf and all that good stuff still reside on my machine, but as far as I can tell are not being used. Linux, though still wants to start the old httpd. Should I delete all the the old files or is there a way to relink to the new ones?
In /etc/rc5.d/init.d/httpd, I changed all occurances of /usr/sbin/httpd to /usr/local/apache2/bin/httpd and when I tried to start it, I got the message:
Starting httpd: execvp: No such file or directory
I didn't change the path to httpd-perl.conf because there was no new one. Could that cause the problem?
Ok. Here is the script before I made any changes to it:
Code:
#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/httpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
unset LS_COLORS KDE_DISPLAY BROWSER HELP_BROWSER GTK_RC_FILES XMODIFIERS
unset COLORTERM DISPLAY LOGNAME SESSION_MANAGER KDE_INITIAL_DESKTOP
unset TERM HOME USERNAME PWD ENV USER
### Hack for Status
LYNX="lynx -dump"
STATUSURL="http://localhost:81/server-status"
STATUSURLPERL="http://localhost:8200/server-status"
# Change the major functions into functions.
moduleargs() {
moduledir=/usr/lib/apache
moduleargs=
for module in ${moduledir}/*.so ; do
if [ -x ${module} ] ; then
module=`echo ${module} | awk '{\
gsub(".*/","");\
gsub("^mod_","");\
gsub("^lib","");\
gsub("\.so$","");\
print toupper($0)}'`
moduleargs="${moduleargs} -DHAVE_$module"
fi
done
echo ${moduleargs}
}
# Get the extra modules so only the main server gets them
extramoduleargs() {
extramoduledir=/usr/lib/apache-extramodules
extramoduleargs=
for extramodule in ${extramoduledir}/*.so ; do
if [ -x ${extramodule} ] ; then
extramodule=`echo ${extramodule} | awk '{\
gsub(".*/","");\
gsub("^mod_","");\
gsub("^lib","");\
gsub("\.so$","");\
print toupper($0)}'`
extramoduleargs="${extramoduleargs} -DHAVE_$extramodule"
fi
done
echo ${extramoduleargs}
}
### Hacks for the apache + proxified apache-mod_perl
# Assign all extra modules to both servers first
APACHEXMODS=`extramoduleargs`
PERLXMODS=`extramoduleargs`
COMMONMODS=`moduleargs`
#If both servers are installed, perl runs as a proxy
#and has no extra modules
if [ -x /usr/sbin/httpd -a -x /usr/sbin/httpd-perl ]; then
DEFINE="-DPERLPROXIED"
PERLXMODS=""
fi
PERLFILE="-f /etc/httpd/conf/httpd-perl.conf"
###
## Hack for ApacheJServ that takes forever to shut down and restart
snooze() {
for count in 1 2 3 4 5 6 7 8 9 ; do echo -n "."; sleep 1; done
echo
}
conftest() {
badconf=0
if [ -x /usr/sbin/httpd ]; then
action "Checking configuration sanity for httpd: " \
/usr/sbin/httpd -t \
$DEFINE $APACHEXMODS $COMMONMODS
badconf=$?
fi
if [ -x /usr/sbin/httpd-perl ]; then
action "Checking configuration sanity for httpd-perl: " \
/usr/sbin/httpd-perl -t \
$PERLFILE $DEFINE $PERLXMODS $COMMONMODS
[ $badconf = 0 ] && badconf=$?
fi
return $badconf
}
start() {
for tries in 1 2 3; do
if [ -x /usr/sbin/httpd-perl -a ! -e /var/run/httpd-perl.pid ]; then
if [ $tries -eq 1 ]; then echo -n "Starting httpd-perl: ";fi
daemon httpd-perl $PERLFILE $DEFINE $PERLXMODS $COMMONMODS
echo
for wait in 1 2 3 4 5;do
if [ ! -e /var/run/httpd-perl.pid ]; then sleep 1;fi
done
fi
if [ -x /usr/sbin/httpd -a ! -e /var/run/httpd.pid ]; then
if [ $tries -eq 1 ]; then echo -n "Starting httpd: ";fi
daemon httpd $DEFINE $APACHEXMODS $COMMONMODS
echo
for wait in 1 2 3 4 5;do
if [ ! -e /var/run/httpd.pid ]; then sleep 1;fi
done
fi
done
touch /var/lock/subsys/httpd
}
stop() {
if [ -x /usr/sbin/httpd-perl -a -e /var/run/httpd-perl.pid ]; then
echo -n "Shutting down httpd-perl: "
killproc httpd-perl
echo
rm -f /var/run/httpd-perl.pid
fi
if [ -x /usr/sbin/httpd -a -e /var/run/httpd.pid ]; then
echo -n "Shutting down httpd: "
killproc httpd
echo
if [ -e /usr/lib/apache-extramodules/mod_jserv.so ]; then
snooze
while [ -e /var/run/httpd.pid ]; do
echo Trying harder
snooze
killproc httpd
done
fi
rm -f /var/run/httpd.pid
fi
rm -f /var/lock/subsys/httpd
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
extendedstatus)
$LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
echo
echo -n "#######################################"
echo "#######################################"
if [ -x /usr/sbin/httpd -a -x /usr/sbin/httpd-perl ]; then
$LYNX $STATUSURLPERL | awk ' /process$/ { print; exit } { print } '
echo
echo -n "#######################################"
echo "#######################################"
fi
;;
status)
echo
if [ -e /var/run/httpd.pid ]; then
echo "Apache is running."
echo "httpd: `pidof httpd`"
echo
fi
if [ -e /var/run/httpd-perl.pid ]; then
echo "Apache-mod_perl is running."
echo "httpd-perl: `pidof httpd-perl`"
echo
fi
if [ ! -e /var/run/httpd.pid -a ! -e /var/run/httpd-perl.pid ]; then
echo "Apache is *not* running."
echo
fi
echo "Use $0 extendedstatus for more information."
echo
;;
restart)
stop
start
;;
update|condrestart)
if [ -e /var/run/httpd.pid -o -e /var/run/httpd-perl.pid ]; then
stop
conftest || exit $?
start
fi
;;
reload|graceful)
if [ -e /usr/lib/apache-extramodules/mod_jserv.so ]; then
stop
start
else
if [ -x /usr/sbin/httpd -a -e /var/run/httpd-perl.pid ]; then
echo -n "Reloading httpd-perl: "
killproc httpd -USR1
echo
fi
if [ -x /usr/sbin/httpd -a -e /var/run/httpd.pid ]; then
echo -n "Reloading httpd: "
killproc httpd -USR1
echo
fi
fi
;;
configtest)
conftest
exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|reload/graceful|update|status|configtest}"
exit 1
esac
exit 0
Did apache2 get rid of httpd-perl? I didn't see any new version to change the directory to in the script. I tried changing all occurances of /var/run/httpd.pid and /usr/sbin/httpd to the new directory but it gives me that execvp error.
It's enough to have much smaller script. In fact, all you need to have is
/usr/local/apache2/bin/apachectl start
to start your Apache and
/usr/local/apache2/bin/apachectl stop
to stop it. In my installation (I don't remember correctly, but I think so) there's no perl, o httpd-perl does not exist. I suppose it's similar with yours.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.