Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have just installed Apache and MySQL on a fresh Red Hat installation. Since I didn't have Red Hat install them for me, I don't have the ability to use Apache and MySQL as a service. No convenience of "/sbin/service httpd start". This isn't a huge inconvenience but since I want to know as much as possible about Linux and it's capabilities, I would like to create my own Bourne Script like the ones built during the installation of Red Hat. Has anyone here written their own script similar to the one created for Apache by Red Hat? If so, could you help? Thanks, Jeremy
I think Apache uses the service name httpd-perl (?) or something similar.
Try from a terminal:
chkconfig --list
That gives you a list of all services (at least the ones that chkconfig knows about). If it's not in that list, though, I am not too sure... probably like acid2000 says, it'd be under /etc/init.d/something-or-other.
I don't have an "/etc/init.d/apache" or "/etc/init.d/httpd". What do I do now? I know that I can start Apache like "/usr/local/apache2/bin/apachectl start" but that doesn't make it a service. I want to have the ability to go to the Services Tool and start/stop/restart from there if I wish. I know it's not critical but I would like to know how to do it. Thanks, Jeremy
I can't understand why you don't have an /etc/init.d/httpd script??? It should be created when you install apache. Anyway if I were to give you my /etc/init.d/httpd script would that help? You would have to go over it and see if all the paths are correct for you.
Yeah, it probably would. However, what about putting that path in your /etc/init.d/httpd file (if one doesn't exist, try creating one). Just fire up a text editor, open up /etc/init.d/httpd and type:
/usr/local/apache2/bin/apachectl
Save and exit. Now can you:
/etc/init.d/httpd start
?
I use apachectl personally, mainly because /etc/init.d/httpd isn't universal.
Hmmm...very interesting MasterC. Will it pass the 'start' argument to the apachectl command? You never cease to amaze me. No wonder you are the Master. I'm no scripter but wouldn't you have to do something like:
If I had your httpd file, I could modify it to suit my needs. If I get that, will it give me the ability to use the Service Tool to start/stop/restart the service from the GUI? Thanks, Jeremy
I don't know if it'd show up in your gui, but it might show up with chkconfig for ya. Via a system of symlinks you might be able to get it appear though, make it believe you installed the one from the distro's CD. The hitch is finding where the distro wants to look for things.
Following your directions, it does not pass the start parameter. I wouldn't mind seeing someone's /etc/init.d/httpd file so that WE can figure this out. I will be a guinea pig as long as I help someone out. Later, J
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.