How to install a patch file for the drupal-based site hosted under Linux?

If websites can be managed using cPanel

situation 1: with shell access

situation 2: without shell access