LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-10-2004, 11:46 PM   #1
msubramanian
LQ Newbie
 
Registered: Aug 2004
Location: temple, texas
Posts: 1

Rep: Reputation: 0
how to start apache server


I have installed Slackware 10 Linux and started Xwindows and KDE desktop. I don't know how to start Apache server and configure to use a DNS alias to function as a webserver. Will appreciate if you can help get started. Thanks


MS
 
Old 08-10-2004, 11:57 PM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 49
Slackware stores its startup scripts at /etc/rc.d. To make a script startup automatically at boot, just chmod them as executable (chmod +x <rc.filename>).
 
Old 08-11-2004, 12:39 AM   #3
redhatgeek
LQ Newbie
 
Registered: Jun 2004
Distribution: redhat/fedora
Posts: 24

Rep: Reputation: 15
http://sol4.net/linux/apache1.shtml

Starting Apache Server at Boot Time

Judging by the volume of emails hitting the inbox, this has got to be close to the top of the list of most common areas of confusion experienced by those just moved over to Linux from the Windoze world. In response to these emails, this page has been developed to cover all you need to solve the confusion caused by this issue, without using excessive technobabble which only makes things worse.



One thing to understand before continuing, is that this document has only been tested this under Slackware 8 and 9, Redhat Linux 6.2 and 7.1 with Apache installed in the default locations, as per the apache/php4 install HOWTO.


Location of startup files


Under Slackware Linux the startup scripts are located in /etc/rc.d/, plus the Apache startup procedure is the same regardless of if you boot to X or not. Whereas under Redhat Linux things are not as straightforward, the system startup scripts are located in the /etc/rc.d/init.d directory, which in turn is linked to from the specific runlevel startup scripts, which in turn are stored in /etc/rc.d/rcx.d directories (replace x with the runlevel you use). In my case I do not boot directly into X windows so I use runlevel 3, so my startup scripts are in /etc/rc.d/rc3.d and this is the directory that the Apache startup is to be linked to in this example.


Apache startup script


When built and installed from the source tarball, a script is installed in /usr/local/apache/bin called apachectl which is used to control the httpd daemon (apache itself). This script takes a number of command line parameters, with the ones you need to know about at this point being; start, stop and restart.


Starting Apache under Redhat


Under Redhat, to start Apache at boot time you, after logging in as root, you need to create the following link.

ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache



For Redhat 6.2

ln -s /etc/rc.d/init.d/apache /etc/rc.d/rc3.d/S37apache



For Redhat 7.1

ln -s /etc/rc.d/init.d/apache /etc/rc.d/rc3.d/S57apache



Looking at the above examples, you will notice the only difference is the name of the link. This difference makes sure that the Apache daemon starts after inetd or/and xinetd. Not really necessary in everyones opinion but something thats never caused any problems in the past, its up to you. Another thing that you will notice, and yes a number of users have emailed, about it, asking why the links are not direct from the runlevel script directory to the apachectl script, and yes you can do this, its just clearer not to, as you have one common of reference for future changes, this one is also really up to you.


The next time you boot you will see Apache added to the list startup, and hopefully a green OK.


Staring Apache under Slackware


As mentioned earlier, the startup scripts are very simple, there is no difference between the different run-levels as with Redhat. So regardless of how you boot, you start Apache automatically like this.


open /etc/rc.d/rc.local with your favorite text editor and add the following line to the bottom.

/usr/local/apache/bin/apachectl start



Thats it, next time you boot, you will get the following message just before you are prompted to login.

/usr/local/apache/bin/apachectl start: httpd started
 
  


Reply


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
How to manually start apache web server (SUSE9.2) Mic Q SUSE / openSUSE 4 07-10-2005 10:08 PM
How do I start apache web server? JockVSJock Slackware 25 05-15-2005 01:22 PM
chrooted apache server won't start tca23 Linux - Software 3 08-30-2004 09:51 AM
how to start automatically apache server when boot-up? eye Linux - Software 7 10-28-2003 02:22 PM
Can't start Apache on my Suse 8.1 pro LTSP server michael301080 Linux - Software 11 04-07-2003 06:07 AM


All times are GMT -5. The time now is 08:52 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration