You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by bruno <br...@gmail.com> on 2009/04/01 00:10:18 UTC

[users@httpd] Files not found

Hi all,

I have installed apache 2.2 on my computer and start server but only I
can launch index.html on the browser. When I try to load other file
browser show me error "Not found".

I'm working with Linux Ubuntu Intrepid and installation was through
source code, compiled.

I executed ./configure script with --enable-so and --with-mpm=prefork
options.

I revised owner and permissions and all is correct.

Any suggestions?

Don't recommend me that I can install Apache server using Ubuntu
repositories.  I want to learn building a web server from edge.

Thanks,
Bruno.

Sorry, I know my english isn't good. ;-)






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by bruno <br...@gmail.com>.
On Tue, 2009-03-31 at 20:48 -0400, Brian Mearns wrote:
> On Tue, Mar 31, 2009 at 7:24 PM, Jonesy <gm...@jonz.net> wrote:
> > On Tue, 31 Mar 2009 23:10:18 +0100, bruno wrote:
> >>
> >> I have installed apache 2.2 on my computer and start server but only I
> >> can launch index.html on the browser. When I try to load other file
> >> browser show me error "Not found".
> >
> > What's in the location bar?
> >
> >        http://127.0.0.1/   ?
> >
> >  -or-
> >
> >        file:///path/to/index.html      ?
> 
> What files are you expecting? The build usually sets up the
> DocumentRoot to be ${prefix}/htdocs/ or something, and the only thing
> that's there by default is index.html. If you have other files you
> want to serve, you need to set/change the DocumentRoot directive in
> your httpd.conf file.

I'm building html files on apache default htdocs directory. I didn't
make any change to httpd.conf.

> 
> -Brian
> 

Thanks,
Bruno.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by Brian Mearns <me...@gmail.com>.
On Tue, Mar 31, 2009 at 7:24 PM, Jonesy <gm...@jonz.net> wrote:
> On Tue, 31 Mar 2009 23:10:18 +0100, bruno wrote:
>>
>> I have installed apache 2.2 on my computer and start server but only I
>> can launch index.html on the browser. When I try to load other file
>> browser show me error "Not found".
>
> What's in the location bar?
>
>        http://127.0.0.1/   ?
>
>  -or-
>
>        file:///path/to/index.html      ?

What files are you expecting? The build usually sets up the
DocumentRoot to be ${prefix}/htdocs/ or something, and the only thing
that's there by default is index.html. If you have other files you
want to serve, you need to set/change the DocumentRoot directive in
your httpd.conf file.

-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by Tom Evans <te...@googlemail.com>.
On Wed, 2009-04-01 at 21:48 +0100, bruno wrote:
> On Wed, 2009-04-01 at 16:36 +0100, Tom Evans wrote:
> > On Wed, 2009-04-01 at 15:55 +0100, bruno wrote:
> > > 
> > > I tried to load html files from a few computers in my lan.  I wrote
> > > 127.0.0.1 on localhost and sever's IP address from others computers but
> > > only I can load index.html saying "It works".
> > > 
> > > Thanks,
> > > Bruno.
> > > 
> > 
> > 127.0.0.1 will only work if the browser is run from the same machine the
> > server is on[1]. 
> 
> I know it.  Pehaps I didn't me. Sorry.
> 
> > 
> > That index.html that is loaded is the apache default. You need to see
> > why the files aren't found.
> > 
> > 1) Find your httpd.conf 
> >   ps auxww | grep httpd (The '-f' argument is the conf file.)
> > 
> 
> This is result
> 
> root      2998  0.0  0.1   4332  2000 ?        Ss   16:14
> 0:00 /usr/local/apache2/bin/httpd -k start
> daemon    3250  0.0  0.1   4332  1300 ?        S    16:31
> 0:00 /usr/local/apache2/bin/httpd -k start
> daemon    3251  0.0  0.1 225676  2008 ?        Sl   16:31
> 0:00 /usr/local/apache2/bin/httpd -k start
> daemon    3254  0.0  0.1 225676  2012 ?        Sl   16:31
> 0:00 /usr/local/apache2/bin/httpd -k start
> daemon    3259  0.0  0.1 225676  2012 ?        Sl   16:31
> 0:00 /usr/local/apache2/bin/httpd -k start
> daemon    3335  0.0  0.1 225676  1624 ?        Sl   16:31
> 0:00 /usr/local/apache2/bin/httpd -k start
> root      3969  0.0  0.0   3144   772 pts/1    S+   21:36   0:00 grep
> httpd
> 
> > 2) Find the important settings in your httpd.conf:
> >   egrep ^ServerRoot\|^ErrorLog\|^DocumentRoot /path/to/httpd.conf
> > 
> 
> ServerRoot "/usr/local/apache2"
> DocumentRoot "/usr/local/apache2/htdocs"
> ErrorLog "logs/error_log"

