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.
so_calAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Seth SimmonsSr. Systems AdministratorCommented:
missing closing quote; put quote after nrdp
/nrdp">'  instead of /nrdp>'
so_calAuthor Commented:
Yes, that's correct on the machine, I had a typo on here. Still same error.
arnoldCommented:
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.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Dan CraciunIT ConsultantCommented:
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
so_calAuthor Commented:
[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

so_calAuthor Commented:
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

Dan CraciunIT ConsultantCommented:
Yup, that's a directory directive. It should not be in /etc/init.d/httpd
so_calAuthor Commented:
Okay, so do I remove the entire contents of that? Move it somewhere else?
Dan CraciunIT ConsultantCommented:
So this is part of httpd.conf or /etc/httpd/conf.d/nrdp.conf:
<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
</Directory>

Open in new window


This is just the beginning of /etc/init.d/httpd:
# 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

Open in new window


Somewhere you mixed up things when following a tutorial. Re-read it carefully.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
so_calAuthor Commented:
Fantastic, thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.