I have to change the permissions of the htdocs directory in apache to a certain group and with certain read/write/execute.
htdocs
The directories need to have 775
Gordon's answer above is correct, but if you're trying to lock down access to a directory tree, it leaves scripts that are executable to the owner also executable to whoever has been granted the capital X.
Using
find -type d -exec chmod 775 {} +
or
find -type d -exec chmod 755 {} +
is safer.