I am attempting to enable clean URL's onto my personal web sharing on my Mac. For some reason after going through all the steps editing the httpd.conf file it still will not work. Has anyone had the same problem on their machine?

Comments

xjm’s picture

Did you restart Apache?

Under System Preferences -> Sharing, uncheck Personal Web Sharing. It will say "shutting down..." briefly. Then, recheck it to restart Apache.

==========
Feature request: HTML Source Formatting in TinyMCE

stephtek’s picture

Yes I did. I also restarted the whole machine as well when that didn't work.

xjm’s picture

Can you post exactly what you added to your httpd.conf?

==========
Feature request: HTML Source Formatting in TinyMCE

stephtek’s picture

pwolanin’s picture

I had some problems getting it to work in my ~username/Sites directory because you have to edit the settings in /etc/httpd/users/username.conf to allow the .htaccess file to be used (replace "username" with your login name, obviously).

---
Work: BioRAFT

stephtek’s picture

My files are in the Library>WebServer>Documents folder.

pwolanin’s picture

Ok, then be sure you also have something like this:

<Directory "/Library/WebServer/Documents">
    AllowOverride All
</Directory>

in /etc/httpd/httpd.conf so that your .htaccess file will be used.

---
Work: BioRAFT

Christefano-oldaccount’s picture

Is there a reason you're using OS X's built-in (and out of date) version of Apache? If there isn't a good reason, I suggest MAMP (or "the MAMP" as it's been rebranded as for some reason).

Clean URLs work out of the box. Plus, reinstalling it is as easy as deleting the MAMP folder and copying a new one to the Applications folder.

stephtek’s picture

I have never heard of MAMP. I am not a programmer, so I am just trying to figure this out as best I can.

Christefano-oldaccount’s picture

I wasn't trying to criticize your choice so much as ask if there was a particular reason you were using OS X's version of Apache. No offense was meant.

The name is an acronym that stands for Mac-Apache-MySQL-PHP. It's a variant of Linux-Apache-MySQL-PHP, which is also called a lampstack. Basically, it's a self-contained installation that provides all the services needed to run a basic Drupal site.

xjm’s picture

Built-in version of Apache works fine, outdated or no. I have a mirror of my site running on my personal OS X machine.

==========
Feature request: HTML Source Formatting in TinyMCE

Christefano-oldaccount’s picture

I recommend that you check your config syntax.

A GUI frontend you can use for OS X's version of Apache is Weblock, which has a "Check Config" button for validating your syntax. It may not work with the yourname.conf mentioned in the how-to you link to, but it does allow setting a folder other than "Sites" to be the web root as well as going straight to your logs, quickly restarting Apache, etc.

Weblock provides a simple user interface for configuring user, group, and IP-based access restrictions for Mac OS X's built-in webserver. With it, you can instantly configure any folder shared via your website to require a password, or require the visitor to be coming from a specific web location, or both. Weblock even supports location ranges and grouped users!

http://www.digicowsoftware.com/

kcease’s picture

For anyone using the Apache instance installed with OS X, the location and configuration of key files must be addressed. Since some of the directories and files in question are normally hidden, you will either need to be comfortable working with these at the command line, and/or install the free tool TinkerTool (http://www.bresink.de/osx/TinkerTool.html). With TinkerTool you can check a preference and relaunch the finder to show or hide hidden files (highly recommended).

The key configuration files are:
/private/etc/httpd/httpd.conf
and
/private/etc/httpd/users/.conf

The configuration of these is discussed in posts at the following links:
http://www.clagnut.com/blog/350/
http://rexselin.wordpress.com/2006/07/28/making-mod-rewrite-and-htaccess...

In my case, I was installing Drupal (and CakePHP) on an Apache 2 server installed as a part of a MAMPStack 5.5 installation (BitRock.com) and located at /Applications/mampstack-5.5/apache2/. The necessary mod_rewrite was already installed by default. The critical edit was "AllowOverride All" on line 384 of my httpd.conf file. it is not the only occurance of "AllowOverride" in the file (it is the second in my default httpd.conf), so it important to find the right one. I provide some preceeding context below:

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit Indexes
#
AllowOverride All

Anyone really interested in exploiting mod_rewrite should check out Rich Bowen's book on the subject, but the info here or at the links should be all that is needed to get it working.

My impression is that the configuration with a MAMP installation (www.mamp.info) would be similar but I have no experience with that.

It is a bit off topic, but I will add that if I were setting up a localhost web development environment again I would try MAMP rather than MAMPStack. Use of one of these allows one to easily install newer or different versions of the software and results in an environment that can more closely match that present on the hosted site. I had to create one symbolic link to get mySQL working with my MAMPStack installation (as documented at: http://www.macnn.com/articles/06/09/05/mampstack.55.released/). The bottom line is that to resolve that issue I cd’d to the /tmp directory and created a symbolic link to the actual location of the mysql.sock file:
ln -s /Applications/mampstack-5.5/mysql/tmp/mysql.sock mysql.sock

The .htaccess issue (and mySQL issue) might be obvious to some but they took me quite a while to work out. I hope this saves someone the hassle.

Kemp