Link to home
Start Free TrialLog in
Avatar of so_cal
so_calFlag for United States of America

asked on

service httpd start syntax error in Oracle Linux 7.1 running Nagios 4.1.1

I'm trying to run service httpd start, and it's giving me an error.
/etc/init.d/httpd: line 1: systax error near unexpected token 'newline'
/etc/init.d/httpd: line 1: '<Directory "/usr/local/nrdp>'

Open in new window

/etc/init.d/httpd: line 1: systax error near unexpected token 'newline'
/etc/init.d/httpd: line 1: '<Directory "/usr/local/nrdp>'

I'm using Oracle Linux 7.1 and running nagios 4.1.1 on VMware ESXi.
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

missing closing quote; put quote after nrdp
/nrdp">'  instead of /nrdp>'
Avatar of so_cal

ASKER

Yes, that's correct on the machine, I had a typo on here. Still same error.
Post the script as an inline attachment.

Did you modify it?
Try sh -v /etc/init.d/httpd

Your httpd file seems to be wrong. It needs to be a shell script not a httpd.conf like configuration file.

A Directory statement as displayed in the error does not belong in the start/stop httpd management script.
Can you please post the contents of /etc/init.d/httpd?
The line configuring Nagios NRPD should not be in that file, but in httpd.conf or /etc/httpd/conf.d/nrdp.conf.

HTH,
Dan
Avatar of so_cal

ASKER

[root@nagios ~]# sh -v /etc/init.d/httpd
<Directory "/usr/local/nrdp">
/etc/init.d/httpd: line 1: syntax error near unexpected token `newline'
/etc/init.d/httpd: line 1: `<Directory "/usr/local/nrdp">'
[root@nagios ~]#

Open in new window

Avatar of so_cal

ASKER

My httpd file:

<Directory "/usr/local/nrdp">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
#   AuthName "NRDP"
#   AuthType Basic
#   AuthUserFile /usr/local/nrdp/htpasswd.users
#  Require valid-user
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

</Directory>

Open in new window

Yup, that's a directory directive. It should not be in /etc/init.d/httpd
Avatar of so_cal

ASKER

Okay, so do I remove the entire contents of that? Move it somewhere else?
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of so_cal

ASKER

Fantastic, thank you!