Space in DocumentRoot folder name

Viewed 4504

I installed apache2 on ubuntu, I changed the DocumentRoot value to my work folder. my folder path is /home/user/My\ Works/sites so I changed my DocumentRoot to :

DocumentRoot /home/user/My\ Works/sites

but when I reload the apache I get this error:

Syntax error on line 4 of /etc/apache2/sites-enabled/mysite.conf: DocumentRoot takes one argument, Root directory of the document tree Action 'configtest' failed. The Apache error log may have more information. ...fail!

What should I do if I have space in my folder name?

2 Answers

I was getting the same error but my solution was adding quotes around the site that I added in httpd-vhost.conf. The URL of the site I added has a space in it, so the path required it to be in quotes.

Related