Saturday, May 5, 2018

centos - Apache doesn't start: syntax error....DocumentRoot must be a directory



I read all the previous answer but I couldn't fix my problem.. I'm changing the server where my website is hosted and I'm setting again apache.. Now, after installing php, fail2ban, etc i have that issue:




service httpd start 
Avvio di httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory
[FALLITO]


I've already disabled selinux and restarted, but nothing happened..



sestatus 
SELinux status: disabled



In other answer I read to post that.. But I don't know what it is, but I saw it is very different from other I saw..



ls -laZ /var/www/html/
drwxr-xr-x root root ? .
drwxr-xr-x root root ? ..
drwxr-xr-x root root ? form



Obviously my httpd.conf has



DocumentRoot "/var/www/html”


The root I need is



DocumentRoot "/var/www/html/form”



Now with the default root doesn't work, but before editing some files (I can't remember which) it started correctly.
I hope you can help me.. I am using cents 6.5 x64..
Thank you very much



Andrea


Answer



As ETL mentioned, your problem is almost certainly the quote character in DocumentRoot "/var/www/html/form” - you need to use DocumentRoot "/var/www/html/form" (or just DocumentRoot /var/www/html/form, which works fine.).



Never edit a configuration file like this in a text editor that replaces "" with “” or -- with , notably MS Word and Wordpad.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...