Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old February 24th, 2003, 09:13 AM
DC Dalton DC Dalton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: NE Pa.
Posts: 96 DC Dalton User rank is Private First Class (20 - 50 Reputation Level)DC Dalton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 29 m 32 sec
Reputation Power: 8
adding Apache to Redhat startup

OK folks I dove into the pool this weekend & built myself a server from spare parts I have lying around. I have had enough of not understanding my server guys when they say something!

Threw Redhat 8 on it but didnt like the way it installed Apache (strange.....very strange) So I dumped the load again & installed w/o apache then did a manual install of Apache (httpd-2.0.44) ...ahh the "old fashioned way"

It works fine when I manually start it but after a reboot itsanogood! httpd isnt in the ntsysv so how the heck do I add this to the Redhat startup so its automatically started when the machine boots.

Ive installed Java, MySQL with no problems but Apache just doesnt seem to "play nice" ...any & all help would be deeply appreciated!
__________________
DC Dalton
DCD Designs
SCJP

Reply With Quote
  #2  
Old February 24th, 2003, 09:32 AM
kicken's Avatar
kicken kicken is offline
Wiser? Not exactly.
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2001
Location: Ft Myers, FL
Posts: 4,095 kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 2 Weeks 5 Days 21 h 53 m 13 sec
Reputation Power: 530
Send a message via ICQ to kicken Send a message via AIM to kicken Send a message via MSN to kicken
What I did with RH 7.3 was to add a line to /etc/rc.d/rc.local that looks like this:

Code:
/www/bin/apachectl start
/www/mysql/libexec/mysqld --user=mysql >/dev/null 2>/dev/null &


The first line is to start apache and the second to start mysql.

Reply With Quote
  #3  
Old February 24th, 2003, 01:02 PM
Jonas_G Jonas_G is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Belgium
Posts: 60 Jonas_G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
if you installed by rpm try using chkconfig
chkconfig --help or man chkconfig

Reply With Quote
  #4  
Old February 24th, 2003, 01:22 PM
DC Dalton DC Dalton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: NE Pa.
Posts: 96 DC Dalton User rank is Private First Class (20 - 50 Reputation Level)DC Dalton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 29 m 32 sec
Reputation Power: 8
No I didnt use the rpm, used the tar,gz files & did a standard apache install

Reply With Quote
  #5  
Old February 24th, 2003, 01:26 PM
Jonas_G Jonas_G is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Belgium
Posts: 60 Jonas_G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Quote:
Originally posted by kicken
What I did with RH 7.3 was to add a line to /etc/rc.d/rc.local that looks like this:

Code:
/www/bin/apachectl start
/www/mysql/libexec/mysqld --user=mysql >/dev/null 2>/dev/null &


The first line is to start apache and the second to start mysql.


why is the >/dev/null 2>/dev/null & needed
> /dev/null outputs everything to /dev/null
but 2>/dev/null I don't understand
and I don't understand also why you want to output it there is no need for it or is it ?

Reply With Quote
  #6  
Old February 24th, 2003, 01:34 PM
DC Dalton DC Dalton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: NE Pa.
Posts: 96 DC Dalton User rank is Private First Class (20 - 50 Reputation Level)DC Dalton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 29 m 32 sec
Reputation Power: 8
Talking

Thanks a ton, that worked just great...Ill have to keep that one around as I learn how to run this bad boy...

BTW, can anyone suggest a good book for Red Hat administration. I have a real hard time reading tons of stuff on the web (kills my eyes) & I would like a good learning tool / refernce book for just such occasions.

Once again, thanks

Reply With Quote
  #7  
Old February 24th, 2003, 09:57 PM
kicken's Avatar
kicken kicken is offline
Wiser? Not exactly.
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2001
Location: Ft Myers, FL
Posts: 4,095 kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 2 Weeks 5 Days 21 h 53 m 13 sec
Reputation Power: 530
Send a message via ICQ to kicken Send a message via AIM to kicken Send a message via MSN to kicken
Quote:
Originally posted by Jonas_G
why is the >/dev/null 2>/dev/null & needed
> /dev/null outputs everything to /dev/null
but 2>/dev/null I don't understand
and I don't understand also why you want to output it there is no need for it or is it ?


