How to make apache open files that have only owner execute permission for all users?

744 is not normal for directories. I would believe it should be 7[750][50], and 6[640][40] for files. Where I prefer "0"/"0" for "others" and "5"/"4" for groups.

For 745 I doubt there is a valid usecase: permissions really should trickle down from user to group to "others" so the user has the most permissions and others should have the least.

How can I change it so that it can open files that have -x permission only for owner while being logged in as the owner user?

  • Add the user to the group that owns the directories and files and set permissions to 750.
  • Change the owner of those directories and files from "test" to the user.

    chown -R $USER /var/www/
    

    (assuming /var/www/ is your root; adjust accordingly) would do that. By the way: if you only want user to execute you should use 700 and 600 or set the group to the name of the user and empty out the group from any other user.