flashwebhost
06-21-2004, 05:48 PM
Hi,
I got a server without cpanel.
Just downloaded Apache 2 from apache.org and installed it.
Now apache is running on the server.
I could get the apache default page with the IP of the server and also ps -aux shows
/usr/local/apache2/bin/httpd
But i can't get the status of apache like
service httpd status | start | stop
Nothing works. It says
[root@host1 root]# service httpd restart
httpd: unrecognized service
Also how i make httpd auto start ? I checked the setup, can't find apache listed there.
Regards,
Yujin
nexcess.net
06-21-2004, 06:26 PM
You need to copy the httpd.init that lives in <apache source archive dir>/build/rpm/httpd.init to /etc/init.d/httpd. Once there you should edit the /etc/init.d/httpd and change any paths at the top to match your configuration. After that to make apache start on boot just do:
chkconfig --level 345 httpd on
This all assumes redhat. If you're on another distro the "chkconfig" command may vary.
Chris
flashwebhost
06-22-2004, 03:40 AM
Thanks nexcess.net for the reply.
I installed apache from
Unix Source: httpd-2.0.49.tar.gz [PGP] [MD5]
available at
http://httpd.apache.org/download.cgi
http://www.signal42.com/mirrors/apache/httpd/httpd-2.0.49.tar.gz
Can't find httpd.init in it.
I tryed
[root@host1 /]# locate httpd.init
[root@host1 /]# find httpd.init
find: httpd.init: No such file or directory
but can't find the file.
OS is Fedora 1.0
Do i need to install from RPM ? If yes, where i can get RPM for Fedora ?
Regards,
Yujin
nexcess.net
06-22-2004, 01:10 PM
It's in there flashwebhost. If you 'cd' into httpd-2.0.49 it's in the "build/rpm" directory.
If you 'cd' into httpd-2.0.49 and type:
find . -name httpd.init
you'll see it.
Chris
flashwebhost
06-22-2004, 02:37 PM
Thanks nexcess.net, i got it working now.
Got few more problems. I can get status and stop httpd, when i start, getting following error.
[root@host1 etc]# service httpd start
Starting httpd: grep: /etc/httpd/conf/httpd.conf: No such file or directory
execvp: No such file or directory
[FAILED]
I solved it by
[root@host1 etc]# ln -s /usr/local/apache2/ httpd
Hope i am doing it correctly. Now the error is
[root@host1 etc]# service httpd start
Starting httpd: execvp: No such file or directory
[FAILED]
Think some configuration problem in /etc/init.d/httpd
My /etc/init.d/httpd file is
http://flashwebhost.com/httpd
Regards,
Yujin
nexcess.net
06-22-2004, 02:49 PM
Just symlink /usr/sbin/httpd to /usr/local/apache2/sbin/httpd and that should fix it. It looks like you updated the path to apachectl but not to the httpd server binary itself in the httpd init script.
ln -fs /usr/local/apache2/sbin/httpd /usr/sbin/httpd
Chris
flashwebhost
06-22-2004, 02:59 PM
Thanks a lot :-)
Got it working.....
ln -fs /usr/local/apache2/bin/httpd /usr/sbin/httpd