Fixing quirks with s9y on the Mac
Posted by Wesley on
[Related to: Use Mac as a Web Server]
Two issues may come up after installing s9y on the Mac.
1. Quicksearch Error
Attempt a search on the Quicksearch box and you may get this:
That's because the query was not run and the 'Fulltext Index' is not available. Time to pay Terminal a visit.
Two issues may come up after installing s9y on the Mac.
1. Quicksearch Error
Attempt a search on the Quicksearch box and you may get this:
The search function did not work as expected. Notice for the administrator of this blog: This may happen because of missing index keys in your database. On MySQL systems your database user account needs to be privileged to execute this query:
CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended)
The specific error returned by the database was...
That's because the query was not run and the 'Fulltext Index' is not available. Time to pay Terminal a visit.
/usr/local/mysql/bin/mysql -u root -p
CREATE FULLTEXT INDEX entry_idx on serendipity_entries (title,body,extended)
exit
Put your passwords in when asked, and just execute the query as root account as seen above. This should be all that's needed to have the quicksearch function working. Oh, and if somehow the database type is InnoDB instead of MyISAM for you, this will cause an error because Fulltext Index isn't supported on InnoDB. You need to convert the DB type first.
2. URL Rewriting Not Working
This one was a bit of a stumper, but it turned out to be Mac OS X's default Apache installation configuration issue. URL rewriting (s9y Administration - Configuration - Appearance and Options - URL Rewriting) gets you this nicely formed URL that gets rid of the index.php?/ blah blah. I checked to make sure that the mod_rewrite function was enabled on the Apache configuration file, so it was strange when enabling 'Use Apache mod_rewrite' option here didn't work.
Apparently, I needed to change this in the Apache configuration file (/etc/httpd/httpd.conf):
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None
Open with something like Smultron and do searching for 'AllowOverride'. This is the second 'AllowOverride' option you'll come across the file. Do not touch the first one. The 'None' option needs to be changed to 'All' so that the .htaccess rules can work and thus s9y's mod_rewrite rules defined in .htaccess will work, too. Save the file after changing. You may get Authentication dialog box - enter your admin password to finish saving.
Restart the Apache server. Go to System Preferences - Sharing - Personal Web Sharing and press Stop. Then press Start shortly after. Now go back to the URL Rewrite menu and try the Use Apache mod_rewrite option. Press Check & Save. Pages should load without problems. The old URLs should still work, but the newer, simpler URLs should be the default now.