Mailing List Archive


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

Re: [tlug] Permissions on local Apache web testing environment



2009/11/2 Dave M G <dave@example.com>:
> Off hand I can't think of any reason why it would attempt to look there.
> Nothing in httpd.conf points there. There are no symlinks to there.

OK, I think I know what's going on here. I'm going to assume you're on
something of the Debian family - if you're not, the details will be a
bit different, but the concepts are probably the same.

Debian (so presumably Ubuntu too) has a package called javascript-common.

This package is there to help you keep a set of common Javascript
libraries on your server that all your sites can use, and your package
manager will keep up-to-date. This package creates a directory at
/usr/share/javascript to put the various JavaScript libraries - things
like JQuery - in.

To make this readable via your web server, it creates a file at:
/etc/apache2/conf.d/javascript-common.conf
...which is a symlink to
/etc/javascript-common/javascript-common.conf

...which says:
Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
	Options Indexes FollowSymLinks MultiViews
</Directory>

That will cause Apache to ignore whatever you've put under /javascript
under your regular document root and use /usr/share/javascript
instead.

In theory this is a sensible idea that follows all the Debian
conventions. You can put JQuery etc in one place on your server, and
if there's a security update your package manager will take care of it
for you.

In practice, based on the way people actually manage their websites -
where they keep all the stuff together, test it on a development
server or local machine running one distribution and deploy it on a
server running another, then move it in a hurry to a different one
when the first server breaks - it's completely psychotic.

For now you should be able to fix this by doing one of the following:
a) Removing the javascript-common package. (Hopefully you don't need
any of the libs that depend on it, like libjs-jquery.)
  apt-get remove --purge javascript-common
  /etc/init.d/apache2 reload
b) Disable the configuration that's making that virtual directory, eg.
remove the javascript-common.conf symlink.
  rm /etc/apache2/conf.d/javascript-common.conf
  /etc/init.d/apache2 reload
c) Change your site so that you don't keep javascript files in
/javascript. I like "/js" - it's shorter, too.

(Another option would be to move your JavaScript files to
/usr/share/javascript, but that's a bit nasty because your package
manager wants to manage that itself.)

The rest of us will make a mental note not to use "/javascript" to
keep our JavaScript files in, lest they get clobbered by an
over-enthusiastic package manager.

Edmund Edgar


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links