Installing in a symlinked directory
Posted: Mon Nov 19, 2007 7:53 am
I like to deploy sites by keeping two http root directories under my vhost directory and pointing a symlink to the current one. Suppose apache is looking for httpdocs as the document root; then the vhost directory contains directories httpdocs1 and httpdocs2, as well as a symlink httpdocs pointing at httpdocs1. If I want to roll out new versions of software or whatever, I can install the site in httpdocs2 and, when I'm ready, atomically repoint the symlink to httpdocs2 using perl's rename function.
But for some reason, I cannot install serendipity in such a directory (I should point out here that I install it in the document root, that is, in httpdocs1/ rather than in httpdocs1/serendipity as would be default). This is the sequence: I already have serendipity running in httpdocs1, then I extract serendipity into httpdocs2, repoint the symlink, and visit the site to run the install script. I fix all the database settings and whatever, and try to save my changes. I get a message about not being able to write to archives/ . Ok, so I create archives/ and chmod it according to the message. Then the script fails to write to .htaccess, so I paste into .htaccess directly and save it, again according to the message. Then I try to visit my blog, but find that none of the setup actually happened, so I have to do it again, which needless to say plays out exactly the same way.
So it's a permissions problem, right? Except I've already done chmod 1777 on httpdocs2. I've tried chown'ing it to 'nobody', which doesn't work either. In short, it doesn't work specifically because of the symlink - without that, if I do the same procedure, same permissions and everything, but in a directory httpdocs rather than in the symlinked directory, it works fine. I've given the symlink the same permissions and ownership as the target directory, to no avail.
I suspect this is a very simple and intolerably newbie question, but the forum didn't seem to contain any posts about it; neither did the FAQ have anything to say. Thanks for your thoughts!
But for some reason, I cannot install serendipity in such a directory (I should point out here that I install it in the document root, that is, in httpdocs1/ rather than in httpdocs1/serendipity as would be default). This is the sequence: I already have serendipity running in httpdocs1, then I extract serendipity into httpdocs2, repoint the symlink, and visit the site to run the install script. I fix all the database settings and whatever, and try to save my changes. I get a message about not being able to write to archives/ . Ok, so I create archives/ and chmod it according to the message. Then the script fails to write to .htaccess, so I paste into .htaccess directly and save it, again according to the message. Then I try to visit my blog, but find that none of the setup actually happened, so I have to do it again, which needless to say plays out exactly the same way.
So it's a permissions problem, right? Except I've already done chmod 1777 on httpdocs2. I've tried chown'ing it to 'nobody', which doesn't work either. In short, it doesn't work specifically because of the symlink - without that, if I do the same procedure, same permissions and everything, but in a directory httpdocs rather than in the symlinked directory, it works fine. I've given the symlink the same permissions and ownership as the target directory, to no avail.
I suspect this is a very simple and intolerably newbie question, but the forum didn't seem to contain any posts about it; neither did the FAQ have anything to say. Thanks for your thoughts!