[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache default directories



On Sat, Mar 15, 2014 at 01:54:41PM +1100, Scott Ferguson wrote:
> On 15/03/14 12:20, Peter Michaux wrote:
> > Hi,
> > 
> > The default virtual host when Apache is installed on Debian has
> > document root /var/www and a cgi-bin directory /usr/lib/cgi-bin. These
> > directories do not make intuitive sense to me. 
> 
> That's the problem with intuition (instant understanding). ;)
> 
> > If I have static HTML
> > pages and some Perl CGI scripts, I would expect they go somewhere
> > under /usr/share/. 
> 
> root "owns" /usr/share
> 
> Would you want your web server running as root?
> 
> 
> > What is the rational behind the chosen default
> > directories?
> 
> 
> /var/www is owned by the webserver and the server group (www-data)
> ls -al /var/www

Actually, what's typical in there is
-rwxr-xr-x  1 root root

But you can put stuff wherever you want, so long as you tell apache
where it is with a vhost.
I put some directories in users' homes on servers:
/home/user/www/
then point a vhost there
You just have to be sure and give the server permissions where needed,
like, if you install a dokuwiki in there, make the data and upload
directories writeable to the server, 
or if you put a wordpress, drupal, joomla, piwigo, or whatever else in there, similarly,
there are directories that the server must be able to write in.
But I tend to NOT install stuff like wp or dokuwiki from debian
packages, rather using the upstream packages, since I use stable on
servers, and stable packages tend not to keep up with upstream packages
so well.
I especially prefer upstream packages with git repos, where I can update
them with a pull, like redmatrix (which isn't in debian, yet, anyway).

Tony
-- 
https://tonybaldwin.info
art, music, software by me, tony
3F330C6E

Attachment: signature.asc
Description: Digital signature


Reply to: