My .htaccess file in my htdocs folder does not work. I tried to redirect to Google when accessing a filename. I want to find out where the settings for my httpd.conf are, so I can enable mod_rewrite. I did the following UNIX command to find out if a httpd.conf file existed on my hard drive:
find * -name "httpd.conf"
The file does not exist. I am thinking that maybe there is another file that controls mod_rewrite. I want to see if “AllowOverride” exists in any directory. I entered the following UNIX command:
grep -r "AllowOverride" *
But it’s hard to read because it prints out so many folders. The message that accompanies the folders are “Permission denied” or “No such file or directory”. How do I only get the file paths of files that contain AllowOverride?
Many Unix and similar systems provide a
locate(1)command that uses a database to speed finding individual files. Try this:Note, of course, that Apache configurations are stored in files of all sorts of names; I’ve seen
apache.conf,httpd.conf,httpd2.conf, and then there’s the giant pile of/etc/apache2/conf.d/— entire directory structures set aside for configuring Apache. Your distribution may vary.Perhaps
apachectl configtestwill show the paths? (currently not installed on my machine, so I can’t easily test.)