LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-03-2008, 09:07 PM   #1
pnmanojshenoy
Member
 
Registered: Jun 2008
Location: Cochin, India
Distribution: Debian,Ubuntu
Posts: 38

Rep: Reputation: 0
Cool 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.
 
Old 11-03-2008, 10:32 PM   #2
wernerz
Member
 
Registered: Jun 2008
Location: Ottawa, Ontario, Canada
Distribution: debian, dsl-n
Posts: 55

Rep: Reputation: 15
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.

Last edited by wernerz; 11-03-2008 at 10:38 PM.
 
  


Reply

Tags
compile, service, start


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
can't install g++ so I can't compile and install any programs musicmaniac414 Linux - Software 12 02-06-2008 09:31 PM
64 bit compile/install GregLee Linux - Software 3 06-20-2007 12:22 PM
How to compile+install? menvem Mandriva 3 09-29-2004 03:10 PM
how to compile and install 2.6.0?? trey85stang Slackware 29 01-05-2004 02:22 PM


All times are GMT -5. The time now is 01:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration