logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: persistent .htaccess/rewrite module error
Author
netrista



Joined: 13 Feb 2009
Posts: 1
Location: Burlington MA

PostPosted: Fri 13 Feb '09 23:10    Post subject: persistent .htaccess/rewrite module error Reply with quote

Dear group,

I'm trying to get an Apache/PHP/MySQL-oriented product called ontowiki running, but I'm hitting a simple (htaccess/rewrite) error. I spent hours making configuration changes to no avail. I rolled back my test rig to a near base installation. Can someone review what I've done and tell me what I'm
missing? This is what I did:

1. I installed apache_2.0.63-win32-x86-no_ssl.zip on Windows XP 5.2
SP2.
2. I went with the installer defaults yet chose to install to a path
with no spaces; C:\Apache2.
3. Opened C:\Apache2\conf\httpd.conf with Notepad.
4. Set DocumentRoot to the full path to .
5. Set Directory to C:\Apache2\conf\htdocs.
6. Added index.php to DirectoryIndex.
7. Appended the following lines to the end of httpd.conf:

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
8. Saved my changes and exited the file.
9. Restarted Apache server.
10. Opened http://127.0.0.1:80 in a browser - say Apache success page.
11. Downloaded php-5.2.8-win32-installer.zip.
12. Extracted PHP to C:\PHP.
13. Copied C:\php\php-ini-recommended.ini to c:\php\php.ini.
14. Opened php.ini.
15. Uncommented include path.
16. Set doc_root to C:\Apache2\conf\htdocs.
17. Set extension_dir to c:\php\ext.
18. Uncommented php_dg2.dll.
19. Uncommented mysql.dll.
20. Set sessions.save_path to C:\Temp.
21. Exited file.
22. Added ;C:\PHP to System PATH.
23. Restarted Apache.
24. Created test.php page with phpinfo function call and saved to C:
\Apache2\conf\htdocs.
25. Successfully viewed test.php in browser.
26. Downloaded and extracted ontowiki-0.8.6.zip.
27. Copied config.ini.dist to config.ini.
28. Clicked on C:\ontowiki-0.8.6\index.html in Windows explorer.
29. Encountered this error:

Wrong Server Configuration

* either the rewrite module of your webserver does not work
* or our .htaccess file is ignored or doesn't exist.

30. Opened C:\Apache2\conf\httpd.conf.
31. Uncommented this line:

LoadModule rewrite_module modules/mod_rewrite.so

32. Reviewed these two settings:

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from
being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Allow from all
</FilesMatch>

33. Save my changes and exited the file.
34. Stopped and Started Apache.
35. Reopened test.php in browser.
36. Noted this output:

apache2handler
Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_access
mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dir
mod_env mod_imap mod_include mod_isapi mod_log_config mod_mime
mod_negotiation mod_rewrite mod_setenvif mod_userdir mod_php5

37. Attempted to reopen ontowiki index.html page.
38. Encountered same problem.
39. Went back and reviewed the default C:\ontowiki-0.8.6\.htaccess.
40. Reconfigured .htaccess like so:

# Only developer need this ...
#Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase C:/ontowiki-0.8.6
</IfModule>
# In most cases, you do not need to define the rewrite-base
#RewriteRule !\.(js|ico|gif|jpg|png|css|php)$ boot.php</IfModule>

41. Save changes and exited the file.
42. Stopped and started Apache.
43. Encountered same error.

All files available upon request.

TIA,
Netrista
Back to top
ibeau



Joined: 14 Feb 2009
Posts: 4
Location: Australia

PostPosted: Sat 14 Feb '09 10:43    Post subject: Reply with quote

I had the same problem. All I had to do was rename .htaccess and remove the . (dot). This is because windows cant read files starting with .
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 14 Feb '09 11:13    Post subject: Reply with quote

Windows can read files with a dot for the first character

Some parts of Windows will not allow you to name them like that. Windows Explorer, Notepad ... etc

Notepad however you just save as ".htaccess" with the quotes and it will do fine.
Back to top
ibeau



Joined: 14 Feb 2009
Posts: 4
Location: Australia

PostPosted: Sun 15 Feb '09 8:54    Post subject: Reply with quote

Why wouldnt mine read .htaccess but it worked once I removed the . ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 16 Feb '09 16:42    Post subject: Reply with quote

Can't tell you that, but it's worked for me for many years.

It's best to create the file using a text editor other than Note/Wordpad, like Texpad or something..

If file extensions are hidden in windows I can see where that could cause problems
Back to top


Reply to topic   Topic: persistent .htaccess/rewrite module error View previous topic :: View next topic
Post new topic   Forum Index -> Apache