How to resolve /var/www copy/write permission denied?
it'matter of *unix permissions, gain root acces, for example by typing
sudo su
[then type your password]
and try to do what you have to do
Proper owner of var/www/html
Some CMSes and Wordpress is especially bad about that because it's actually in the code to use the web user.
BTW you should never need to use root
for ftp. www-data
the default apache user on ubuntu should own your web files/directory to work properly with many cmses.
So this is what has worked before and what we did for clients with the same issue. chown the whole web root as www-data
for both user and group
.
So if your document root is /var/www/html
, cd or change directory to /var/www
and run this to change ownership on all files and directories.
chown -R www-data: html/
while still in the /var/www
directory add write permissions to the group for files and directories by running this command.
find html -type f -exec chmod 664 {} + -o -type d -exec chmod 775 {} +
Finally add your FTP user to the www-data
group.
usermod -a -G www-data username
Replace usename with your FTP client username
Now this setup should allow you to use manage files and still allow the CMS ftp backend to still function and write to the direc. Let me know how that works for you.
www-data permissions?
sudo chown -R yourname:www-data cake
then
sudo chmod -R g+s cake
First command changes owner and group.
Second command adds s attribute which will keep new files and directories within cake having the same group permissions.
cd /var/www: Permission denied
I found the answer:
Inputting unicorn
into "$USER"
should result with "unicorn"
with quotes, instead of merely unicorn
.
Edit Contents for A Website
It is a little difficult to decipher what you're looking to accomplish. So I'll just go over a couple basics :)
HTML files act as the core structure of many sites. HTML files section off your site into blocks (Note the tags in your HTML file), and can be used to insert text onto the page. HTML files frequently reference CSS Files. CSS Files are used to format the regions and materials created in the HTML file (Like Colors, Margins, Padding, etc). If you're not looking to change the appearance of your site, then modifying the CSS file is not likely what you're looking to do. Javascript has a wide variety of uses. Usually, a developer would use Javascript to incorporate some arbitrary "Event" or "Action" (Like Dynamically changing content)
From your question, it sounds as though your boss is not asking you to change the functionality of your site, rather just the content. In that case, my first recommendation would be to direct you to the HTML File. HTML files are not encoded, so you can open them in a text editor. However, I would recommend you use an IDE (Integrated Development Environment). Download Brackets IDE to modify your HTML file with convenience. It was developed by Adobe Systems and works great. http://brackets.io/
If you are looking to simply change a mailing address, then find the mailing address in your HTML file, and replace it with your new address. If your HTML file is very large, then you can search the entire file using a hotkey (Ctrl + F).
If you would like to understand the HTML language better, I would recommend W3 Schools https://www.w3schools.com/html/ . This tutorial will help you understand what you're looking at in the HTML (Just in case your file requires some additional editing)
I hope this helps!
A general linux file permissions question: Apache and WordPress
What should I do to make them readable and writable by both kovshenin and apache?
- Create a new group, say "wordpress".
- Add both koveshenin and www-data users to the wordpress group.
- Change the group owner of all the files to wordpress (using chgrp).
- Make sure all the files are group writeable.
- Set the g+s (setgid) permission bit on all the directories of interest.
- Make sure kovshenin and apache's default umask includes group read & write permission.
The second last step is the trick. It means that whenever kovshenin or apache creates a file in those directories, the group owner will be set to wordpress (instead of kovshenin or apache).
Permission denied inside /var/www/html when creating a website and it's files with the apache2 server
sudo chown -R $USER:$USER /var/www
this works, it changes the owner to my user instead of root user. I still don't understand because my user already had sudo rights and all those permissions. It was the user I created during the ubuntu18.04 setup, so there shouldn't be an issue, or idk.
Related Topics
Is It Correct to Use The Rc.Local File to Start a Program When The System Starts
How Does One Override an Existing Zsh Keyboard Completion
How to Get The User's Domain Information in Samba
Kernel Module Build Fails: Sys/Types.H: No Such File or Directory
Munin Dynamic Graph Zoom (Dynazoom) Not Working (Centos6,Nginx,PHP-Fpm)
How to Get The Interrupt Vector Number on Linux
Pass File Input and Stdin to Gdb
Mount -T Cifs Works on One Version of Linux But Not Another
How to Get Icecast to Run on Port 80
What Is Real Time Priority of a Process
In Gitlab Ci The Gitlab Runner Choose Wrong Executor
Changing Matlab's Startup Folder in Linux
How to Combine Two Search Words with "Grep" (And)
How to Use Xargs to Run a Function in a Command Substitution for Each Match
Node.Js and Open Files Limit in Linux
How to Determine The Date-And-Time That a Linux Process Was Started