LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   httpd and tomcat start when boot (https://www.linuxquestions.org/questions/linux-newbie-8/httpd-and-tomcat-start-when-boot-945170/)

fachhoch@gmail.com 05-15-2012 06:00 PM

httpd and tomcat start when boot
 
I want httpd(apache http server) and tomcat to start when my box starts up, I installed httpd using yum and tomcat I did manual installation and I created tomcat file and added it to chkconfig

when I do chkconfig--list

I get this
Code:

[root@domU-12-31-39-0E-AA-22 ec2-user]# chkconfig --list
acpid          0:off  1:off  2:on    3:on    4:on    5:on    6:off
atd            0:off  1:off  2:off  3:on    4:on    5:on    6:off
auditd          0:off  1:off  2:on    3:on    4:on    5:on    6:off
cgconfig        0:off  1:off  2:off  3:off  4:off  5:off  6:off
cgred          0:off  1:off  2:off  3:off  4:off  5:off  6:off
cloud-init      0:off  1:off  2:on    3:on    4:on    5:on    6:off
cloud-init-user-scripts 0:off  1:off  2:on    3:on    4:on    5:on    6:off
crond          0:off  1:off  2:on    3:on    4:on    5:on    6:off
httpd          0:off  1:off  2:off  3:off  4:off  5:off  6:off
iptables        0:off  1:off  2:on    3:on    4:on    5:on    6:off
irqbalance      0:off  1:off  2:off  3:on    4:on    5:on    6:off
lvm2-monitor    0:off  1:on    2:on    3:on    4:on    5:on    6:off
mdmonitor      0:off  1:off  2:on    3:on    4:on    5:on    6:off
messagebus      0:off  1:off  2:on    3:on    4:on    5:on    6:off
netconsole      0:off  1:off  2:off  3:off  4:off  5:off  6:off
netfs          0:off  1:off  2:off  3:on    4:on    5:on    6:off
network        0:off  1:off  2:on    3:on    4:on    5:on    6:off
ntpd            0:off  1:off  2:on    3:on    4:on    5:on    6:off
ntpdate        0:off  1:off  2:on    3:on    4:on    5:on    6:off
psacct          0:off  1:off  2:off  3:off  4:off  5:off  6:off
racoon          0:off  1:off  2:off  3:off  4:off  5:off  6:off
rdisc          0:off  1:off  2:off  3:off  4:off  5:off  6:off
rsyslog        0:off  1:off  2:on    3:on    4:on    5:on    6:off
saslauthd      0:off  1:off  2:off  3:off  4:off  5:off  6:off
sendmail        0:off  1:off  2:on    3:on    4:on    5:on    6:off
sshd            0:off  1:off  2:on    3:on    4:on    5:on    6:off
tomcat          0:off  1:off  2:off  3:on    4:on    5:on    6:off
udev-post      0:off  1:on    2:on    3:on    4:on    5:on    6:off
yum-updatesd    0:off  1:off  2:on    3:on    4:on    5:on    6:off

this shows both tomcat and httpd .When I reboot machine both tomcat and httpd does not start , please help me. I want both of these to start automatically when I machine start up.Please advice.

ShadowCat8 05-15-2012 07:08 PM

Well,

Let's try to get a bit more information to find the core cause of the issue...

Can you get us the sections of the logs for both apache and tomcat where it attempts to start and then fails out? You can check a couple locations:
  1. /var/log/messages
  2. /var/log/apache2/error_log
  3. [/var/log/tomcat#/,/opt/tomcat#/logs/]catalina.out (Could be either directory, depending on your install. The '#' is the version number of your tomcat, which will be part of the path.)

HTH. Let us know.

fachhoch@gmail.com 05-15-2012 07:27 PM

here is logs for httpd/error_log

Code:


[Tue May 15 22:18:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:18:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:19:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:19:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:20:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:20:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:21:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:21:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:22:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:22:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:23:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:23:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:24:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:24:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:25:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:25:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:26:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:26:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:27:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:27:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:28:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:28:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:29:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:29:37 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:30:07 2012] [error] [client 10.70.91.131] File does not exist: /var/www/html/artms
[Tue May 15 22:30:12 2012] [notice] caught SIGTERM, shutting down
[Tue May 15 22:37:54 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue May 15 22:37:54 2012] [notice] Digest: generating secret for digest authentication ...
[Tue May 15 22:37:54 2012] [notice] Digest: done
[Tue May 15 22:37:54 2012] [notice] Apache/2.2.22 (Unix) DAV/2 configured -- resuming normal operations
[Tue May 15 22:37:56 2012] [error] [client 74.116.63.13] Directory index forbidden by Options directive: /var/www/html/
[Tue May 15 22:37:56 2012] [error] [client 74.116.63.13] File does not exist: /var/www/html/favicon.ico
[Tue May 15 22:40:20 2012] [notice] caught SIGTERM, shutting down
Unable to open logs
Unable to open logs



Quote:

Originally Posted by ShadowCat8 (Post 4679409)
Well,

Let's try to get a bit more information to find the core cause of the issue...

Can you get us the sections of the logs for both apache and tomcat where it attempts to start and then fails out? You can check a couple locations:
  1. /var/log/messages
  2. /var/log/apache2/error_log
  3. [/var/log/tomcat#/,/opt/tomcat#/logs/]catalina.out (Could be either directory, depending on your install. The '#' is the version number of your tomcat, which will be part of the path.)

HTH. Let us know.


Satyaveer Arya 05-16-2012 06:25 AM

Did you use these commands-

Code:

# chkconfig httpd on
# chkconfig tomcat on

If not then try these command and you'll get automatic start of these services whenver you reboot your machine.

linuxlover.chaitanya 05-16-2012 06:34 AM

Code:

httpd          0:off  1:off  2:off  3:off  4:off  5:off  6:off
This says it all. You need to enable httpd to start at boot using the command Satyaveer mentioned.

fachhoch@gmail.com 05-16-2012 07:48 AM

I tried as you said and rebooted .
checked service httpd status

got this

Code:

httpd dead but subsys locked
Quote:

Originally Posted by linuxlover.chaitanya (Post 4679811)
Code:

httpd          0:off  1:off  2:off  3:off  4:off  5:off  6:off
This says it all. You need to enable httpd to start at boot using the command Satyaveer mentioned.


linuxlover.chaitanya 05-16-2012 09:29 AM

There could be an issue with Apache configuration. Look into the error logs.

ShadowCat8 05-16-2012 02:58 PM

Hmmmm...

Well, from the following snippet of the original post:
Code:

tomcat          0:off  1:off  2:off  3:on    4:on    5:on    6:off
That says that Tomcat *should* be running on the standard boot of the machine and showing the "Install Success" page on http://domU-12-31-39-0E-AA-22:8080/ (by default configuration.)

So, when you try to browse to that page inside your network, or from the system itself, do you get anything? BTW, if you have no GUI on the server, or are only ssh'd into it, you can use 'lynx' to check it from the console on the server itself. You can try the above URL and/or try http://127.0.0.1:8080/ and see if anything comes up.

HTH. Let us know.

Satyaveer Arya 05-16-2012 09:34 PM

Quote:

httpd dead but subsys locked
Try this-

Code:

# rm -f  /var/lock/subsys/httpd
And again restart the httpd service-

Code:

# /etc/init.d/httpd restart


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