base url includes SCRIPT_NAME, which contains too much stuff

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

base url includes SCRIPT_NAME, which contains too much stuff

Dieter Plaetinck
Hi,
I'm using the latest 1.5 code from git

my flavours/html.flav/head contains:

<a href="$(base_url)/">$(blog_title)</a>

When I go to http://localhost/ this works fine: I see my blog with all
entries, but then, I click a link to see an individual entry, say
http://localhost/back_from_canada_archcon.html

this page shows fine, i see the entry i wanted to see,
but the $base_url is now the current page +'/', so the link to take me
home points to http://localhost/back_from_canada_archcon.html/
which, btw, shows the home page
So I can go to http://localhost/back_from_canada_archcon.html/, and
click on any entry to see it, say:
http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
when I'm there, the $base_url is again
http://localhost/back_from_canada_archcon.html/

To be sure, i disabled all plugins (and restarted the webserver) but
the issue stays the same.


Another thing, which is probably related: if i have enabled the tags
plugin (took the latest one from git)
and I am at http://localhost, then click on a tag-link, say:
http://localhost/tag/foss
it says:
"The page you are looking for is not available
Somehow I cannot find the page you want." and $base_url is now
http://localhost/tag/

I know I can define $base_url in config.py, but I don't see why that
should be needed, since my webserver does not do anything fancy like
url rewriting, pyblosxom should be able to get the correct base_url by
itself right?

so I checked the code, more specifically class PyBlosxom ,
function initialize(), where I see SCRIPT_NAME from the http
environment is stored in the base_url.

And SCRIPT_NAME, when visiting
http://localhost/back_from_canada_archcon.html
is:
/back_from_canada_archcon.html/

Is this normal? I couldn't immediately figure out what the SCRIPT_NAME
is supposed to be. Is this a bug with my webserver or my setup? (I use
lighttpd 1.4.28, my config is at http://sprunge.us/JCCO, the fastcgi
script is at
http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)

Thanks,
Dieter

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
Reply | Threaded
Open this post in threaded view
|

Re: base url includes SCRIPT_NAME, which contains too much stuff

will kahn-greene
SCRIPT_NAME is an environment variable that comes from whatever
environment you're running PyBlosxom in.  It shouldn't be the full
path--it should be the path from which the script was executed.  It's a
pretty standard CGI variable.

How does your environment build the SCRIPT_NAME variable?

Regardless, the documentation encourages you to set the base_url in your
config.py file if it's not getting generated correctly for your
situation.  I set it in my config.py file because I use mod_rewrite for
url rewriting.

/will


On 11/02/2010 09:25 AM, Dieter Plaetinck wrote:

> Hi,
> I'm using the latest 1.5 code from git
>
> my flavours/html.flav/head contains:
>
> <a href="$(base_url)/">$(blog_title)</a>
>
> When I go to http://localhost/ this works fine: I see my blog with all
> entries, but then, I click a link to see an individual entry, say
> http://localhost/back_from_canada_archcon.html
>
> this page shows fine, i see the entry i wanted to see,
> but the $base_url is now the current page +'/', so the link to take me
> home points to http://localhost/back_from_canada_archcon.html/
> which, btw, shows the home page
> So I can go to http://localhost/back_from_canada_archcon.html/, and
> click on any entry to see it, say:
> http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
> when I'm there, the $base_url is again
> http://localhost/back_from_canada_archcon.html/
>
> To be sure, i disabled all plugins (and restarted the webserver) but
> the issue stays the same.
>
>
> Another thing, which is probably related: if i have enabled the tags
> plugin (took the latest one from git)
> and I am at http://localhost, then click on a tag-link, say:
> http://localhost/tag/foss
> it says:
> "The page you are looking for is not available
> Somehow I cannot find the page you want." and $base_url is now
> http://localhost/tag/
>
> I know I can define $base_url in config.py, but I don't see why that
> should be needed, since my webserver does not do anything fancy like
> url rewriting, pyblosxom should be able to get the correct base_url by
> itself right?
>
> so I checked the code, more specifically class PyBlosxom ,
> function initialize(), where I see SCRIPT_NAME from the http
> environment is stored in the base_url.
>
> And SCRIPT_NAME, when visiting
> http://localhost/back_from_canada_archcon.html
> is:
> /back_from_canada_archcon.html/
>
> Is this normal? I couldn't immediately figure out what the SCRIPT_NAME
> is supposed to be. Is this a bug with my webserver or my setup? (I use
> lighttpd 1.4.28, my config is at http://sprunge.us/JCCO, the fastcgi
> script is at
> http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)
>
> Thanks,
> Dieter
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> pyblosxom-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
Reply | Threaded
Open this post in threaded view
|

