Easy development on local server
I have been lurking around this forum so won't ask questions about webhosters or CMS.
It's how to make my life easier when testing websites in my local dev server, which is now Wheezy running the LAMP stack installed by smxi + phpmyadmin from repos. I get snubbed by permission issues, tried to solve be chowning /var/www to ckosloff:www-data and opening perms, but I have to do that recursively often times. Aptosid manual recommends this: ----------------------------------------------------------- Default document root directory for apache2 is /var/www change this to: :: Code :: mkdir /home/mylogin/www
ln -s /home/mylogin/www /var/www By doing the above commands you can now edit your web site inside your home as normal user. ------------------------------------------------------------- However, this did not work very well for me. I know that there are other work-arounds with sites-enabled in apache server, but not very knowledgeable about that. How does techadmin work around these issues? Back to top |
|||||
chmod -R 707 /var/www
or chmod -R 777 /var/www but that should not be needed since with apache the second 7 permissions usually are other apache users on the server, ie, there are no other ones on your dev server than you. But it's a good practice to make the stuff not read/writable by them. or chown -R /var/www username or some other way, makes little difference how you give yourself ownership of the data. I use a subdirectory in /var/www for the websites to avoid confusion, and leave the default /var/www with only the apache default page file in it. All the above methods do the same thing, makes it recursively read/writable for you, or you and others. the manual entry was created by someone who has no clue about permissions, and simply changed the defaults so it would work. This is not unlike buying a new car when your old one needs a tuneup. And as a web dev / webmaster, you certainly want to understand how apache works with permissions. By the way, just a warning, when apache via php or something else creates a file, it owns the file, always, and that can create some issues when you need something else to own it. However, it's easy to resolve as long as you check who really owns fiiles with ls -l command. Apache is www-data in case you're not clear on that. I'd say the sooner you just get away from all aptosid opinions and methods the better off you'd be. Back to top |
|||||
Thanks for detailed answer.
:: techAdmin wrote ::
By the way, just a warning, when apache via php or something else creates a file, it owns the file, always, and that can create some issues when you need something else to own it. However, it's easy to resolve as long as you check who really owns fiiles with ls -l command. Apache is www-data in case you're not clear on that. Ah, that explains why I sometimes needed to chmod recursively, other than that I was pretty much following standard procedures. :: techAdmin wrote ::
I'd say the sooner you just get away from all aptosid opinions and methods the better off you'd be. I am planning to leave my only remaining aptosid machine on sid, but install smxi and the liquorix kernel, then remove aptosid sources, not much to be missed from that distro. I only have a couple more questions about opinions heard on aptosid, after that it will be all over. Back to top |
|||||
All times are GMT - 8 Hours
|