LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-09-2002, 09:49 AM   #1
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Rep: Reputation: 15
Removing apache 1.3.19 after upgrade


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?
 
Old 10-09-2002, 12:28 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can edit the old script to run your new apache at boot. Or, if you have a new script written, you can delete all old ones.
 
Old 10-09-2002, 01:32 PM   #3
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
So all I have to do is change the references to httpd in the old script to the new directory? Thanks for your help.
 
Old 10-09-2002, 01:50 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Exactly, you only need to change pathes inside script files.
 
Old 10-09-2002, 02:10 PM   #5
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
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?
 
Old 10-09-2002, 04:24 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Could you post your script? It's hard to say without seeing it.
 
Old 10-09-2002, 05:40 PM   #7
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
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
Thanks for taking the time to go over this
 
Old 10-14-2002, 08:02 AM   #8
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
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.
 
Old 10-14-2002, 03:35 PM   #9
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
 
Old 10-14-2002, 07:52 PM   #10
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
Well thank you very much for your help.
 
  


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
removing old version of apache? dt4stat Linux - Newbie 2 03-19-2005 12:31 PM
Removing Apache 2 from Redhat 9 Jonpittam Linux - Newbie 3 12-01-2004 10:30 AM
removing apache disinformation Slackware 8 01-28-2004 09:22 AM
nvidia upgrade *removing old kernals* subservant Linux - General 4 02-24-2003 07:53 PM
Removing apache rpm and install apache from source john lee Linux - Software 2 11-15-2001 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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