Your error log is at /usr/local/apache2/logs/error_log. What does it
say? 

> 
> > 3) Try to load a file, then look in your error log to see why it didn't
> > load. You are almost certainly putting your files in one directory, and
> > apache is looking in another. That is the 'DocumentRoot' setting.
> > 
> > If you need more help, please reply INCLUDING THE 
> 
> In httpd.conf log file is set up to appear in /apache/directory/log but
> there isn't any file.
> 
> > INFORMATION I ASKED
> > FOR. :)
> > 
> > Cheers
> > 
> > Tom
> > 
> > 
> > [1] http://en.wikipedia.org/wiki/Localhost
> > 
> 
> I know what is localhost, thanks. ;-)
> 
> 
> Thanks,
> Bruno.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by bruno <br...@gmail.com>.
On Wed, 2009-04-01 at 16:36 +0100, Tom Evans wrote:
> On Wed, 2009-04-01 at 15:55 +0100, bruno wrote:
> > 
> > I tried to load html files from a few computers in my lan.  I wrote
> > 127.0.0.1 on localhost and sever's IP address from others computers but
> > only I can load index.html saying "It works".
> > 
> > Thanks,
> > Bruno.
> > 
> 
> 127.0.0.1 will only work if the browser is run from the same machine the
> server is on[1]. 

I know it.  Pehaps I didn't me. Sorry.

> 
> That index.html that is loaded is the apache default. You need to see
> why the files aren't found.
> 
> 1) Find your httpd.conf 
>   ps auxww | grep httpd (The '-f' argument is the conf file.)
> 

This is result

root      2998  0.0  0.1   4332  2000 ?        Ss   16:14
0:00 /usr/local/apache2/bin/httpd -k start
daemon    3250  0.0  0.1   4332  1300 ?        S    16:31
0:00 /usr/local/apache2/bin/httpd -k start
daemon    3251  0.0  0.1 225676  2008 ?        Sl   16:31
0:00 /usr/local/apache2/bin/httpd -k start
daemon    3254  0.0  0.1 225676  2012 ?        Sl   16:31
0:00 /usr/local/apache2/bin/httpd -k start
daemon    3259  0.0  0.1 225676  2012 ?        Sl   16:31
0:00 /usr/local/apache2/bin/httpd -k start
daemon    3335  0.0  0.1 225676  1624 ?        Sl   16:31
0:00 /usr/local/apache2/bin/httpd -k start
root      3969  0.0  0.0   3144   772 pts/1    S+   21:36   0:00 grep
httpd

> 2) Find the important settings in your httpd.conf:
>   egrep ^ServerRoot\|^ErrorLog\|^DocumentRoot /path/to/httpd.conf
> 

ServerRoot "/usr/local/apache2"
DocumentRoot "/usr/local/apache2/htdocs"
ErrorLog "logs/error_log"

> 3) Try to load a file, then look in your error log to see why it didn't
> load. You are almost certainly putting your files in one directory, and
> apache is looking in another. That is the 'DocumentRoot' setting.
> 
> If you need more help, please reply INCLUDING THE 

In httpd.conf log file is set up to appear in /apache/directory/log but
there isn't any file.

> INFORMATION I ASKED
> FOR. :)
> 
> Cheers
> 
> Tom
> 
> 
> [1] http://en.wikipedia.org/wiki/Localhost
> 

I know what is localhost, thanks. ;-)


Thanks,
Bruno.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by Tom Evans <te...@googlemail.com>.
On Wed, 2009-04-01 at 15:55 +0100, bruno wrote:
> 
> I tried to load html files from a few computers in my lan.  I wrote
> 127.0.0.1 on localhost and sever's IP address from others computers but
> only I can load index.html saying "It works".
> 
> Thanks,
> Bruno.
> 

127.0.0.1 will only work if the browser is run from the same machine the
server is on[1]. 

That index.html that is loaded is the apache default. You need to see
why the files aren't found.

1) Find your httpd.conf 
  ps auxww | grep httpd (The '-f' argument is the conf file.)

2) Find the important settings in your httpd.conf:
  egrep ^ServerRoot\|^ErrorLog\|^DocumentRoot /path/to/httpd.conf

3) Try to load a file, then look in your error log to see why it didn't
load. You are almost certainly putting your files in one directory, and
apache is looking in another. That is the 'DocumentRoot' setting.

If you need more help, please reply INCLUDING THE INFORMATION I ASKED
FOR. :)

Cheers

Tom


[1] http://en.wikipedia.org/wiki/Localhost


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Files not found

Posted by bruno <br...@gmail.com>.
On Tue, 2009-03-31 at 23:24 +0000, Jonesy wrote:
> On Tue, 31 Mar 2009 23:10:18 +0100, bruno wrote:
> >
> > I have installed apache 2.2 on my computer and start server but only I
> > can launch index.html on the browser. When I try to load other file
> > browser show me error "Not found".
> 
> What's in the location bar?
> 
>   	http://127.0.0.1/   ?
> 
>  -or-
> 
>   	file:///path/to/index.html      ?
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


I tried to load html files from a few computers in my lan.  I wrote
127.0.0.1 on localhost and sever's IP address from others computers but
only I can load index.html saying "It works".

Thanks,
Bruno.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Files not found

Posted by Jonesy <gm...@jonz.net>.
On Tue, 31 Mar 2009 23:10:18 +0100, bruno wrote:
>
> I have installed apache 2.2 on my computer and start server but only I
> can launch index.html on the browser. When I try to load other file
> browser show me error "Not found".

What's in the location bar?

  	http://127.0.0.1/   ?

 -or-

  	file:///path/to/index.html      ?



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Switching between http and https

Posted by inas inassen <me...@hotmail.com>.
Thanks Brian

 

I figured out the issue, here is the solution

 

RewriteEngine On

RewriteLogLevel 8

RewriteLog logs/webserver/rewrite_log

#

RewriteCond %{HTTP_HOST} ^webserver1.*

RewriteCond %{HTTPS} off

RewriteCond %{REQUEST_URI} (ssl1(.*)|ssl2(.*))

RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

 

RewriteCond %{HTTP_HOST} ^webserver1.*

RewriteCond %{HTTPS} on

RewriteCond %{REQUEST_URI} (ssl1(.*)|ssl2(.*))

RewriteRule ^/(ssl1(.*)|ssl2(.*)) https://%{SERVER_NAME}/tomcat%{REQUEST_URI} [P,QSA,L]

 

RewriteCond %{HTTP_HOST} ^webserver1.*

RewriteCond %{HTTPS} on

RewriteCond %{REQUEST_URI} (nossl1(.*)|nossl2(.*)) 

RewriteRule (.*) http://%{SERVER_NAME}%{REQUEST_URI} [R,L]

 

RewriteCond %{HTTP_HOST} ^webserver1.*

RewriteCond %{HTTPS} off

RewriteCond %{REQUEST_URI} (nossl1(.*)|nossl2(.*))

RewriteRule ^/(nossl1(.*)|nossl2(.*)) http://%{SERVER_NAME}/tomcat%{REQUEST_URI} [P,QSA,L]

 

