0

I'm new in Ubuntu, I use Ubuntu 12.04,

I want to develop websites locally, so I installed LAMP, and I found that my www folder is in '/var/www/' so when I try to add new project in it using Netbeans or modify files or what so ever, I face permission problem !!

I would like to know the best way I could use to manage and develop websites with ease?

Thanks

2 Answers2

0

Easiest way might be to add user directories for your web server. This way you can have a ~public_html folder which holds your html pages and http://localhost/~<username>/ accesses it.

If you want to deploy your apps to /var/www you can make yourself a member of www-data: $ sudo adduser <username> www-data

TeTeT
  • 2,044
  • 20
  • 30
  • I didn't get your first answer, for the second, it might be like this: usermod -a -G www-data but it didn't work for me, I still can't manage the /var/www thanks anyway – mark marich May 31 '13 at 11:08
  • For the first suggestion, see http://stackoverflow.com/questions/526742/how-can-i-make-a-public-html-folder-in-ubuntu. For the second suggestion, you need to logout and back in so the user gets the new group. – TeTeT May 31 '13 at 11:24
0

The best way I found is to create my own public_html folder under my personal home space by following this tutorial: https://netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html#createDocumentRootLocation

Read the "Specifying the Document Root for the Apache2 HTTP Server" section,

The basic idea is to redirect the DocumentRoot to the new public_html folder you create, and that's it.

I hope it helps.