|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
if you installed by rpm try using chkconfig
chkconfig --help or man chkconfig |
|
#4
|
|||
|
|||
|
No I didnt use the rpm, used the tar,gz files & did a standard apache install
|
|
#5
|
|||
|
|||
|
Quote:
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 ? |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
||||
|
||||
|
Quote:
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. |
|
#8
|
|||
|
|||
|
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
|
|
#9
|
|||
|
|||
|
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
|
|
#10
|
|||
|
|||
|
Quote:
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. |
|
#11
|
||||
|
||||
|
Quote:
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. |
|
#12
|
|||
|
|||
|
Quote:
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. |
|
#13
|
|||
|
|||
|
Quote:
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 |
|
#14
|
|||
|
|||
|
Quote:
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. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > adding Apache to Redhat startup |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
Linear Mode |