This page is my "blog".
It's just a place to leave some thoughts and things that are going on. Some will be about software, some about humans and some about both. I'll try not to post about the brand of my new toothbrush unless it's really important :-)
03 Oct 2006
I just solved a problem that I gave up upon once - I tried again and succeeded at last. Such things feel great :-)
So maybe the combination of words I use here will help others to google the solution quicker.
When you set up an Apache Webserver, you might want to develop your files somewhere else, say, somewhere in your user directory (Apache normally resides in some system directory and it's not convenient to go there for development).
You'll soon find out that you need to make two changes to httpd.conf:
Change DocumentRoot to your home directory and change the corresponding <Directory "...path..."> entry to the same path. Then restart Apache.
Now when you browse your home directory, you might get an error, telling you that you don't have the permission to see anything there.
I spent a long time reading forum posts in the internet and fiddling around with the permissions of that DocumentRoot folder I wnated to use and its contents.
I used chmod to change the permission settings - no success.
I used chown to change the user and group who own the folder and its contents to 'www' (the default within httpd.conf) - no success. (By the way, always use the -R option, so you'll change all the content's ownership in that folder recursively)
Then I read this post that dealed with something different, but reading to the bottom was worthwile:
The whole path to your DocumentRoot folder must be accessible by the Group (and User) specified in httpd.conf. (I guess this holds when DocumentRoot is not within the Apache home directory)
So I changed the Group and User in httpd.conf to 'nic' (which is me on my local machine and I own the whole path to that directory), resetted all the ownerships on my development folder to 'nic' and it worked!
Note: Of course no one would want to do this in a production environment! This is just for testing on your local machine.
So maybe the combination of words I use here will help others to google the solution quicker.
When you set up an Apache Webserver, you might want to develop your files somewhere else, say, somewhere in your user directory (Apache normally resides in some system directory and it's not convenient to go there for development).
You'll soon find out that you need to make two changes to httpd.conf:
Change DocumentRoot to your home directory and change the corresponding <Directory "...path..."> entry to the same path. Then restart Apache.
Now when you browse your home directory, you might get an error, telling you that you don't have the permission to see anything there.
I spent a long time reading forum posts in the internet and fiddling around with the permissions of that DocumentRoot folder I wnated to use and its contents.
I used chmod to change the permission settings - no success.
I used chown to change the user and group who own the folder and its contents to 'www' (the default within httpd.conf) - no success. (By the way, always use the -R option, so you'll change all the content's ownership in that folder recursively)
Then I read this post that dealed with something different, but reading to the bottom was worthwile:
The whole path to your DocumentRoot folder must be accessible by the Group (and User) specified in httpd.conf. (I guess this holds when DocumentRoot is not within the Apache home directory)
So I changed the Group and User in httpd.conf to 'nic' (which is me on my local machine and I own the whole path to that directory), resetted all the ownerships on my development folder to 'nic' and it worked!
Note: Of course no one would want to do this in a production environment! This is just for testing on your local machine.
#
lastedited 03 Oct 2006
follow comments per RSS
You are seeing a selection of all entries on this page. See all there are.
Just wanted to note that my particular permissions problem turned out to be with SELinux, which is on by default on many installations, but runs mostly silently, so you'd never know unless you check. I had tried sym-linking the document root, a subdirectory, changing permissions, ownership, even moving the files didn't help. Presumably configuring SELinux would work, but I just turned it off to demonstrate that it was the problem.
You dont need to change user nor group. What you need to do is to just edit another line in httpd.conf. There are 2 of them which need to be changed.
DocumentRoot"C:/my/new/path"
<Directory "C:/my/new/path">
Adam:
I did those changes (and the article mentions that if you actually read it). That didn't do it for me.
You seem to be on a Windows PC and maybe this post only applies to Mac OSX. The original hint I used is on macosxhints.com)
I agree with "Adam M".
It start working as we changed path in both of lines.
Very old post but still.... Nic, many thanks for your help. Should solve my problem. Rtz and Adam M just dont seem to read (think) before they post
Thanks for the tip - it solved my issue!
still actual, thanks !