Thanks.

 
Inas. 
> Date: Wed, 1 Apr 2009 14:15:42 -0400
> From: mearns.b@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Switching between http and https
> 
> On Wed, Apr 1, 2009 at 1:24 PM, inas inassen <me...@hotmail.com> wrote:
> > Thanks Brian,
> >
> > you right, I did correction, but it seems not working for ssl and it works
> > for nossl
> >
> > this is my rewrite rules
> >
> > RewriteEngine On
> > RewriteLog logs/webserver1/rewrite_log
> > #
> > RewriteCond %{HTTP_HOST} ^webserver1.*
> > RewriteCond %{HTTPS} =off
> > RewriteCond %{SERVER_PORT} ^80
> > RewriteRule ^/nossl(.*)    /tomcat/nossl$1 [P,QSA,L]
> > RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
> > #
> > #
> > RewriteCond %{HTTP_HOST} ^webserver1.*
> > RewriteCond %{HTTPS} =on
> > RewriteCond %{SERVER_PORT} ^443
> > RewriteRule ^/ssl(.*)      /tomcat/ssl$1 [P,QSA,L]
> > RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
> > #
> >
> > this is my proxy balancer:
> >
> > <Proxy balancer://tomcat/>
> >         BalancerMember ajp://appserver:8009 route=r1 loadfactor=1
> > keepalive=On
> > </Proxy>
> > <Location /tomcat/nossl/>
> >         ProxyPass        balancer://tomcat/sossl/    nofailover=On
> > lbmethod=byrequests
> >         ProxyPassReverse balancer://tomcat/nossl/
> >         Order Deny,Allow
> >         Allow from all
> > </Location>
> > <Location /tomcat/ssl/>
> >         ProxyPass        balancer://tomcat/ssl/    nofailover=On
> > lbmethod=byrequests
> >         ProxyPassReverse balancer://tomcat/ssl/
> >         Order Deny,Allow
> >         Allow from all
> > </Location>
> >
> >
> > Any suggestion?
> >
> > thanks.
> >
> > Inas.
> >
> 
> Sorry, don't know anything about load-balancers or Tomcat. Only thing
> that stands out to me is that you should probably use the [R] flag on
> the rewrite rules that specify absolute paths. Otherwise, there's a
> good chance Apache is going to make it an interal rewrite and you
> can't change protocols using internal rewrites, you need to redirect
> the client to tell them to use the different protocol.
> 
> Best,
> -Brian
> 
> -- 
> Feel free to contact me using PGP Encryption:
> Key Id: 0x3AA70848
> Available from: http://pgp.mit.edu/
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Découvrez toutes les possibilités de communication avec vos proches
http://www.microsoft.com/windows/windowslive/default.aspx

Re: [users@httpd] Switching between http and https

Posted by Brian Mearns <me...@gmail.com>.
On Wed, Apr 1, 2009 at 1:24 PM, inas inassen <me...@hotmail.com> wrote:
> Thanks Brian,
>
> you right, I did correction, but it seems not working for ssl and it works
> for nossl
>
> this is my rewrite rules
>
> RewriteEngine On
> RewriteLog logs/webserver1/rewrite_log
> #
> RewriteCond %{HTTP_HOST} ^webserver1.*
> RewriteCond %{HTTPS} =off
> RewriteCond %{SERVER_PORT} ^80
> RewriteRule ^/nossl(.*)    /tomcat/nossl$1 [P,QSA,L]
> RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
> #
> #
> RewriteCond %{HTTP_HOST} ^webserver1.*
> RewriteCond %{HTTPS} =on
> RewriteCond %{SERVER_PORT} ^443
> RewriteRule ^/ssl(.*)      /tomcat/ssl$1 [P,QSA,L]
> RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
> #
>
> this is my proxy balancer:
>
> <Proxy balancer://tomcat/>
>         BalancerMember ajp://appserver:8009 route=r1 loadfactor=1
> keepalive=On
> </Proxy>
> <Location /tomcat/nossl/>
>         ProxyPass        balancer://tomcat/sossl/    nofailover=On
> lbmethod=byrequests
>         ProxyPassReverse balancer://tomcat/nossl/
>         Order Deny,Allow
>         Allow from all
> </Location>
> <Location /tomcat/ssl/>
>         ProxyPass        balancer://tomcat/ssl/    nofailover=On
> lbmethod=byrequests
>         ProxyPassReverse balancer://tomcat/ssl/
>         Order Deny,Allow
>         Allow from all
> </Location>
>
>
> Any suggestion?
>
> thanks.
>
> Inas.
>

Sorry, don't know anything about load-balancers or Tomcat. Only thing
that stands out to me is that you should probably use the [R] flag on
the rewrite rules that specify absolute paths. Otherwise, there's a
good chance Apache is going to make it an interal rewrite and you
can't change protocols using internal rewrites, you need to redirect
the client to tell them to use the different protocol.

Best,
-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Switching between http and https

Posted by inas inassen <me...@hotmail.com>.
Thanks Brian,

 

you right, I did correction, but it seems not working for ssl and it works for nossl

 

