How to restrict to run commands in specific directory through SUDOERS?

view full story

http://unix.stackexchange.com – I can run chown and chmod commands by sudo system-wide, but want to run these commands in only /var/www/html directory. How can restrict commands to run only in specified directory by sudo permission? Not system-wide. Example: By following command 777 permission applied to index.html file. sudo chmod 777 /var/www/html/index.html Now I want to perform two actions Restrict sudo to run chmod and chown only in /var/www/html These command should not run in other places/directory.i.e user cannot use this command in /var/www or /var/ftp (HowTos)