Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
OSX Tiger new install - clean URLs failing
Hi all, I have a new 4.0.4 Textpattern installation on my Apple MacBookPro (OSX Tiger). The location of my site is in /jmw/Dev/textpattern/testsite. I have changed the httpd.conf file to reflect my location by adding an alias like this:
<Directory "/Users/jmw/dev/textpattern/testsite/">
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Mod_rewrite is on in the config file. The diagnostics page says that clean urls test has failed. I have checked the apache error log and it is trying to go to /Users/jmw/dev/textpattern/testsite/about when I try http://localhost/sitetest/about.
Any ideas where i’m going wrong? I think it must be a .htaccess file issue. I have not touched the .htaccess file from standard.
Offline
#2 2007-01-02 14:36:48
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: OSX Tiger new install - clean URLs failing
Is your Site url (admin prefs) and site path (config.php) configured properly?
Offline
Re: OSX Tiger new install - clean URLs failing
Did you try to use mamp instead?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: OSX Tiger new install - clean URLs failing
Good idea to use MAMP as Colak suggests. Works a treat and nothing to change to get everything to work. Its even easy to un-install which is perfect.
Offline
Re: OSX Tiger new install - clean URLs failing
Finally got a result. The problems I was having were related to me using Alias within the apache config file. What I should have done to get my development TextPattern site working on a fake domain name with clean URLs was to use a VirtualHost in my apache config and set a named host in the hosts file.
There are many incorrect posts about setting this up correctly so after much playing around and reading the Apache docs here is how I got mine up and running successfully. This is based upon OSX 10.4.8 and TextPattern 4.0.4, although the principles will be the same.
Before we being here are the file locations we will be using:
httpd.conf (main Apache config file) – /etc/httpd/httpd.conf
hosts file (local hosts config file) – /private/etc/hosts
TextPattern install location – /Users/jmw/dev/textpattern/site1
my fake host address – http://site1.dev
Step 1
Open up the httpd.conf file in your TextEditor. I will be using TextMate for this and as default TextMate can view and read hidden files. Locate the section that contains VirtualHost configuration (approx line 1073). Uncomment the line (remove the hash) just above that says #NameVirtualHost *:80 and change to #NameVirtualHost 127.0.0.1. This is whats called the Loopback address for your machine and its what localhost runs from.
Step 2
Now we have said we are going to use name based virtual hosting we need to add the declaration of our virtual host. In order to get Localhost to still function we will need to add that in first:
<VirtualHost localhost>
ServerName localhost
DocumentRoot /Library/WebServer/Documents
</VirtualHost>
Following this we will add our VirtualHost configuration for our site including our fake URL host address. I use .dev because I can then mirror a .com locally:
<VirtualHost site1.dev>
ServerName site1.dev
DocumentRoot /Users/jmw/dev/textpattern/site1
</VirtualHost>
Step 3
We need to override some of the defualt setting Apache applies to all directories for our new VirtualHost location. This is needed because we would like to use a .htaccess file so we can have nice clean URLs for our TextPattern site.
This is achieved by adding a Directory configuration allowing the override for our .htaccess script:
<Directory "//Users/jmw/dev/textpattern/site1">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
More options can be set just have a view at the Apache docs but this will do for now.
Great stuff our httpd.conf file changes are now complete. Hit save, unless you are root you will be prompted for your password.
Step 4
Not finished just yet, now we have to tell our hosts file where to redirect the request for http://site1.dev. Open up the hosts file in TextMate. You will see an entry for: 127.0.0.1 localhost Now underneat the above entry add a new entry for your host (http://site1.dev) still sending it to your local loopback address (127.0.0.1):
127.0.0.1 site1.dev
Save the file. You should not need to enter your password because the file does not require root access.
Step 5
Almost there, now we need to restart the Apache server for all the changed to take place and for it to reload its config file. Open up a terminal window and type the following:
sudo apachectl graceful
This will nicely restart our apache server. You could also use restart but graceful is better. Now fire up your browser and first call up http://localhost – you should see the “welcome to apache!” screen . Great now enter your textpattern site address http://site1.dev You should see your Textpattern homepage. If you can see both then your all set.
Any problems or its not working re trace your steps and if all else fails check the apache logs which are located here: private/var/log/httpd/error_log.
Hope this helps, sorry for any spelling errors etc. Its cleaner than using 3rd party tools and not really hard plus you get to see the inner workings of Apache a bit more. I have read that some people prefer to include a file into the main httpd.conf file to prevent changes on OS upgrades etc, but you should be able to figure that out at a later date if your require it.
James (www.jameswhittaker.com)
Offline
Re: OSX Tiger new install - clean URLs failing
step 0: use MAMP :) (sorry, couldn’t help myself), you are just a lot smarter than me and this is my only waay of feeling good about myself after your long notes on development :)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#7 2007-08-04 12:38:30
- sydneyfx
- New Member
- Registered: 2007-08-04
- Posts: 1
Re: OSX Tiger new install - clean URLs failing
I followed James instructions and it worked almost except that I found another file in /private/etc/httpd/users/yourmachinename.conf’ which has the directive ‘AllowOverride None’ which was stopping my Clean URL’s from working. I changed AllowOverride All and now it’s all working.
Last edited by sydneyfx (2007-08-04 12:59:14)
Offline