• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Local Install on Mac

LPH

Well-known member
#1
OK. :p

PHP and MySQL are installed and working [updated for clarity: working on my mac here. This is a testing environment so I can test things before going live.]. My phpinfo loads fine, phpymadmin works, Coda even finds the database files, etc. Figured out how to dump sql from the live site and imported it into a local database on the Mac.

Now, first XF files existed here /~lph/community, changed the /Library/config.php to get to the correct database (password, etc). Loaded admin.php and changed URL. The front page loads but get files "the requested URL xxx/threads/testing-network-latest-posts-in-posts.516812/unread was not found on this server." when any links are clicked ....

Moved the files to the /community root, changed .htaccess so that RewriteBase is /community and front page loads - but still get the same error.

Went to rebuild caches - admin.php loads fine -rebuilt caches - but site still craps on trying to follow links.

Any other suggestions?

Tried .htaccess
Tried config.php
Tried admin.php

Any other place to look ?

Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch Server at localhost Port 80
 

LPH

Well-known member
#2
Ah HA !

Maybe this will help someone else. The Friendly URLs were not so friendly. Turned them off and now things work. This means the mod_rewrite is wrong.

Screen Shot 2013-01-04 at 9.58.04 AM.png

Now I just have to figure out how to set up the mod_rewrite :)
 

Jake Bunce

XenForo moderator
Staff member
#3
Possible causes of friendly URLs not working (usually manifests as "404 not found" error on forum pages):

1) Your server doesn't have mod_rewrite installed. Consult with your host about this.

2) Your server doesn't have AllowOverride enabled:

http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride

Consult with your host about this.

3) The .htaccess file is not in place in your forum directory.

4) Sometimes you need to specify RewriteBase in your .htaccess file (specify the name of your forum directory):

RewriteBase /xenforo
 

LPH

Well-known member
#4
Thanks Jake. As always, good summary. This is a local install so I may learn :)

I was making changes, had mod_rewrite working, tore it apart to try again ... to confirm I knew what to do .. and it's been a mess until a few minutes ago. Just replaced httpd.conf with default and started over. WP and XF run now without the mod_rewrite. So - I'll have to figure out what was done to get mod_rewrite working on this little ole mac of mine. LOL.

Oh - should state - the vhost doesn't seem to be working because localhost and "tux" are pointing to the same /Library/WebServer/Documents folder ...even through there is a httpd_vhosts_conf file in which tux should point to /Users/lph/Sites

More tinkering ;)
 

LPH

Well-known member
#5
The solution for mod_rewrite was rather simple: httpd.conf has two places in which the <Directory /> needs to be set for AllowOverride.

Now - my vhosts are not working but WP and XF are working [with mod_rewrite] in Library/WebServer/Documents folder.
 
#6
I am running a very similar setup on Mac OSX, using MAMP as a local development environment with all my local sites places in the /Users/Sites folder. It is working very well using Coda 2 to edit all the files. But I never did get full friendly URL working locally (works correctly on my live hosted server) so I will try your suggestions.

If your local vhosts aren't working did you also add them to the Mac's hosts file? You need to edit this file (hidden by default) in /etc/hosts - add the hosts individually at the bottom, they need to be in a certain format to work correctly (I can post my changes if it helps). As you noted you also have to configure MAMP/conf/apache/extra/httpd-vhosts.conf

Setup in this way you simply fire up MAMP and enter the address in your web browser and it points directly to the site in /Users/Sites/www.mysite.com
 
#7
The solution for mod_rewrite was rather simple: httpd.conf has two places in which the <Directory /> needs to be set for AllowOverride.

Now - my vhosts are not working but WP and XF are working [with mod_rewrite] in Library/WebServer/Documents folder.
Did you get full friendly URLs working with the local vhosts? It's a minor irritation for me and despite trying a few things I can't solve it. With full friendly URLs in the ACP all links other than the home result in a 404 error (not found).

I looked in httpd.conf and AllowOverride appears to be set correctly and mod_rewrite is being loaded. I did wonder if mod_rewrite has to be turned on exactly as it would be on a live server - I made a basic .htaccess file and placed it in the site root folder but it had no noticeable effect.
 

LPH

Well-known member
#8
Did you get full friendly URLs working with the local vhosts? It's a minor irritation for me and despite trying a few things I can't solve it. With full friendly URLs in the ACP all links other than the home result in a 404 error (not found).

I looked in httpd.conf and AllowOverride appears to be set correctly and mod_rewrite is being loaded. I did wonder if mod_rewrite has to be turned on exactly as it would be on a live server - I made a basic .htaccess file and placed it in the site root folder but it had no noticeable effect.
Hi,

I stopped working on getting vhosts to work so that some I could get some scripting done. Currently, the install is not MAMP. While the install has vhosts files edited per instructions, vhosts do not work. However, the friendly URLs are working because two locations were edited for the AllowOverride.

http://foundationphp.com/tutorials/vhosts_leopard.php

Maybe I'll return to this issue tonight.