Forum Moderators: travelin cat
On a new set up on a second machine I get a forbidden error when I browse to [localhost...] though if I do [localhost...] it works just fine.
the hppd.config files are identical.... I copied it over.
also I have checked the permissions on the Sites dir... no difference
I am stumped.
Otherwise accessing the directory with the trailing slash (http;//localhost/~user/) and see if that makes a difference.
Otherwise accessing the directory with the trailing slash (http;//localhost/~user/) and see if that makes a difference. Makes no difference.
Check to see if there is a file called .htaccess in the folder (files that start with a dot are invisible to the finder, so you could use terminal or check out the tips in this thread [webmasterworld.com]). If it's not there, create it. Put this line it (you might to double check [httpd.apache.org] my syntax here):
Options Indexes
The webserver will read that (if AllowOverride is set in your httpd.conf). Or you can do this in your httpd.conf:
<Directory /path/to/folder>
Options Indexes
</Directory>
Fixing Forbidden for ~/username had nothing to do with
.htaccess
httpd.conf
Inside of /private/etc/httpd/users is a set of files for every user on the machine. When I looked in there I found that I was missing one of my users teresa.conf. So I copied pam.conf and renamed it teresa.conf. Did a sudo apachectl graceful. And Bob was my uncle.
Dang... this was hard. I will bet that buried in that httpd.config file there is some info about the server checking /private/etc/httpd/users/username.conf but I never saw it... don't know how I got so lucky to discover the missing file.
This little innocuous and undocumented line takes care of loading all of the special httpd.conf files for the users. A new file with standard settings is added to this folder whenever you create a new user profile.
Another way to make use of this feature is if you've got virtual host. Then you can keep the specific settings for these in separate files in a special folder.
I want to believe you... I really do. It seems like it makes so much sense. BUT I have no httpd.conf files... zero, nada, zip , goose egg. None of my users had httpd.conf files in their Sites dir so I did a system wide search [ find / -name httpd.conf -print ]and found two httpd.conf files sitting in some ancient GoLive projects that I had buried in the bowels of my documents dir. Near as I can tell my system is doing just fine without httpd.conf but it got ill when donna.conf went missing... donna.conf must have been getting called from somewhere other than httpd.conf.
Have I missed the obvious? Or is it that there is some other apple created file which is serving the same role as httpd.conf?
1) start Terminal
2) type : cd /etc/httpd
3) type : ls -aloF
4) type : cd users
5) type : ls -aloF
6) type : pwd
These files are normally hidden and can normally only be accessed through the Terminal. To get at them otherwise get hold of TinkerTool and set Finder up to show hidden files and folders.
httpd.conf is where I set up php to run
The httpd -V is a very neat tool with some good info displayed. I didn't see where the missing file /private/etc/httpd/user.conf is mentioned. So I am still a little baffeled how these various files work together... it seems alot like the configuration of the user environment for the shell... there are separate places to specify an environment for all users and also for any given user. I get the concept in a general way but don't actually see the links. Here is that httpd -V...
-D EAPI
-D HAVE_MMAP
-D USE_MMAP_SCOREBOARD
-D USE_MMAP_FILES
-D HAVE_FCNTL_SERIALIZED_ACCEPT
-D HAVE_FLOCK_SERIALIZED_ACCEPT
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D HARD_SERVER_LIMIT=2048
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard"
-D DEFAULT_LOCKFILE="/var/run/httpd.lock"
-D DEFAULT_ERRORLOG="/var/log/httpd/error_log"
-D TYPES_CONFIG_FILE="/etc/httpd/mime.types"
-D SERVER_CONFIG_FILE="/etc/httpd/httpd.conf"
-D ACCESS_CONFIG_FILE="/etc/httpd/access.conf"
-D RESOURCE_CONFIG_FILE="/etc/httpd/srm.conf"
The responses to my posting have been most enlightening. Thanks!
Include /private/etc/httpd/users
That tells Apache to include the contents of any and all the files in that directory as if it were part of httpd.conf. On OS X the user web configurations are stored there, each in a separate file.