this is my rewrite rules

 

RewriteEngine On
RewriteLog logs/webserver1/rewrite_log
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTPS} =off
RewriteCond %{SERVER_PORT} ^80
RewriteRule ^/nossl(.*)    /tomcat/nossl$1 [P,QSA,L]
RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
#
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTPS} =on
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^/ssl(.*)      /tomcat/ssl$1 [P,QSA,L]
RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
#


this is my proxy balancer:

 

<Proxy balancer://tomcat/>
        BalancerMember ajp://appserver:8009 route=r1 loadfactor=1 keepalive=On
</Proxy>

<Location /tomcat/nossl/>
        ProxyPass        balancer://tomcat/sossl/    nofailover=On lbmethod=byrequests
        ProxyPassReverse balancer://tomcat/nossl/
        Order Deny,Allow
        Allow from all
</Location>
<Location /tomcat/ssl/>
        ProxyPass        balancer://tomcat/ssl/    nofailover=On lbmethod=byrequests
        ProxyPassReverse balancer://tomcat/ssl/
        Order Deny,Allow
        Allow from all
</Location>


 

Any suggestion?

 

thanks.

 

Inas.


 
> Date: Wed, 1 Apr 2009 12:07:11 -0400
> From: mearns.b@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Switching between http and https
> 
> On Wed, Apr 1, 2009 at 11:19 AM, inas inassen <me...@hotmail.com> wrote:
> >
> > Hi all,
> >
> > I'm using mod_proxy balancer with tomcat and apache.
> > I used mod_rewrite to switch between http and https
> >
> > When I have the pattern /nossl ==> I want to redirect to http
> > When I have the pattern /ssl   ==> I want to redirect to https
> >
> > so I write the following rules:
> >
> > RewriteEngine On
> 
> The answer lies within...
> > RewriteLog logs/webserver1/rewrite_log
> 
> 
> > #
> > RewriteCond %{HTTP_HOST} ^webserver1.*
> > RewriteCond %{HTTP} =on
> > RewriteCond %{SERVER_PORT} ^80
> > RewriteRule ^/nossl(.*)    /balancer/nossl$1 [P,QSA,L]
> > RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
> > #
> > #
> > RewriteCond %{HTTP_HOST} ^webserver1.*
> > RewriteCond %{HTTPS} =on
> > RewriteCond %{SERVER_PORT} ^443
> > RewriteRule ^/ssl(.*)      /balancer/ssl$1 [P,QSA,L]
> > RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
> > #
> > Is there something wrong, because it doesn't work
> Then yes, there's something wrong =J.
> 
> As far as I know, and can see in the documentation, this var is not correct:
> RewriteCond %{HTTP} =on
> If you want to match when HTTPS is not active, you want:
> RewriteCond %{HTTPS} =off
> [http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond]
> 
> Beyond that, you'll have to be more explicit about how it's not
> working. What page do you access, and how does it respond? what does
> the rewrite log say?
> 
> -Brian
> 
> --
> Feel free to contact me using PGP Encryption:
> Key Id: 0x3AA70848
> Available from: http://pgp.mit.edu/
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !
http://www.microsoft.com/windows/windowslive/default.aspx

Re: [users@httpd] Switching between http and https

Posted by Brian Mearns <me...@gmail.com>.
On Wed, Apr 1, 2009 at 11:19 AM, inas inassen <me...@hotmail.com> wrote:
>
> Hi all,
>
> I'm using mod_proxy balancer with tomcat and apache.
> I used mod_rewrite to switch between http and https
>
> When I have the pattern /nossl ==> I want to redirect to http
> When I have the pattern /ssl   ==> I want to redirect to https
>
> so I write the following rules:
>
> RewriteEngine On

The answer lies within...
> RewriteLog logs/webserver1/rewrite_log


> #
> RewriteCond %{HTTP_HOST} ^webserver1.*
> RewriteCond %{HTTP} =on
> RewriteCond %{SERVER_PORT} ^80
> RewriteRule ^/nossl(.*)    /balancer/nossl$1 [P,QSA,L]
> RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
> #
> #
> RewriteCond %{HTTP_HOST} ^webserver1.*
> RewriteCond %{HTTPS} =on
> RewriteCond %{SERVER_PORT} ^443
> RewriteRule ^/ssl(.*)      /balancer/ssl$1 [P,QSA,L]
> RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
> #
> Is there something wrong, because it doesn't work
Then yes, there's something wrong =J.

As far as I know, and can see in the documentation, this var is not correct:
RewriteCond %{HTTP} =on
If you want to match when HTTPS is not active, you want:
RewriteCond %{HTTPS} =off
[http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond]

Beyond that, you'll have to be more explicit about how it's not
working. What page do you access, and how does it respond? what does
the rewrite log say?

-Brian

--
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Switching between http and https

Posted by inas inassen <me...@hotmail.com>.
Hi all,

 

I'm using mod_proxy balancer with tomcat and apache.

I used mod_rewrite to switch between http and https

 

When I have the pattern /nossl ==> I want to redirect to http
When I have the pattern /ssl   ==> I want to redirect to https

 

so I write the following rules:

 

RewriteEngine On
RewriteLog logs/webserver1/rewrite_log
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTP} =on
RewriteCond %{SERVER_PORT} ^80

RewriteRule ^/nossl(.*)    /balancer/nossl$1 [P,QSA,L]
RewriteRule ^/ssl(.*)$     https://%{SERVER_NAME}:443/ssl$1 [NC,L]
#
#
RewriteCond %{HTTP_HOST} ^webserver1.*
RewriteCond %{HTTPS} =on
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^/ssl(.*)      /balancer/ssl$1 [P,QSA,L]
RewriteRule ^/nossl(.*)$   http://%{SERVER_NAME}:80/nossl$1 [NC,L]
#

Is there something wrong, because it doesn't work

 

thanks for help.

Inas.

_________________________________________________________________
Découvrez tout ce que Windows Live a à vous apporter !
http://www.microsoft.com/windows/windowslive/

Re: [users@httpd] Files not found

Posted by bruno <br...@gmail.com>.
On Tue, 2009-03-31 at 18:14 -0400, Glen Barber wrote:
> Hi, Bruno.
> 
> On Tue, Mar 31, 2009 at 6:10 PM, bruno <br...@gmail.com> wrote:
> > Hi all,
> >
> > I have installed apache 2.2 on my computer and start server but only I
> > can launch index.html on the browser. When I try to load other file
> > browser show me error "Not found".
> >
> 
> Is httpd running?  `ps -ef | grep httpd'

Yes, it's running.

> 
> If it is running, is there anything in the httpd-error.log file?
> 
> > I'm working with Linux Ubuntu Intrepid and installation was through
> > source code, compiled.
> >
> > I executed ./configure script with --enable-so and --with-mpm=prefork
> > options.
> >
> 
> I'll assume you did `make; make install' afterwards?

:-) Of course.

> 
> > I revised owner and permissions and all is correct.
> >
> > Any suggestions?
> >
> > Don't recommend me that I can install Apache server using Ubuntu
> > repositories.  I want to learn building a web server from edge.
> >
> 
> Building from source is the 'right' way, IMHO.
> 
> > Thanks,
> > Bruno.
> >
> > Sorry, I know my english isn't good. ;-)
> >
> 
> Your english is fine. :)
> 

Thanks,
Bruno.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Files not found

Posted by Glen Barber <gl...@gmail.com>.
Hi, Bruno.

On Tue, Mar 31, 2009 at 6:10 PM, bruno <br...@gmail.com> wrote:
> Hi all,
>
> I have installed apache 2.2 on my computer and start server but only I
> can launch index.html on the browser. When I try to load other file
> browser show me error "Not found".
>

Is httpd running?  `ps -ef | grep httpd'

If it is running, is there anything in the httpd-error.log file?

> I'm working with Linux Ubuntu Intrepid and installation was through
> source code, compiled.
>
> I executed ./configure script with --enable-so and --with-mpm=prefork
> options.
>

I'll assume you did `make; make install' afterwards?

> I revised owner and permissions and all is correct.
>
> Any suggestions?
>
> Don't recommend me that I can install Apache server using Ubuntu
> repositories.  I want to learn building a web server from edge.
>

Building from source is the 'right' way, IMHO.

> Thanks,
> Bruno.
>
> Sorry, I know my english isn't good. ;-)
>

Your english is fine. :)

-- 
Glen Barber

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org