filmov
tv
Linux - Change Permissions and Ownership for Web Files and Folders Root
Показать описание
Linux - Change Permissions and Ownership for Files and Folders/Web Root
Tutorial Contents:
Our Apache Web Server contains a Web Root folder. All our website folders and files need to be stored in the html directory inside the web root folder, in order for them to be web accessible.
To navigate to the folder, type the following command:
cd /var/www/html
Type ls to see the folders contents.
That's the default Apache page that loads when we access our IP address through a web browser.
Now return to the home folder by typing: cd /.
In order to be able to add, edit or delete files and folders in the web root folder, we need to have the right level of permission.
By default, only root users have permission to add or modify files in this folder.
In the next section of this course we will be uploading files to our web root folder, from our local computer using an FTP Agent. Since we are going to be connecting as user bob, we need to make sure bob has the necessary permissions to be able to upload, edit and delete files in the web root folder of our production server.
Before we give bob the permissions he needs, let's take a look at what permissions already exist.
Type in, ls -la /var/www
We can see three lines appear.
Each line, gives us the current permission structure of a specific folder or file.
The first line, represented by the single dot, gives us the permission structure of the current directory, which is the home directory.
The permission is represented by the "drwxr-xr-x".
The d stands for directory.
The rwx means user root, has read, write and execute permissions for this directory.
The r-x, means other group level users have read and execute permissions.
The second r-x, means everyone outside of root and group users, have read and execute permissions.
To give user bob, root level permissions for the Web root folder type:
sudo chown -R bob /var/www
The -R will recursively change ownership of directories and their contents to the user specified. In this case the user is bob and the directory is the web root folder (www).
#WebRoots #Ubuntu
Tutorial Contents:
Our Apache Web Server contains a Web Root folder. All our website folders and files need to be stored in the html directory inside the web root folder, in order for them to be web accessible.
To navigate to the folder, type the following command:
cd /var/www/html
Type ls to see the folders contents.
That's the default Apache page that loads when we access our IP address through a web browser.
Now return to the home folder by typing: cd /.
In order to be able to add, edit or delete files and folders in the web root folder, we need to have the right level of permission.
By default, only root users have permission to add or modify files in this folder.
In the next section of this course we will be uploading files to our web root folder, from our local computer using an FTP Agent. Since we are going to be connecting as user bob, we need to make sure bob has the necessary permissions to be able to upload, edit and delete files in the web root folder of our production server.
Before we give bob the permissions he needs, let's take a look at what permissions already exist.
Type in, ls -la /var/www
We can see three lines appear.
Each line, gives us the current permission structure of a specific folder or file.
The first line, represented by the single dot, gives us the permission structure of the current directory, which is the home directory.
The permission is represented by the "drwxr-xr-x".
The d stands for directory.
The rwx means user root, has read, write and execute permissions for this directory.
The r-x, means other group level users have read and execute permissions.
The second r-x, means everyone outside of root and group users, have read and execute permissions.
To give user bob, root level permissions for the Web root folder type:
sudo chown -R bob /var/www
The -R will recursively change ownership of directories and their contents to the user specified. In this case the user is bob and the directory is the web root folder (www).
#WebRoots #Ubuntu