 |
 |
404s have died, as have all .htaccess
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
I've just finished a clean install of Mac OS X 10.2.4. I've got the Web Server up and running, configured as I have done in the past, basically to just let Server Side Includes work and to let me use .htaccess files in my root directory, /Volumes/Swan/Sites.
Except...
I first noticed that my custom 404 pages weren't working. Then that SSIs would only work if I renamed the files with .shtml, even though the .htaccess file in the relevant directory, which has worked fine up until now, uses .html instead. And redirects in another .htaccess file don't work either.
So I've now realised that the .htaccess files aren't being consulted at all, ignored completely.
Why might this be? How can I make them work?
|
|
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
Sorry, I'm a retard. I worked it out; AllowOverride All needed to be in megasad.conf as well as in httpd.conf. Whoever can, feel free to delete this thread.
|
|
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Location: East of Belfast Furry Animal Sanctuary
Status:
Offline
|
|
rather not where is the megasad file?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
Originally posted by Griggsy:
rather not where is the megasad file?
/etc/httpd/users/megasad.conf
megasad.conf because megasad is my login name. Change as appropriate, obviously.
At present mine looks like this:
Code:
<Directory "/Volumes/Swan/Sites">
Options Includes Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
<Directory>
But, until I realised that, it was like this:
Code:
<Directory "/Volumes/Swan/Sites">
Options Includes Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
I can't remember why that happened, but when it was set to None, .htaccess files were ignored. Setting it to All made everything good.
|
|
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Meida, PA USA
Status:
Offline
|
|
When you upgrade to 10.2.4, your httpd.conf file will be renamed to httpd.conf.applesaved a new 'clean' conf file with small editions for a rendezvous module will be put in it's place.
I would recommend using the application FileMerge (found in /Developer/Applications/ ) to compare the two files, replicate the new additions from httpd.conf into httpd.conf.applesaved and then swap them to restore your setup. Remember to shutdown apache before swapping and restarting it after (both through the System Preferences >> Sharing)
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2002
Status:
Offline
|
|
Originally posted by zorn:
When you upgrade to 10.2.4, your httpd.conf file will be renamed to httpd.conf.applesaved a new 'clean' conf file with small editions for a rendezvous module will be put in it's place.
I would recommend using the application FileMerge (found in /Developer/Applications/ ) to compare the two files, replicate the new additions from httpd.conf into httpd.conf.applesaved and then swap them to restore your setup. Remember to shutdown apache before swapping and restarting it after (both through the System Preferences >> Sharing)
Not the issue here as it was a completely fresh install of 10.2.4. The issue was me being foolish when I configured by httpd.conf and megasad.conf files. But thanks anyway.
|
|
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status:
Offline
|
|
Originally posted by zorn:
I would recommend using the application FileMerge (found in /Developer/Applications/ ) to compare the two files, replicate the new additions from httpd.conf into httpd.conf.applesaved and then swap them to restore your setup.
You're better off not modifying httpd.conf, but rather making your changes in a separate file stored in /private/etc/httpd/users/
Notice the last line of Apple's standard httpd.conf file:
Include /private/etc/httpd/users
That's intended to load http.conf customizations for individual users on your Mac. What it does, effectively, is append every file in the directory /private/etc/httpd/users/, in alphabetical order, to your /etc/httpd/httpd.conf file. So if you place a file containing only the customizations you would otherwise make to /etc/httpd/httpd.conf in the directory /private/etc/httpd/users/, your customizations will always be in effect without ever editing your /etc/httpd/httpd.conf file, and they won't break with each system update. Slick, eh?
Important safety tip: Every file in /private/etc/httpd/users/ is appended to your /etc/httpd/httpd.conf file, even files with suffixes like ".bak", so keep your backup files in another directory, else they are likely to override the changes you're making in your primary file (e.g. my.httpd.conf.bak would load after my.httpd.conf, which might undo the edits you've made and send you off chasing your tail for hours while trying to figure out why the changes you're making don't seem to work properly -- of course i was never caught by this snare!  ).
Regarding .htaccess files: Unless you're administering a server with multiple users who should not have access to the server's configuration file, it's better to keep .htaccess turned off and just make your changes in a file in the /private/etc/httpd/users/ directory. While .htaccess is sometimes more convenient than a config file (doesn't require a restart for changes to take effect), there is a significant performance penalty as Apache looks for, reads and parses an .htaccess file (if present) in every directory from root on down to the directory containing the file being served everytime a page is served!
Anything which can be done with a .htaccess file can be done from a server configuration file. The only reason i can think to turn on .htaccess files is if you're developing a web site locally which will eventually be moved to another server (using .htaccess). In such a case, you're better off turning on .htaccess files only in the root directory of your development site, and not for your entire computer. This will at least reduce the number of directories searched for .htaccess. Of course one could keep it turned off during the early development phase of the project. YMMV.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|