Fixing unable to chmod error if db file does not belong to Apache