10:40 < irina_r > whee! found the Apache server-side include tutorial by serendipity
10:40 < zeborah > whee!
10:41 < irina_r > makes brain hurt a bit, though
10:41 < zeborah > oh yes
10:42 < irina_r > and it presumes that apache will read your .htaccess file and I don't know how to make it.
10:42 zeborah nods
10:44 < ibid > um, what's the problem?
10:44 < irina_r > the apache server won't read my .htaccess to give me a custom 404 page.
10:44 < irina_r > I don't know where to cause it to do so.
10:45 < ibid > do you have root access?
10:45 < irina_r > yes
10:45 < ibid > apache 1 or 2?
10:45 < irina_r > 2
10:45 < irina_r > and I know where the config files are
10:45 < ibid > ok, go to /etc/apache2
10:45 < ibid > hm, do you have multiple virtual domains?
10:45 < ibid > in the same machine
10:46 < irina_r > we have rempt.xs4all.nl aliased to valdyas.org, does that count?
10:46 < ibid > depends on how it has been configured
10:46 < irina_r > hmm, where do I see that?
10:46 < ibid > look in sites-enabled - how many files?
10:47 < ibid > and is one of the named valdyas.org or similar?
10:47 < irina_r > where do I find sites-enabled?
10:47 < ibid > in /etc/apache2
10:47 < irina_r > no such thing!
10:47 < ibid > ok, then you don't
10:47 < irina_r > okay :-)
10:48 < ibid > look in apache2.conf
10:48 < irina_r > we do have vhosts.d
10:48 < ibid > ah
10:48 < ibid > it probably is there, then
10:48 < irina_r > we don't have that, either!
10:48 < ibid > different conf layout
10:48 < ibid > uh, what?
10:48 < ibid > ah, you mean you don't have apache2.conf
10:48 < irina_r > we don't have apache2.conf
10:49 < ibid > that doesn't matter if you have vhosts.d
10:49 < ibid > look in there
10:49 < irina_r > it has rempt.xs4all.nl.conf, vhost-ssl.template, vhost.template and yast2_vhosts.conf
10:49 < irina_r > (also 2 backup files)
10:49 < ibid > hmm
10:50 < irina_r > rempt.,, is the one with the directives for cgi-bin and stuff
10:50 < ibid > i'm looking for a file that contains <VirtualHost ... > ... </VirtualHost > with ServerName being your server name (valdyas.org?)
10:50 < irina_r > (i.e. pointing to blogs)
10:50 < ibid > i mean, ServerName inside the VirtualHost element
10:51 < ibid > um actually
10:51 < ibid > that's the wrong place :)
10:51 zeborah watches glad it's not her :-)
10:51 < ibid > where physically is the directory where you want to have .htaccess?
10:52 < irina_r > /srv/www/vhosts/rempt.xs4all.nl/irina/
10:52 < irina_r > grep -i servername in vhosts.d gives:
10:52 < irina_r > rempt.xs4all.nl.conf: ServerName rempt.xs4all.nl
10:52 < irina_r > is that what you wanted?
10:52 < ibid > ok - look for a file containing <Directory /srv/www/ > (or subdirectories)
10:53 < ibid > it was, but it won't help - i was remembering the wrong instructions
10:53 < ibid > (i mean, subdirectories of /srv/www)
10:53 < irina_r > yes, understood
10:54 < irina_r > gr! nowhere!
10:54 < irina_r > grr, typo, yes, of course it's here
10:54 < ibid > not even in /etc/apache2?
10:54 < irina_r > yes, in /etc/apache2 all over
10:55 < irina_r > I'll try to refine it
10:55 < irina_r > in default-server.conf
10:55 < ibid > do you have several such, did i understand you correctly?
10:56 < irina_r > er, no, I think one is the backup file and one is something made by installing something (.conf.rpmnew)
10:56 < irina_r > they're all identical (at least the grep output is)
10:56 < ibid > ok open that file, then :)
10:56 < ibid > the correct one
10:56 < irina_r > yes!
10:56 zeborah votes for the correct one too :-) </helpful >
10:56 < irina_r > :-)
10:57 < irina_r > don't make me giggle!
10:57 < ibid > inside the <Directory ... > ...</Directory > do you have an AllowOverride line?
10:57 < irina_r > AllowOverride All
10:57 < ibid > hm
10:57 < ibid > then it should work already
10:57 < irina_r > I think I put that there while trying to get it to work.
10:58 < irina_r > following the instructions in the apache documentation
10:58 < ibid > did you reload apache?
10:58 < irina_r > yes!
10:58 < irina_r > I thought at first it was that but it didn't do anything.
10:58 < ibid > (bah. and we spent lots of time looking for it...)
10:59 < irina_r > Oh! this is for /srv/www/htdocs, do I have to put in a similar thing for /srv/www/path-to-my-directory?
10:59 irina_r slaps forehead
10:59 < ibid > of course
10:59 < irina_r > thanks!
10:59 irina_r slaps forehead hard
10:59 < zeborah > don't hurt yourself!
10:59 < irina_r > can you help me on "allow, deny" too?
11:00 < ibid > that's stuff i'll have to look up
11:00 < irina_r > because I've probably got that backwards because I don't really understand it
11:00 < irina_r > ah, I'll make a directory directive first
11:00 < irina_r > does it go like CSS so the later one prevails?
11:00 < ibid > i believe "allow, deny" says try allows first and then denys
11:01 < ibid > "deny, allow" says the other way around, obviously
11:01 < irina_r > but if you have "Allow from all" everything gets through, right?
11:01 < irina_r > so if I have "Allow from all" I can override that with a specific deny but basically I let everybody in?
11:02 < ibid > depends on what you have in your order line
11:02 < irina_r > Order allow, deny
11:02 < irina_r > Allow from all
11:03 < ibid > so yeah, that says "if none of the Denys match, then allow"
11:04 < irina_r > I don't think it's relevant, I'll just leave it in
11:04 < ibid > you can get the same effect by Order deny,allow, and deleting the Allow line (because with deny,allow allow is the default)
11:04 < irina_r > ah, "allow anything unless it's denied"
11:04 < ibid > yeah
11:05 < ibid > and if it's denied, it might still be allowed explicitly (with deny,allow)
11:06 irina_r goes to make new .htaccess file
11:07 < irina_r > oh! I have a .htaccess file but it was of course hidden :-)
11:08 < zeborah > :-)
11:10 < irina_r > grr, still get custom 404
11:10 < zeborah > grr
11:11 < irina_r > no, still get default 404
11:11 < irina_r > do I need to restart the webserver after I've uploaded the files?
11:14 < irina_r > Dear cache: stop caching!
11:15 < zeborah > :-)
11:15 < irina_r > not that it works :-(
11:15 < zeborah > :-(
11:19 < irina_r > I can't find in the logs what it's trying to do.
11:19 < irina_r > i.e. where it's trying to read the 404 page
11:19 < irina_r > if I knew where it was pointing, I'd put it there
11:19 < irina_r > (or change the pointy thing)
11:20 < irina_r > it just says "file does not exist"
11:21 < irina_r > I know that causes the 404, but it doesn't actually specify where it gets teh 404 from
11:21 < irina_r > I know that this is exactly the same problem I had last time, and I'm doing exactly the same things to try to solve it
11:24 < irina_r > grr, we have a spider which is filling up the log fast
11:25 < irina_r > it's the yahoo spider
11:25 < zeborah > gr
11:28 < irina_r > it's nice to see spiders spidering, but that wasn't what I was looking for!
11:30 < irina_r > grr, now I have the googlebot too!
11:30 < zeborah > grr!
11:30 < irina_r > could you please access any page of mine, blog or site, so I can see what happens?
11:31 < zeborah > just went to http://www.valdyas.org/irina/stuff/nayarsin/
11:33 < irina_r > doesn't seem to register!
11:33 < zeborah > wonder if it's cached....
11:33 < irina_r > ah, probably
11:33 < zeborah > just tried http://www.valdyas.org/irina/stuff/kaften.html which I haven't looked at recently
11:34 < irina_r > yes, that flooded in!
11:34 < zeborah > great!
11:34 < irina_r > every picture separately, very cool
11:34 < irina_r > 121.72.242.23 - - [06/Oct/2008: 11:33:47 +0200] "GET /irina/pictures/kaften/kaften11.jpg HTTP/1.1" 200 42095 "http://www.valdyas.org/irina/stuff/kaften.html" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9) Gecko/2008061004 Firefox/3.0"
11:34 < irina_r > at least I know that works
11:35 < zeborah > whee!
11:35 < irina_r > ah, something is dawning on me...
11:36 < zeborah > ooh?
11:38 < irina_r > no, it wasn't that
11:38 < zeborah > :-(
11:38 < irina_r > I thought I'd perhaps made the custom 404 600 instead of 644
11:38 < irina_r > (i.e. only I can read it)
11:38 < zeborah > ah
11:39 < irina_r > the server doesn't know it's me when I access my own pages.
11:39 < zeborah > right
11:40 < irina_r > Yes, I think it's a server error! Unfortunately I am the webmaster.
11:41 < zeborah > :-)
11:44 < irina_r > now trying different paths in .htaccess to see if it's that
11:44 < irina_r > but no luck.
11:44 < irina_r > I'm doing all the same things again and getting more and more frustrated!
11:44 < zeborah > :-(
11:45 < irina_r > and getting nothing else done either, of course
11:45 < irina_r > grr!
11:45 < zeborah > grrr!
11:46 < irina_r > I don't even want to try server-side includes until I can use my .htaccess.
11:46 < zeborah > but they're fun!
11:46 < zeborah > :-)
11:47 < irina_r > yes, but they also need .htaccess!
11:48 < irina_r > I thought it would show up in the error log if something tried to use my .htaccess and couldn't.
11:49 < zeborah > you could learn php instead... :-)
11:49 < irina_r > that wouldn't give me a custom 404 page, would it?
11:49 < zeborah > no
11:50 < irina_r > I wish I knew where the confounded 404 page is!
11:50 < irina_r > the one we're getting now.
11:50 zeborah nods
11:51 < irina_r > oh! it's in /usr/share/apache2/error/
11:52 < zeborah > ooh!
11:52 < irina_r > I've found a config file for errors
11:52 < zeborah > oooh!
11:53 < irina_r > and I think it's not being overridden
11:53 < zeborah > can you edit it there? or move your page into that subdirectory?
11:53 < irina_r > that's the problem with the server, it's very hard to see what overrides what
11:53 zeborah nods
11:53 < irina_r > no, if I move my file there all of valdyas.org gets my file
11:53 < irina_r > and if I edit it ditto
11:54 < irina_r > I have to tell the server somehow that under /irina/ it wants my file instead of the default
11:54 < zeborah > right
11:54 < irina_r > this is to internationalise error documents mostly
11:55 < irina_r > replace the defaults by your own, which isn't what I want
11:55 zeborah nods
11:55 irina_r tries httpd.conf ("This is the main Apache server configuration file."
11:56 < irina_r > I think I remember doing that last time too
11:57 < irina_r > I think I need to do it in vhosts.d, but that's what I tried and didn't work.
11:58 < zeborah > yes!
11:59 < irina_r > tentatively set .htaccess to "Allow from all" because it had "Deny from all", but that doesn't seem to help either
11:59 < irina_r > (and I remember doing that last time, too!)
11:59 < irina_r > grr! GRR!
11:59 < zeborah > Indeed!
12:01 < irina_r > Change the config file, check; restart server, check.
12:02 < irina_r > Perhaps now the wrong path is in the .htaccess file again.
12:02 < zeborah > oh dear...
12:02 < irina_r > or there's some other directive overriding what I just changed.
12:05 < irina_r > page is where I told .htaccess it was, check!
12:05 < irina_r > http://www.valdyas.org/irina/errors/404.html
12:05 < irina_r > (not at all the way I want it yet, but I wanted to have it up at least)
12:06 zeborah nods
12:07 < irina_r > I wish my error log would say something like "foo.html doesn't exist, accessing [pathname of 404 file]" so I could see where it looks for it.
12:07 < zeborah > yes
12:07 < irina_r > instead, it just says it doesn't exist and throws a default 404.
12:08 zeborah nods
12:22 < ibid > what does your directive look like?
12:22 < irina_r > which one?
12:22 < ibid > the one that doesn't work?
12:22 < irina_r > I don't know which one doesn't work! perhaps there's something overriding it
12:23 < ibid > well, all of them then, and where are they?
12:23 < irina_r > aargh! just closed all my konsoles
12:24 < irina_r > in httpd.conf:
12:25 < irina_r > AccessFileName .htaccess
12:25 < irina_r > # and never show them
12:25 < irina_r > <Files ~ "^\.ht" >
12:25 < irina_r > Order allow,deny
12:25 < irina_r > Allow from all
12:25 < irina_r > </Files >
12:26 < ibid > ah, sorry
12:26 < ibid > not interested in these
12:26 < irina_r > ah? I thought that was the problem
12:26 < ibid > i meant your ErrorDocument directives
12:26 < ibid > or whatever you are using to create custom errors
12:26 < ibid > or trying to, at least
12:26 < irina_r > that I was Denying instead of Allowing use of .htaccess with that thing
12:27 < irina_r > oh, and in Directory above it has AllowOverride All
12:27 < irina_r > so I thought I was allowed to override it.
12:27 < ibid > hmm
12:27 < ibid > so your .htaccess stil doesn't get read?
12:27 < irina_r > no!
12:28 < irina_r > well, I don't know; I can't tell because the access log doesn't say that it is or isn't reading it.
12:28 < ibid > well, you can test it
12:28 < irina_r > how?
12:28 < ibid > put in it Redirect 410 /nonexistent/url/path
12:29 < ibid > (that's the stuff after http://hostname)
12:29 < ibid > and then try to access that nonexistent file - what error message do you get?
12:32 < irina_r > /nonexistent/url/path being something like where my 404 is, but a different file?
12:32 < irina_r > or a whole nonexistent path?
12:32 < ibid > anything that doesn't exist
12:33 < ibid > well, it can exist but if that directive works you won't be able to access it :)
12:33 < ibid > note - not the disk location but the path portion of the url
12:34 < ibid > so for example on my system i might use redirect 4
/foo and then access http://antti-juhani.kaijanaho.fi/foo to see if it works
12:34 < irina_r > I get the normal default 404 message
12:35 < ibid > can you show me the directive you used?
12:36 < irina_r > Redirect 410 /irina/foo.html
12:36 < irina_r > (because / is rempt.xs4all.nl)
12:37 < irina_r > or rather, / is /srv/www/vhosts/rempt.xs4all.nl/
12:37 < ibid > and this is in valdyas.org?
12:37 < irina_r > unpack, please?
12:37 < irina_r > fully qualified name of nonexistent file would be /srv/www/vhosts/rempt.xs4all.nl/irina/foo.html
12:38 < ibid > i mean, what url would you use to access that nonexistent file?
12:38 < irina_r > I tried to access www.valdyas.org/irina/foo.html
12:38 < ibid > right
12:38 < irina_r > but www.valdyas.org is the same as rempt.xs4all.nl, that doesn't make a difference
12:38 < ibid > yeah, seems so
12:39 < irina_r > with the other name I get the same thing
12:39 < irina_r > except that the server tells me to report it to the rempt.xs4all.nl webmaster instead of the valdyas.org webmaster
12:40 < ibid > okay - how many allowoverrides can you find in /etc/apache2 ? :)
12:41 < irina_r > any that aren't in backup files are AllowOverride All.
12:41 < ibid > and in what <Directories > are they in?
12:42 < irina_r > /srv/www/htdocs (which has only a few gif files)
12:42 < irina_r > Oh! caught the bug!
12:42 < irina_r > I forgot to tell it 'vhosts'
12:42 < ibid > ?
12:42 < irina_r > it's in /srv/www/rempt.xs4all.nl/irina, which doesn't exist
12:43 < irina_r > it's supposed to be /srv/www/vhosts/rempt... etcetera
12:43 < ibid > heh
12:43 < zeborah > ooh!
12:43 irina_r fixes and restarts server
12:44 < irina_r > whee! now the redirect works!
12:44 < irina_r > Resource is no longer available!
12:44 < irina_r > And the 404 works!!
12:44 < irina_r > thanks!
12:44 < irina_r > http://rempt.xs4all.nl/irina/thing.html
12:45 < irina_r > (404 page in state of being fixed)
12:45 irina_r bounces!
12:45 < zeborah > whee!
12:45 < zeborah > BOUNCE!
12:46 irina_r grabs ibid by the virtual shoulders and dances round with him!
(after lunch)
13:03 irina_r uploads new 404 page
13:05 < irina_r > could you try it? www.valdyas.org/irina/thing.html
13:06 < irina_r > (still bouncy because it works)
13:06 < irina_r > grr, forgot to fix the stylesheet
13:09 < irina_r > grr, now it only finds the stylesheet when it's at the same depth as the error document
13:09 < irina_r > needs an absolute URL
13:10 < irina_r > to see what it ought to look like, www.valdyas.org/irina/valdyas/thing.html
13:14 < ibid > that probably works okay
13:14 < irina_r > works from everywhere now
13:14 < ibid > (still would prefer direct HTTP redirects where possible)
13:14 < irina_r > does that mean I need a redirect for every file I've moved?
13:15 < ibid > you can redirect a whole subtree, if the subtree has moved as is
13:15 < ibid > (in terms of addresses, that is)
13:15 < irina_r > no, they all used to be in the top directory but they're now mostly in different places
13:15 < ibid > right
13:15 < ibid > then yeah
13:15 < irina_r > some have been renamed, some have been/will be split
13:16 < ibid > it's one line in .htaccess per redirect
13:16 < ibid > of course, splits aren't redirectable
13:16 < irina_r > one subtree is now in /archive/ but I do want people to know that it's moved so they don't keep using the old address
13:17 < ibid > in theory, you could use the redirect code for that (there's temporary and permanent redirects) but i don't think the browsers handle that well
13:17 < irina_r > I do have a few redirection pointers (saying "it's moved, you're being redirected in X seconds") and I'll take those down a year after the last hit to it
13:17 < irina_r > you mean 410 code?
13:17 < ibid > no, 410 is "gone, no forwarding address"
13:18 < irina_r > ah, I'll use that for the vanity pages then
13:18 < irina_r > now that I know my .htaccess is being read I can experiment :-)
13:18 < ibid > i mean 301 (permanent) versus 302 (temporary)
13:18 < ibid > see http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
13:18 < irina_r > thanks!
13:19 < ibid > (404 is "dunno":)
13:19 < ibid > (as in, could have been here, could have not been here, i have no information about that)
13:19 < irina_r > that's the one I've been using when I didn't know it was the path that was wrong
13:19 < irina_r > that set of docs, I mean
13:20 < ibid > lunch time, bbl
13:23 irina_r 's head is spinning
13:23 < irina_r > tea, grocery shopping, no more .htaccess for a bit