Apache2 does not comes up at booting as runlevel is unknow

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Apache2 does not comes up at booting as runlevel is unknow

跳至解决方案
2,256 次查看
praveen_ismd
Contributor I

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

标签 (2)
标记 (2)
0 项奖励
回复
1 解答
1,913 次查看
jimmychan
NXP TechSupport
NXP TechSupport

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.


在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,913 次查看
jimmychan
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
1,913 次查看
praveen_ismd
Contributor I

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 ?

0 项奖励
回复
1,914 次查看
jimmychan
NXP TechSupport
NXP TechSupport

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.


0 项奖励
回复
1,913 次查看
praveen_ismd
Contributor I

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

0 项奖励
回复
1,913 次查看
jimmychan
NXP TechSupport
NXP TechSupport

Good :-)

0 项奖励
回复