Automatic Startup of Apache
i am trying to get Apache to start automatically:
cp /usr/local/apache2/bin/apachect1 /etc/init.d/
then when i do /sbin/chkconfig --add apachect1
i get "service apachect1 does not suppoort chkconfig"
did anyone run into that before please let me know?
Short answer: the Apache daemon's name is httpd (apachectl is just a script that calls httpd with the appropriate arguments).
Slightly longer answer: In Fedora there's already an init script called /etc/init.d/httpd. This calls apachectl, which in turn calls the actual httpd daemon, so you don't need to add that to the list of services.
Instead, you can say:
/sbin/chkconfig --level 345 httpd on
(assuming you want Apache to run in runlevels 3, 4, and 5)
Or if you say system-config-services you'll get Fedora's service-control UI which will let you see what all your services are doing all at once.
i don't have httpd script under /etc/init.d niether do i have it on the Service Configuration window.
How did you install Apache?
i compiled the source code apache 2.0.51
./configure --enable-so --enable-rewrite --enable-deflate --enable-speling --enable-ssl --enable-usertrack
Path to installation is /usr/local/apache2
when i run /sbin/chkconfig --add /usr/local/apach2/bin/apachect1
this is the error:
error reading info on service /usr/local/apache2/: no such file or directory
Note: i had apache on when i installed fedora the RPM one and i uninstalled and i used to have httpd service as you mentioned but not anymore
thanks for your reply
A script in /etc/init.d needs to have chkconfig and description lines (as described in chkconfig's man page -- see the fifth and sixth lines in the code below) in order to get onto chkconfig's list.
I'm including the contents of Fedora's /etc/init.d/httpd below. You'll need to edit it to point the paths at your installation rather than Fedora's default, and add other options that you want (probably change start to startssl if you want it to run SSL-enabled, and so on).
Once you've done all that, you'll need to say
/sbin/chkconfig --add httpd
All that's if you want to do it right :). If you want a quick-and-dirty solution you can add a call to apachectl in /etc/rc.d/rc.local
I assume you're doing all this because you need something that's not in Fedora's default install?
Hope this helps.
m2azer: I suggest you to try, when it be possible, to install new software using RPM packages. This will avoid to experience this issues and you will have the choice to upgrade them using rpm -F command.
|All times are GMT -5. The time now is 08:49 AM.|