LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compile and install (https://www.linuxquestions.org/questions/linux-newbie-8/compile-and-install-680943/)

pnmanojshenoy 11-03-2008 09:07 PM

Compile and install
 
Hi all,

I have compiled and installed http server on my system,

I started then service from /etc/httpd/bin/apachectl start

how can i start it through service httpd start.

And I want to know how can i cjkconfig the service and make it on while rebooting the system.


Thanks in advance.

wernerz 11-03-2008 10:32 PM

What distribution? (Debian, Fedora)

I also compiled my apache server. This is what I did:

Do these commands as root

1. cd /etc/init.d
2. ln -s /etc/httpd/bin/apachectl httpd
3. Put this line in you're /etc/rc.local to start service at boot,

/etc/init.d/httpd start

To stop, start and restart manually, # /etc/init.d/httpd [start stop restart]

If you want to start the service without putting full path /etc/init.d/httpd, create a file called httpd in /usr/local/bin. chmod 755 httpd. Put this code in the file:

Code:

#!/bin/bash
httpd()
{
if [ "$1" = "restart" ]; then
/etc/init.d/httpd restart
fi
if [ "$1" = "stop" ]; then
/etc/init.d/httpd stop
fi
if [ "$1" = "start" ]; then
/etc/init.d/httpd start
fi
if [ "$1" = "" ]; then
echo Usage: httpd [ start stop restart ]
fi
}
httpd $1
exit 0

Now you can run httpd "start stop restart". You need to be root to run the script.


All times are GMT -5. The time now is 03:42 AM.