.htaccess files on a Mac + MAMP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Are there any MAMP users on this list who can tell me what I need to do to make .htaccess files work on a Mac?

I recently copied my databases from my PC to a Mac. I had a hard time getting things to work, so I installed a preconfigured package called MAMP. I finally figured out how to set up virtual hosts, only to discover that my .htaccess files don't work.

I thought it might have to do with the fact that my .htaccess files were created with Notepad. But according to this article...

http://rexselin.wordpress.com/2006/07/28/making-mod-rewrite-and-htaccess-work-on-mac-os-x/

....htaccess files don't work on Mac's unless you do the following:


1) Open the httpd.conf file and uncomment these three lines:

#LoadModule rewrite_module modules/mod_rewrite.so
#AddModule mod_rewrite.c
#AccessFilename .htaccess

> The 2nd and 3rd lines were already uncommented. The closest I found to the first line was the following, which was also uncommented:

LoadModule rewrite_module     libexec/httpd/mod_rewrite.so

I left it alone.


2) Change "AllowOverride None" to "AllowOverride All" in both the httpd.conf and /private/etc/httpd/users/MyName.conf files.


3) Restart Apache.


I did all the above - and it killed all my virtual hosts. After undoing the changes, I restarted my servers with the MAMP icon, but nothing happened. So I went into Apple's System Preferences > Web Sharing, and restarted it. That restored my virtual hosts.

That made me wonder if the Apache server that came pre-installed with my MacBook Pro is still running. In fact, I wonder if my websites have been feeding off the original Apache rather than MAMP's Apache all along. If so, how do I access it and shut it off, without affecting my newer (MAMP) Apache program? What else do I need to do to make my .htaccess files work on a Mac? Should I recreate my .htaccess files in a native Mac text editor?

I might also mention that, in order to get my virtual hosts to work, I had to delete all instances of "127.0.0.1" from my httpd.conf file. I don't know what the significance might be, but I thought it might shed a little light on what's going on.

Thanks!



Never miss an email again!
Yahoo! Toolbar
alerts you the instant new Mail arrives. Check it out.
[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux