Apache 2 on Windows XP

This is a discussion on Apache 2 on Windows XP within the Apache Web Server forums, part of the Web Server and Related Forums category; Hey, I just instaled Apache 2 and PHP 5 on my XP SP2 machine. Is there a chance to enable ....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-30-2006
Byru
 
Posts: n/a
Default Apache 2 on Windows XP

Hey,

I just instaled Apache 2 and PHP 5 on my XP SP2 machine.

Is there a chance to enable .htaccess files functionality on this config?
If yes, please explain which settings in conf file of apache do i have to
modify and to which values.
I googled for it today but didnt find a working solution.

TiA

--
Byru
http://colsel.blitz-art.com

  #2 (permalink)  
Old 11-30-2006
shimmyshack
 
Posts: n/a
Default Re: Apache 2 on Windows XP

at the moment AllowOverride is set to None in every directory root and
up

so search for it and change it to

AllowOverride All

that will allow you to use .htaccess files.
Now the issue is creating them, just make sure that when you save the
..htaccess you set the file type to All Files *.* then windows will
allow you to save with the dot at the front.

If you have a file called htaccess which you configure and then want to
rename to .htaccess you cant do that in explorer, you have to open and
save as using the trick above.

you know though that it slows apache down, to proove that just get
filemon from sysinternals and watch apache searching and searching
instead of serving!
better to use <directory> blocks in the various conf files unless you
want a direct copy to dev on.

  #3 (permalink)  
Old 11-30-2006
Byru
 
Posts: n/a
Default Re: Apache 2 on Windows XP

> so search for it and change it to
>
> AllowOverride All
>


Ha, the thing is that this doesnt work. I changed it, restarted apache and
it still does not read (see) my htaccess file(s) and doesnt use them.

--
Byru
http://colsel.blitz-art.com

  #4 (permalink)  
Old 11-30-2006
HansH
 
Posts: n/a
Default Re: Apache 2 on Windows XP


"Byru" <byru@gazeta.pl> schreef in bericht
news:eknk9e$1u8$1@inews.gazeta.pl...
> I just instaled Apache 2 and PHP 5 on my XP SP2 machine.
>
> Is there a chance to enable .htaccess files functionality on this config?

Your reading [should have] started here
http://httpd.apache.org/docs/2.0/mod...accessfilename
http://httpd.apache.org/docs/2.0/mod...#allowoverride

Note: Many editors on Windows take .htaccess as a nameless file only having
an extention and are unwilling to create it. In such case just name it in a
way your editor likes and thereafter rename it to get apache going

HansH


  #5 (permalink)  
Old 12-01-2006
Byru
 
Posts: n/a
Default Re: Apache 2 on Windows XP


Użytkownik "HansH" <hansh@invalid.invalid> napisał w wiadomości
news:456f6f76$0$334$e4fe514c@news.xs4all.nl...
>
> "Byru" <byru@gazeta.pl> schreef in bericht
> news:eknk9e$1u8$1@inews.gazeta.pl...
>> I just instaled Apache 2 and PHP 5 on my XP SP2 machine.


Ok, it just started working. I changed the .htaccess file name to
htaccess.txt in apache conf file. However my page doesn't display css and
images now. The content of the htaccess.txt file is:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mywebsite/index.php [L,NS]

My website is located in the /mywebsite/ DIR in the apache document root.
The htaccess.txt file is located just in this /mywebsite/ DIR. How can i fix
it so the graphics are displayed?

When i look at the source of the page all links are correct (to css and
images).

TiA
Byru

  #6 (permalink)  
Old 12-01-2006
Byru
 
Posts: n/a
Default Re: Apache 2 on Windows XP


> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . /mywebsite/index.php [L,NS]


Ah, i just discovered.

This link works fine (displays graphics and css):
http://localhost/mywebsite/param1

But this doesn't display gfx and css:
http://localhost/mywebsite/param1/

How to fix it so the link with ending slash works as well? (i prefer such
links).

Byru

  #7 (permalink)  
Old 12-01-2006
shimmyshack
 
Posts: n/a
Default Re: Apache 2 on Windows XP

thats a word press kind of setup,

you can also use this kind of thing.

ErrorDocument 404 /
Options -Indexes
RewriteEngine On
RewriteBase /tmp/blah
RewriteRule ^$ index.php/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [QSA,L]

might work for you, you seem to problems with the conf that I wouldnt
expect to see (having to rename to htaccess.txt)

  #8 (permalink)  
Old 12-01-2006
Byru
 
Posts: n/a
Default Re: Apache 2 on Windows XP


Uzytkownik "shimmyshack" <matt.farey@gmail.com> napisal w wiadomosci
news:1164971789.266385.177000@80g2000cwy.googlegro ups.com...
> thats a word press kind of setup,
>
> you can also use this kind of thing.
>
> ErrorDocument 404 /
> Options -Indexes
> RewriteEngine On
> RewriteBase /tmp/blah
> RewriteRule ^$ index.php/ [L]
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule (.*) index.php/$1 [QSA,L]


Hmm. tried this but the website is not displayed at all. I changed the blah
path naturally.

Can you just add the trailing slashes override to the following somehow? i
mean that all links without a slash (/) on the end will be rewritten to have
the slash and additionally the base functionality will be preserved.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mywebsite/index.php [L,NS]

Byru

  #9 (permalink)  
Old 12-01-2006
HansH
 
Posts: n/a
Default Re: Apache 2 on Windows XP

"Byru" <byru@gazeta.pl> schreef in bericht
news:ekoplj$ebe$1@inews.gazeta.pl...
> Użytkownik "HansH" <hansh@invalid.invalid> napisał w wiadomości
> news:456f6f76$0$334$e4fe514c@news.xs4all.nl...
>>
>> "Byru" <byru@gazeta.pl> schreef in bericht
>> news:eknk9e$1u8$1@inews.gazeta.pl...
>>> I just instaled Apache 2 and PHP 5 on my XP SP2 machine.

> Ok, it just started working. I changed the .htaccess file name to
> htaccess.txt in apache conf file.

The renamed .htaccess will backfire as soon as your Windows-hosted site is
replicated to a -eg your providers- Linux based host

> However my page doesn't display css and images now. The content of the
> htaccess.txt file is:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . /mywebsite/index.php [L,NS]

At first sight it is odd to see a single script that handles ALL types of
files.
However, it apperently does as you stated
< This link works fine (displays graphics and css):
< http://localhost/mywebsite/param1

< But this doesn't display gfx and css:
< http://localhost/mywebsite/param1/
If I understand the issue properly, this does display the proper page, but
with broken links.
Are there any other rewriterule applied ANYWHERE in the server or vhost
config or this .htaccess?

> My website is located in the /mywebsite/ DIR in the apache document root.
> The htaccess.txt file is located just in this /mywebsite/ DIR. How can i
> fix it so the graphics are displayed?

To further investicate, I need to know the setting of your DocumentRoot, the
local path of a css, both the working and failing link to that css and its
referer -http://localhost/mywebsite/param1 or
http://localhost/mywebsite/param1-.


HansH


  #10 (permalink)  
Old 12-01-2006
shimmyshack
 
Posts: n/a
Default Re: Apache 2 on Windows XP

i bet the reason you are not having any luck with linked files is
because they are referenced relatively.
src="../images/image.jpg"
rather than absolutely
src="/path/to/timages/image.jpg"

you can alter your script so that it understnads the context of the
file that was sent to it for control, or alter the rewrite rule. (but
without knowing more about your setup I wont guess)

I use absolute links for all includes, (absolute that it relative to
the doc root within html) so I can use model view control scripts and
never care about where the file came from, just what was the requested
URI and serve it, knowing all links will work.
It has always seemed to me infinitely better to use absolute links, but
some people like to "make their websites moveable" for some reason -
put onto CD perhaps.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0