Tuesday, March 3, 2009

Arsing around with Apache

I'm currently looking for some decent reference material on Apache 2, ideally an actual book I can carry around. I've been fiddling around hosting my own WordPress and TextPattern engines with mixed success.

The main difficulties I've been having are:

1. Setting the DirectoryIndex directive in the httpd.conf or in individual .htaccess files doesn't seem to do anything.
2. WordPress just doesn't frickin' work properly. Strangely the admin pages do work, but the normal blogging pages only work in certain circumstances. I wrestled with it for ages and came to the conclusion that is was something to do with file permissions.
3. Knowing where to start with developing a 'web presence'.
4. PHP pages are showing as text when served from my web server (and they were working a while ago!)

The answer to #4 is that I had two copies of the httpd process running - the Apache that comes with OS X was running when it shouldn't have been. I could have sworn I'd disabled that. With just the Apache 2.2 one running a test PHP page is served correctly. Textpattern PHP files are still wrong though. And the solution to that one is that the owner has to be www rather than me, which it was set to when I downladed the Textpattern distro. Strange, and a bit of a pain to have to set the owner for everything. This doesn't seem to happen for plain HTML files. I suppose it perhaps makes some sort of sense: Apache needs to execute a PHP file and it's running as www, but www doesn't have execute rights on that file.

Got my email read out in episode 20 of the Rissington Podcast. And they gave some good advice on my questions about hosting too. Much happiness ensued.

Anyway, here are the Apache-y things I'm wondering about:

* After you've edited httpd.conf do you always need to restart Apache?
* After you've added or edited a .htaccess file do you need to restart Apache?
* What account/user does the Apache HTTP daemon run under by default on OS X?
* Every time I add new pages to my site do I have to save the files with specific permissions so that Apache can serve them properly?

No comments:

Post a Comment