Set file and folder permissions in Linux

read-write-permission-attributes-linux
Convenient way to apply permissions in Linux is to save alias in .bashrc file:

Set all permissions for FTP:

alias setftpperm="chown -R _pure-ftpd:_pure-ftpd /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go-w /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/PUBLIC && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/TORRENTS"

Next is permissions for Apache:

alias setapacheperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go-w ."

alias setapachewperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go+w ."