Hi
I am working to i.MX53 QSB havig ubuntu 10.04 LUCID
I had installed apache2, and I want it to come up during boot time
I had already done update-rc.d apache2 defaults
but nothing is happend further I checked my runlevel which is coming "unknown"
so i tried to change /etc/init/rc-sysinit.conf file default runlevel to 3 but nothing happen
Please try to help me, in booting apache2 as system boots up
Solved! Go to Solution.
if runlevel=2, the init will run the links in /etc/rc2.d. So you can check the links in the /etc/rc2.d/ folder. The format is like Snnxxxxx. S means Start. nn is the sequence number. xxxxx is the service name.
So you can try to create a link in there by yourself.
sudo ln -s /etc/init.d/httpd /etc/rc2.d/S80httpd
Then you can write a simple script file /etc/init.d/httpd and 'chmod' the file httpd to 755.
The control interface of apache2 is 'apachectl'.
1. please try to copy 'apachectl' to /etc/init.d/
sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd (e.g. copy and rename it to httpd)
2. for ubuntu, the runlevel from 2 to 5 are the same. By default, in rc-sysinit.conf, env DEFAULT_RUNLEVEL=2.
3. for example: you can set it like below. 70 is the sequence number of Start. 80 is sequence number of Stop.
sudo update-rc.d httpd defaults 70 80
( it is equal to the command : sudo update-rc.d httpd start 70 2 3 4 5 . stop 80 0 1 6 . )
4. Use 'chkconfig' to check it
chkconfig httpd
Thanks for the response Jimmy
I dont have /usr/local/apache2 folder however i have apache2ctl in my /usr/sbin and /etc/bash_completion.d both having different content , i tried with both the file, but still apache2 is not coming up how ever by running this command
sudo service apache2 start or service sudo service httpd start , apache2 is able to come up, but still that is manual method, I need to do it automatically.
How shall I proceed now ?
if runlevel=2, the init will run the links in /etc/rc2.d. So you can check the links in the /etc/rc2.d/ folder. The format is like Snnxxxxx. S means Start. nn is the sequence number. xxxxx is the service name.
So you can try to create a link in there by yourself.
sudo ln -s /etc/init.d/httpd /etc/rc2.d/S80httpd
Then you can write a simple script file /etc/init.d/httpd and 'chmod' the file httpd to 755.
Hi Jimmy
Thank you very much for help
I am able to solve the problem, I made a conf file in /etc/int and sym linked /lib/init/startup-job to /etc/init.d/apache2 and its working fine
Good :-)