Thursday, May 9, 2019

linux - Add my User to www-data group on fedora?




So I am setting up a localhost for web development on my Fedora 20 desktop. I have installed httpd and so forth...



The issue I have is adding my user to the /var/www and to /var/www/html. I looked into /etc/group and did not see a www-data group nor a http group, but I did see an apache group.



But when I ls -alF /var:



    drwxr-xr-x.  4 root root 4096 Mar  3 09:46 www/



And /var/www:



    drwxr-xr-x.  2 root root 4096 Oct 14 21:17 html/


So they are owned by the root group. How would you recommend setting up these folders so that my user has access to these folders for web development?


Answer



In Fedora, /var/www is used for the default web site, which shows the test page when someone hits your web site with its direct IP address or a hostname for which no virtual host is configured. Since this directory is managed by the packaging system, it's best practice to place your own web sites in directories under /srv/www (which you should create) and set their ownership and permissions to whatever is appropriate for your particular scenario.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...