Thay đổi thư mục Drupal và phân quyền File

Thay đổi thư mục Drupal và phân quyền File

Sometimes when you're trying to modify files or folders on your Drupal site, you'll be faced with error messages that will look like this:

"553 Can't open that file: permission denied"

One of our students wanted to know why they were getting this message about being denied.

What are permissions and how can you fix this problem? Read on ...

Explaining Permissions

permissions

There are 3 groups, self, group and public and three permissions you can give them: read, write and execute. Here's what they mean:

  • Self: That's you. When you access your site with username and password, you're connected as the user.
  • Group: That's you, too. And maybe others. If your site can be accessed with more than one username and password set, then those sets are also part of the group.
  • Public: That's everybody else. You want to be very careful about the permissions you give them.
  • Read: the ability to read a file.
  • Write: the ability to modify a file.
  • Execute: the ability to execute a file.

There's one final thing you need to know. Those permissions are sometimes given numbers:

  • Read: 4
  • Write: 2
  • Execute: 1

They are also added up. So, if the "Self" has permissions of 7, that means they can Read, Write and Execute. If "Public" has permissions of 4, they can only Read.

Drupal and file and folder permissions

To find out more a how file and folder permissions impact Drupal, click here to read the permissions documentation on Drupal.org.

How to change your permissions

In this example, I'm going to use CPanel as it is a control panel provided by default by many hosting companies.

However, you just need a way to access your files. You could use another hosting control panel or FTP software such as Filezilla.

Thay đổi thư mục Drupal và phân quyền File

Viewing your files

Inside CPanel I'm going to click on "File Manager" which will allow me to access your files. Here is what your Drupal site files will look like:

media_1359402909141.png

Change permissions

  • Select the file or folder whose permissions you want to change.
  • Click Change permissions.

media_1359402935028.png

  • You may well see a screen like the one below. Enter the settings you need.
  • Click Change Permissions.

media_1359402990344.png

777 spells danger

The one permission setting to always avoid is 777 because that means anyone can do anything to your folders!

The lower the numbers, the safer your site will be. A good setting to try here will be 755 but you may need to experiment because all servers are setup differently.

 

Bạn thấy bài viết này như thế nào?: 
Average: 5 (1 vote)
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Bài báo giới thiệu, viết về DRUPAL và WORDPRESS

Bài báo giới thiệu, viết về DRUPAL và WORDPRESS

A few months ago, I received a call from Karen who asked to present to the WP group to discuss how to transfer a site from Drupal to WordPress

Hãng Nokia - Phần Lan  phủ nhận việc sẽ sản xuất điện thoại Android

Hãng Nokia - Phần Lan phủ nhận việc sẽ sản xuất điện thoại Android

Sau một bài viết đăng tải trên trang Linkedln về việc hãng sản xuất Phần Lan đang muốn tuyển dụng một chuyên gia về Linux, nhiều người đã dự đoán rằng Nokia sẽ sản xuất điện thoại Android trong thời gian sắp tới. Ngay lập tức Doug Dawson – người đứng đầu quan hệ truyền thông của Nokia đã lên tiếng phủ nhận tin đồn này.

Bulldozer – Kỷ lục thế giới mới về ép xung được xác lập

Bulldozer – Kỷ lục thế giới mới về ép xung được xác lập

Ngay sau sự xuất hiện của Bulldozer, AMD đã trình diễn khả năng ép xung lên tới 8.43Ghz và lập kỷ lục thế giới.

Công ty diệt chuột T&C

 

Diet con trung