LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-28-2003, 04:49 PM   #1
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Rep: Reputation: 15
Apache Install


I followed the directions of the Apache Docs online. I have done a default install. I can start and stop the server but before I did a fresh install, I could run:

Code:
/sbin/service httpd start
and I'd get the little [OK] when things went well. How can I reset that up? Thanks, Jeremy
 
Old 02-28-2003, 04:52 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You need to modify your script /etc/rc.d/init.d/httpd - change all the pathes to fit your new installation.
 
Old 02-28-2003, 04:54 PM   #3
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Original Poster
Rep: Reputation: 15
I don't have a file like that. I have a fresh Red Hat install with no previous version of Apache on it. What to do now? Thanks, Jeremy
 
Old 02-28-2003, 05:06 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Look into /etc/rc.d/init.d, browse the files and find the one you find easiest to modify. Change programname to right Apache path and see if it works. After some modifications it will work.
 
Old 02-28-2003, 05:08 PM   #5
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Original Poster
Rep: Reputation: 15
Can I just create a new one? What does yours look like? Thanks, Jeremy
 
Old 02-28-2003, 05:16 PM   #6
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
If your just looking for a way to start httpd you can do:

/etc/init.d/httpd start

I don't know if this is what your after but its definetly an alternative.
 
Old 02-28-2003, 05:17 PM   #7
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Original Poster
Rep: Reputation: 15
There in lies the problem. I don't have a /etc/rc.d/init.d/httpd file. I need one. I either need someone to attach theirs or send me the code to create my own. Thanks, Jeremy
 
Old 02-28-2003, 05:30 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
In fact you can simply make a symlink. File apachectl (from the same directory httpd is in) can do.
./apachectl start
./apachectl stop
and so on...
 
Old 02-28-2003, 05:35 PM   #9
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Original Poster
Rep: Reputation: 15
I hate to be a burden but I'd really like to have someone's /etc/rc.d/init.d/httpd source so that I could do it the old way. I know it seems dumb but once you get used to something, you get used to it. All you have to do is:

Code:
kedit httpd
Copy, paste and BOOM, I'm cooking again. Thanks, Jeremy
 
Old 03-01-2003, 01:59 PM   #10
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
The thing is that I don't have it. But my boyfriend has a copy of his old one, so I can paste it.

I'm not really sure if it's a good idea. The file is quite long and symlinking apachectl seems to be a beter idea.

But...If you really want it... I hope there are longer posts...
Quote:
#!/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 TMP TMPDIR

### Hack for Status
LYNX="lynx -dump"
STATUSURL="http://localhost/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 gprintf "."; 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 gprintf "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 gprintf "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
gprintf "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
gprintf "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
gprintf "#######################################"
gprintf "#######################################\n"
if [ -x /usr/sbin/httpd -a -x /usr/sbin/httpd-perl ]; then
$LYNX $STATUSURLPERL | awk ' /process$/ { print; exit } { print } '
echo
gprintf "#######################################"
gprintf "#######################################\n"
fi
;;
status)
echo
if [ -e /var/run/httpd.pid ]; then
gprintf "Apache is running.\n"
gprintf "httpd: `pidof httpd`\n"
echo
fi
if [ -e /var/run/httpd-perl.pid ]; then
gprintf "Apache-mod_perl is running.\n"
gprintf "httpd-perl: `pidof httpd-perl`\n"
echo
fi
if [ ! -e /var/run/httpd.pid -a ! -e /var/run/httpd-perl.pid ]; then
gprintf "Apache is *not* running.\n"
echo
fi
gprintf "Use %s extendedstatus for more information.\n" "$0"
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
gprintf "Reloading httpd-perl: "
killproc httpd -USR1
echo
fi
if [ -x /usr/sbin/httpd -a -e /var/run/httpd.pid ]; then
gprintf "Reloading httpd: "
killproc httpd -USR1
echo
fi
fi
;;
configtest)
conftest
exit $?
;;
*)
gprintf "Usage: %s {start|stop|restart|reload/graceful|update|status|configtest}\n" "$0"
exit 1
esac

exit 0
 
Old 03-01-2003, 06:39 PM   #11
JCScoobyRS
Member
 
Registered: Dec 2002
Location: It's a Secret
Distribution: Gentoo
Posts: 79

Original Poster
Rep: Reputation: 15
Thanks Mara. I appreciate your help. I think that symlinking is "easier" and it might be my best bet. I do think that I'd like to look at your post so that I can see how I can make Apache a service like the /etc/rc.d/init.d/httpd file does. With that file, you can also make it where you can open the "Services" tool from the GUI and start and stop it from there. I thank you, Jeremy
 
  


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
How to install Apache stanleytiew Linux - Newbie 2 04-27-2005 10:07 AM
Apache virtualhost problems, apache install problems nyroc Linux - Software 2 06-09-2003 11:16 PM
RH8.0 : Need to uninstall Apache 2 and install Apache 1 ericcarlson Linux - Software 1 02-10-2003 02:13 PM
Apache 1.3.24 Install Help Lorddraco98 Slackware 5 04-27-2002 12:18 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 - Software

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