Setting Permission to Localhost/Amazon Apache


I want to Configure my localhost as Shared Hosting Provider .. means if file having permission 777 it should show 500 Error (Writeable by owner) so if file permission is setted to 664 and folder permission is set to 775 it should execute my files ..else 500 SoftException show..

Please help me out..