Re: base url includes SCRIPT_NAME, which contains too much stuff

Dieter Plaetinck
I use a fastcgi wsgi script, ran by Lighttpd.
The script and the lighty config are in my previous mail, not sure what
else you want to know?
So if I understand what you're saying, the SCRIPT_NAME in the
environment is incorrect.

I think I might be hitting the following issue:
http://redmine.lighttpd.net/issues/729

Dieter


On Tue, 02 Nov 2010 09:50:14 -0400
will kahn-greene <[hidden email]> wrote:

> SCRIPT_NAME is an environment variable that comes from whatever
> environment you're running PyBlosxom in.  It shouldn't be the full
> path--it should be the path from which the script was executed.  It's
> a pretty standard CGI variable.
>
> How does your environment build the SCRIPT_NAME variable?
>
> Regardless, the documentation encourages you to set the base_url in
> your config.py file if it's not getting generated correctly for your
> situation.  I set it in my config.py file because I use mod_rewrite
> for url rewriting.
>
> /will
>
>
> On 11/02/2010 09:25 AM, Dieter Plaetinck wrote:
> > Hi,
> > I'm using the latest 1.5 code from git
> >
> > my flavours/html.flav/head contains:
> >
> > <a href="$(base_url)/">$(blog_title)</a>
> >
> > When I go to http://localhost/ this works fine: I see my blog with
> > all entries, but then, I click a link to see an individual entry,
> > say http://localhost/back_from_canada_archcon.html
> >
> > this page shows fine, i see the entry i wanted to see,
> > but the $base_url is now the current page +'/', so the link to take
> > me home points to http://localhost/back_from_canada_archcon.html/
> > which, btw, shows the home page
> > So I can go to http://localhost/back_from_canada_archcon.html/, and
> > click on any entry to see it, say:
> > http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
> > when I'm there, the $base_url is again
> > http://localhost/back_from_canada_archcon.html/
> >
> > To be sure, i disabled all plugins (and restarted the webserver) but
> > the issue stays the same.
> >
> >
> > Another thing, which is probably related: if i have enabled the tags
> > plugin (took the latest one from git)
> > and I am at http://localhost, then click on a tag-link, say:
> > http://localhost/tag/foss
> > it says:
> > "The page you are looking for is not available
> > Somehow I cannot find the page you want." and $base_url is now
> > http://localhost/tag/
> >
> > I know I can define $base_url in config.py, but I don't see why that
> > should be needed, since my webserver does not do anything fancy like
> > url rewriting, pyblosxom should be able to get the correct base_url
> > by itself right?
> >
> > so I checked the code, more specifically class PyBlosxom ,
> > function initialize(), where I see SCRIPT_NAME from the http
> > environment is stored in the base_url.
> >
> > And SCRIPT_NAME, when visiting
> > http://localhost/back_from_canada_archcon.html
> > is:
> > /back_from_canada_archcon.html/
> >
> > Is this normal? I couldn't immediately figure out what the
> > SCRIPT_NAME is supposed to be. Is this a bug with my webserver or
> > my setup? (I use lighttpd 1.4.28, my config is at
> > http://sprunge.us/JCCO, the fastcgi script is at
> > http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)
> >
> > Thanks,
> > Dieter
> >
> > ------------------------------------------------------------------------------
> > Nokia and AT&T present the 2010 Calling All Innovators-North
> > America contest Create new apps & games for the Nokia N8 for
> > consumers in  U.S. and Canada $10 million total in prizes - $4M
> > cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt
> > SDK, Web Runtime, or Java and Publish to Ovi Store
> > http://p.sf.net/sfu/nokia-dev2dev
> > _______________________________________________ pyblosxom-users
> > mailing list [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
> >


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
Reply | Threaded
Open this post in threaded view
|

Re: base url includes SCRIPT_NAME, which contains too much stuff

Dieter Plaetinck
I've now hardcoded my baseurl:

$ grep base_url /srv/http/dieterblog/config.py
base_url = "http://localhost"

However this does not solve the problem.
Like before, I tried disabling all plugins (and restarting lighty), to
no avail. My entire blog source code can be found at
https://github.com/Dieterbe/dieterblog

Dieter

On Tue, 2 Nov 2010 14:58:17 +0100
Dieter Plaetinck <[hidden email]> wrote:

> I use a fastcgi wsgi script, ran by Lighttpd.
> The script and the lighty config are in my previous mail, not sure
> what else you want to know?
> So if I understand what you're saying, the SCRIPT_NAME in the
> environment is incorrect.
>
> I think I might be hitting the following issue:
> http://redmine.lighttpd.net/issues/729
>
> Dieter
>
>
> On Tue, 02 Nov 2010 09:50:14 -0400
> will kahn-greene <[hidden email]> wrote:
>
> > SCRIPT_NAME is an environment variable that comes from whatever
> > environment you're running PyBlosxom in.  It shouldn't be the full
> > path--it should be the path from which the script was executed.
> > It's a pretty standard CGI variable.
> >
> > How does your environment build the SCRIPT_NAME variable?
> >
> > Regardless, the documentation encourages you to set the base_url in
> > your config.py file if it's not getting generated correctly for your
> > situation.  I set it in my config.py file because I use mod_rewrite
> > for url rewriting.
> >
> > /will
> >
> >
> > On 11/02/2010 09:25 AM, Dieter Plaetinck wrote:
> > > Hi,
> > > I'm using the latest 1.5 code from git
> > >
> > > my flavours/html.flav/head contains:
> > >
> > > <a href="$(base_url)/">$(blog_title)</a>
> > >
> > > When I go to http://localhost/ this works fine: I see my blog with
> > > all entries, but then, I click a link to see an individual entry,
> > > say http://localhost/back_from_canada_archcon.html
> > >
> > > this page shows fine, i see the entry i wanted to see,
> > > but the $base_url is now the current page +'/', so the link to
> > > take me home points to
> > > http://localhost/back_from_canada_archcon.html/ which, btw, shows
> > > the home page So I can go to
> > > http://localhost/back_from_canada_archcon.html/, and click on any
> > > entry to see it, say:
> > > http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
> > > when I'm there, the $base_url is again
> > > http://localhost/back_from_canada_archcon.html/
> > >
> > > To be sure, i disabled all plugins (and restarted the webserver)
> > > but the issue stays the same.
> > >
> > >
> > > Another thing, which is probably related: if i have enabled the
> > > tags plugin (took the latest one from git)
> > > and I am at http://localhost, then click on a tag-link, say:
> > > http://localhost/tag/foss
> > > it says:
> > > "The page you are looking for is not available
> > > Somehow I cannot find the page you want." and $base_url is now
> > > http://localhost/tag/
> > >
> > > I know I can define $base_url in config.py, but I don't see why
> > > that should be needed, since my webserver does not do anything
> > > fancy like url rewriting, pyblosxom should be able to get the
> > > correct base_url by itself right?
> > >
> > > so I checked the code, more specifically class PyBlosxom ,
> > > function initialize(), where I see SCRIPT_NAME from the http
> > > environment is stored in the base_url.
> > >
> > > And SCRIPT_NAME, when visiting
> > > http://localhost/back_from_canada_archcon.html
> > > is:
> > > /back_from_canada_archcon.html/
> > >
> > > Is this normal? I couldn't immediately figure out what the
> > > SCRIPT_NAME is supposed to be. Is this a bug with my webserver or
> > > my setup? (I use lighttpd 1.4.28, my config is at
> > > http://sprunge.us/JCCO, the fastcgi script is at
> > > http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)
> > >
> > > Thanks,
> > > Dieter
> > >
> > > ------------------------------------------------------------------------------
> > > Nokia and AT&T present the 2010 Calling All Innovators-North
> > > America contest Create new apps & games for the Nokia N8 for
> > > consumers in  U.S. and Canada $10 million total in prizes - $4M
> > > cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt
> > > SDK, Web Runtime, or Java and Publish to Ovi Store
> > > http://p.sf.net/sfu/nokia-dev2dev
> > > _______________________________________________ pyblosxom-users
> > > mailing list [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
> > >
>


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
Reply | Threaded
Open this post in threaded view
|

Re: base url includes SCRIPT_NAME, which contains too much stuff

will kahn-greene
You need to set the base_url config.py variable:

py["base_url"] = "http://localhost"

http://pyblosxom.bluesock.org/1.5/config_variables.html#base-url


On 11/07/2010 09:54 AM, Dieter Plaetinck wrote:

> I've now hardcoded my baseurl:
>
> $ grep base_url /srv/http/dieterblog/config.py
> base_url = "http://localhost"
>
> However this does not solve the problem.
> Like before, I tried disabling all plugins (and restarting lighty), to
> no avail. My entire blog source code can be found at
> https://github.com/Dieterbe/dieterblog
>
> Dieter
>
> On Tue, 2 Nov 2010 14:58:17 +0100
> Dieter Plaetinck <[hidden email]> wrote:
>
>> I use a fastcgi wsgi script, ran by Lighttpd.
>> The script and the lighty config are in my previous mail, not sure
>> what else you want to know?
>> So if I understand what you're saying, the SCRIPT_NAME in the
>> environment is incorrect.
>>
>> I think I might be hitting the following issue:
>> http://redmine.lighttpd.net/issues/729
>>
>> Dieter
>>
>>
>> On Tue, 02 Nov 2010 09:50:14 -0400
>> will kahn-greene <[hidden email]> wrote:
>>
>>> SCRIPT_NAME is an environment variable that comes from whatever
>>> environment you're running PyBlosxom in.  It shouldn't be the full
>>> path--it should be the path from which the script was executed.
>>> It's a pretty standard CGI variable.
>>>
>>> How does your environment build the SCRIPT_NAME variable?
>>>
>>> Regardless, the documentation encourages you to set the base_url in
>>> your config.py file if it's not getting generated correctly for your
>>> situation.  I set it in my config.py file because I use mod_rewrite
>>> for url rewriting.
>>>
>>> /will
>>>
>>>
>>> On 11/02/2010 09:25 AM, Dieter Plaetinck wrote:
>>>> Hi,
>>>> I'm using the latest 1.5 code from git
>>>>
>>>> my flavours/html.flav/head contains:
>>>>
>>>> <a href="$(base_url)/">$(blog_title)</a>
>>>>
>>>> When I go to http://localhost/ this works fine: I see my blog with
>>>> all entries, but then, I click a link to see an individual entry,
>>>> say http://localhost/back_from_canada_archcon.html
>>>>
>>>> this page shows fine, i see the entry i wanted to see,
>>>> but the $base_url is now the current page +'/', so the link to
>>>> take me home points to
>>>> http://localhost/back_from_canada_archcon.html/ which, btw, shows
>>>> the home page So I can go to
>>>> http://localhost/back_from_canada_archcon.html/, and click on any
>>>> entry to see it, say:
>>>> http://localhost/back_from_canada_archcon.html/arch_linux_interview_and_uzbl_article.html
>>>> when I'm there, the $base_url is again
>>>> http://localhost/back_from_canada_archcon.html/
>>>>
>>>> To be sure, i disabled all plugins (and restarted the webserver)
>>>> but the issue stays the same.
>>>>
>>>>
>>>> Another thing, which is probably related: if i have enabled the
>>>> tags plugin (took the latest one from git)
>>>> and I am at http://localhost, then click on a tag-link, say:
>>>> http://localhost/tag/foss
>>>> it says:
>>>> "The page you are looking for is not available
>>>> Somehow I cannot find the page you want." and $base_url is now
>>>> http://localhost/tag/
>>>>
>>>> I know I can define $base_url in config.py, but I don't see why
>>>> that should be needed, since my webserver does not do anything
>>>> fancy like url rewriting, pyblosxom should be able to get the
>>>> correct base_url by itself right?
>>>>
>>>> so I checked the code, more specifically class PyBlosxom ,
>>>> function initialize(), where I see SCRIPT_NAME from the http
>>>> environment is stored in the base_url.
>>>>
>>>> And SCRIPT_NAME, when visiting
>>>> http://localhost/back_from_canada_archcon.html
>>>> is:
>>>> /back_from_canada_archcon.html/
>>>>
>>>> Is this normal? I couldn't immediately figure out what the
>>>> SCRIPT_NAME is supposed to be. Is this a bug with my webserver or
>>>> my setup? (I use lighttpd 1.4.28, my config is at
>>>> http://sprunge.us/JCCO, the fastcgi script is at
>>>> http://github.com/Dieterbe/dieterblog/blob/manageable/fcgi.py)
>>>>
>>>> Thanks,
>>>> Dieter

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
Reply | Threaded
Open this post in threaded view
|

Re: base url includes SCRIPT_NAME, which contains too much stuff

Dieter Plaetinck
On Sun, 07 Nov 2010 09:59:07 -0500
will kahn-greene <[hidden email]> wrote:

> You need to set the base_url config.py variable:
>
> py["base_url"] = "http://localhost"
>
> http://pyblosxom.bluesock.org/1.5/config_variables.html#base-url

Oh man, i feel silly.
I knew I got it working before, so I had been doing some git
bisect sessions to find where it went wrong, without result.
Turned out it went wrong when I made the typo in my deployment script in
git. (the working version of the config itself was never committed
because that's just mere output of my deploy script)

thanks man.

Dieter

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
pyblosxom-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users