httpd error

General support questions
Post Reply
Nacnud
Posts: 5
Joined: 2015/05/14 10:30:20

httpd error

Post by Nacnud » 2015/05/14 11:09:00

Hi
I am new to Centos having come from the other OS if you know what I mean, so I am having to work at this and it is, I must say, a great experience. Anyway as I learn the differences I am stuck with this particular issue, I have been searching and trying different solutions but as yet the answer evades me.

I am installing apache, I have installed httpd and it started up fine, as I am following instructions from a document, I did the part that requires me to create a virtual host, here is what I followed:

# mkdir -p /var/www/web1/web
# chown apache:apache /var/www/web1/web
# chmod 754 -R /var/www/web1/web
Then add the new vhost at the end of /etc/httpd/conf/httpd.conf:
# vi /etc/httpd/conf/httpd.conf
Add Include /etc/httpd/extra/httpd-vhosts.conf


But now when I try to start httpd I get the error "Syntax error on line 1005 of /etc/httpd/conf/httpd.conf: /etc/httpd/conf/httpd.conf:1005: <Directory> was not closed."

Looking at the conf file at that location I can't see anything that stands out if I'm honest, below is that part from the conf file I have bold the line that is supposedly wrong

# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/var/www/web1/web"
(line 1005 here)<Directory "/var/www/web1/web">
ServerName http://www.********.com:80
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
Include /etc/httpd/extra/httpd-vhosts.conf

Thanks very much for your help

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: httpd error

Post by TrevorH » 2015/05/14 12:04:54

# vi /etc/httpd/conf/httpd.conf
Since the default config already has an include for /etc/httpd/conf.d/*.conf this would be better either in there or just move your other config file into there and then you can keep httpd.cofn unmodified.

I'd guess that whatever file you are including doesn't have a </directory> line in it to match the opening one.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: httpd error

Post by MartinR » 2015/05/14 12:18:54

You need either: <Directory "/var/www/web1/web" />
or: <Directory "/var/www/web1/web"> ... </Directory>
Check the documentation to find whih is appropriate in your case.

Nacnud
Posts: 5
Joined: 2015/05/14 10:30:20

Re: httpd error

Post by Nacnud » 2015/05/18 11:12:13

Thank you very much that fixed my issue

Post Reply