I just redirected both stdout and stderr to /dev/null since I don't have a use for what it outputs. Not sure if mysqld uses stderr, but I redirected it anyway.

Reply With Quote
  #8  
Old February 25th, 2003, 08:46 AM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 21 h 28 m 41 sec
Reputation Power: 19
BTW the generally accepted way to start up daemons is by creating symlinks in the /etc/rc{runlevel} directory which points to the script in /etc/rc.d dir

Reply With Quote
  #9  
Old February 25th, 2003, 10:10 AM
Jonas_G Jonas_G is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Belgium
Posts: 60 Jonas_G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
and how do you do this like I want to startup apache on boot in all run levels and it is installed in /wwwroot/bin/apachectl

Reply With Quote
  #10  
Old February 25th, 2003, 11:04 AM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 21 h 28 m 41 sec
Reputation Power: 19
Quote:
Originally posted by Jonas_G
and how do you do this like I want to startup apache on boot in all run levels and it is installed in /wwwroot/bin/apachectl


Well, when I installed it apache created a script in /etc/rc.d called httpd with parms of start, stop, restart. This is the file I symlinked to.

It may have changed in subsequent releases, last time I used redhat was 7.2. That's the reason I quit Redhat, things change every release. I now run OpenBSD... but I digress.

Reply With Quote
  #11  
Old February 25th, 2003, 11:23 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
Quote:
Originally posted by hedge
Well, when I installed it apache created a script in /etc/rc.d called httpd with parms of start, stop, restart. This is the file I symlinked to.



It only did this if you installed from RPM. For some reason, Redhat doesn't use the standard apachectl script for starting/stopping the daemon. BTW, this has been exactly the same for all versions of Redhat from 6.0 to 8.0. Nothing has changed from release to release except the version of apache that comes by default. So things don't always change in redhat (at least not when it comes to starting/stopping services), that's just your opinion.

Anyway, you should be able to simlink to the apachectl that was installed as part of your source install.

Reply With Quote
  #12  
Old February 25th, 2003, 02:32 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 21 h 28 m 41 sec
Reputation Power: 19
Quote:
Originally posted by Hero Zzyzzx
BTW, this has been exactly the same for all versions of Redhat from 6.0 to 8.0. Nothing has changed from release to release except the version of apache that comes by default. So things don't always change in redhat (at least not when it comes to starting/stopping services), that's just your opinion.

Anyway, you should be able to simlink to the apachectl that was installed as part of your source install.


Well true enough, but my comment was more in general, not limited to this one issue. I used redhat from 6.1 to 7.3 and there was always something changing between releases, to be fair I haven't used BSD long enough to see if it is the same or not. I mostly chose to go to BSD as a curiosity.

Reply With Quote
  #13  
Old February 25th, 2003, 03:33 PM
Jonas_G Jonas_G is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Belgium
Posts: 60 Jonas_G User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Quote:
Originally posted by hedge
Well, when I installed it apache created a script in /etc/rc.d called httpd with parms of start, stop, restart. This is the file I symlinked to.

It may have changed in subsequent releases, last time I used redhat was 7.2. That's the reason I quit Redhat, things change every release. I now run OpenBSD... but I digress.


when you do a source install apache 2.X doesn't install anything in your /etc/rc.d dir or subdirs
the way i do it now is by adding /wwwroot/bin/apachectl start to /etc/rc.d/rc.local it works but you say it isn't the right way but how can I do it "the right way" if nothing gets installed in/etc/rc.d

Reply With Quote
  #14  
Old February 25th, 2003, 04:49 PM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 21 h 28 m 41 sec
Reputation Power: 19
Quote:
Originally posted by Jonas_G
when you do a source install apache 2.X doesn't install anything in your /etc/rc.d dir or subdirs
the way i do it now is by adding /wwwroot/bin/apachectl start to /etc/rc.d/rc.local it works but you say it isn't the right way but how can I do it "the right way" if nothing gets installed in/etc/rc.d


Poor choice of words on my part.

As noted above, I think my experience was from using the rpm. I wasn't trying to imply this was the "right way". I am in no way an expert. Seems to be many ways to accomplish the task.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > adding Apache to Redhat startup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Linear Mode Linear Mode</