List Info

Thread: Blosxom blog as default page




Blosxom blog as default page
user name
2006-07-04 04:52:44

"Don Zouras&quot; <dzourasicode6.net> writes:

> I have finally setup Blosxom enough in my development environment that I thought I was
> ready to try it out on my site. I moved everything over to the production environment and
> of course it doesn't work. Well, it sort of does.
>;
> If I go here, I see what I expect:
&gt; http://www.icode6.net/cgi-bin/blosxom.cgi
>
&gt; But what I really want is to go here and see the same thing:
&gt; http://www.icode6.net/native_suburbia/
> (You can see the page that I am looking to replace.)
>
> I thought that the solution was changing httpd.conf so that the DirectoryIndex line
> included index.cgi in front of index.html
> I created a symbolic link to blosxom.cgi in the native_suburbia directory and called it
> index.cgi
> This didn't work, but you can see the blosxom.cgi if you do this:
>; http://www.icode6.net/native_suburbia/index.cgi
&gt;
> I am serving this with Apache on a Mac, so I have full access to change whatever I need to.
>
> Has anyone done an installation like this?
>;
> Any hints greatly appreciated.

It's been a long time since I set this up, but for apache 1.3 setting
ScriptAlias looks like a 'good enough' solution:

ScriptAlias /psi/pub /var/www/varg.dyndns.org/blosxom.cgi

That's for http://varg.dyndns.org/psi, and /psi is redirect to /psi/pub (isn't
necessary, you could make /native_suburbia the scriptalias).

--
Psi -- <http://www.iki.fi/pasi.savolainen>

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-04 19:53:36


On Jul 3, 2006, at 11:52 PM, Pasi Savolainen wrote:

>
> It's been a long time since I set this up, but for apache 1.3 setting
&gt; ScriptAlias looks like a 'good enough' solution:
>
> ScriptAlias /psi/pub /var/www/varg.dyndns.org/blosxom.cgi
>;
> That's for http://varg.dyndns.org/psi, and /psi is redirect to /psi/
> pub (isn't
&gt; necessary, you could make /native_suburbia the scriptalias).
>

Thanks for the hint Pasi.

I tried the ScriptAlias as suggested and it does indeed bring up some
form of the main blog page when I go to www.icode6.net/
native_suburbia, but unfortunately it breaks everything else. It
doesn't find the stylesheet that defines the layout. And it can no
longer find any static pages that may exist under www.icode6.net/
native_suburbia. It instead tries to pass requests for those pages
to blosxom which does something silly with it. The ScriptAlias
directive is apparently changing the meaning of /native_suburbia

This is breaking new ground with Apache for me. Apple made it too
easy for me to setup the server without really understanding
everything. And there is more to my site than just the blog, so I
have to be careful not to break anything else.

To give you a better picture of what I am working with...

My site is located at:
/library/webserver/documents/native_suburbia

It contains the following directories:
./about
./blog
./contact_info
./digging_deeper
./identify
./images
./invasives
./jalbum_templates
./pictures
./resources
./stylesheets

And currently contains an index.html which it was defaulting to as
the main Native Suburbia page.

The blog is at:
/library/webserver/documents/native_suburbia/blog

It contains:
./blog/comments
./blog/images
./blog/native_suburbia
./blog/offshoots
./blog/ruminations
./blog/technical

So as we follow this long winded path of my problem, we come to this...

When I go to www.icode6.net/native_suburbia, I get the main blog page
(minus stylesheet). If I click on a category like "ruminations&quot;, I
get an URL like: http://www.icode6.net/native_suburbia/ruminations/
and it does show the ruminations entries... even though there is no
directory under native_suburbia called ruminations. It is actually
native_suburbia/blog/ruminations.

If I click on one of the menu entries, for instance "resources", it
tries to load:
http://www.icode6.net/native_suburbia/resources/resources.html
Which does exist, but unfortunately, blosxom takes a shot at
processing it and gives me a blank story page.

I have left my production site in this sorry state in case seeing it
makes the situation any clearer.

Do you think I need to reorganize my directory structure and separate
the blog from the other content? I really like the fact that my URL
is currently www.icode6.net/native_suburbia and all content is under
that, but that also seems to be the problem.

Is there some other form of Apache alias that I should be looking
into? The DirectoryIndex seemed promising, although it didn't work
at all, compared to ScriptAlias.

I know this isn't an Apache support group, but it is nice to see
generous people willing to read the problems of Blosxom newbies and
offer suggestions.

-Don

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-04 20:37:57

In message <31344747-174F-4350-818D-BCE7C84C4A01icode6.net>, Donald M.
Zouras II <dzourasicode6.net> writes

>On Jul 3, 2006, at 11:52 PM, Pasi Savolainen wrote:

>> It's been a long time since I set this up, but for apache 1.3 setting
&gt;> ScriptAlias looks like a 'good enough' solution:

>> ScriptAlias /psi/pub /var/www/varg.dyndns.org/blosxom.cgi

&gt;> That's for http://varg.dyndns.org/psi, and /psi is redirect to /psi/
>;> pub (isn't
&gt;> necessary, you could make /native_suburbia the scriptalias).

>;Thanks for the hint Pasi.

I used mod_rewrite rather than scriptalias

In my top level directory I have a file called .htaccess, which contains
the following segment:

#
# switch on rewrite for blog and wiki
RewriteEngine on
# NEW without the PHP wrapper for the news blog...
RewriteRule ^news$ /cgi-bin/blosxom.cgi
RewriteRule ^news/(.*) /cgi-bin/blosxom.cgi/$1
# Disguise the wiki...

(You could put this in your httpd.conf if you have access to your apache
directories - I don't, so I use .htaccess instead)

What this does is allow me to keep blosxom in my cgi-bin, but access it
by http://www.mydomain.net/news - and the second line allows me to take
any "directories&quot; stuck on - like http://www.mydomain.net/news/2006/05
or whatever, and pass them on, too.

Hope this helps

Steve
--
Steve Glover, Fell Services Ltd.
Home: steve at fell-services dot net, 0131 551 3835
Away: steve.glover at ukonline dor co dot uk, 07961 446 902

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-04 23:03:38


On Jul 4, 2006, at 12:53 PM, Donald M. Zouras II wrote:

>
> On Jul 3, 2006, at 11:52 PM, Pasi Savolainen wrote:
&gt;
>>;
>> It's been a long time since I set this up, but for apache 1.3 setting
&gt;> ScriptAlias looks like a 'good enough' solution:
>>
>> ScriptAlias /psi/pub /var/www/varg.dyndns.org/blosxom.cgi
>;>
>> That's for http://varg.dyndns.org/psi, and /psi is redirect to /psi/
>;> pub (isn't
&gt;> necessary, you could make /native_suburbia the scriptalias).
>&gt;
>
>
> Thanks for the hint Pasi.
>;
> I tried the ScriptAlias as suggested and it does indeed bring up some
> form of the main blog page when I go to www.icode6.net/
> native_suburbia, but unfortunately it breaks everything else. It
> doesn't find the stylesheet that defines the layout. And it can no
> longer find any static pages that may exist under www.icode6.net/
> native_suburbia. It instead tries to pass requests for those pages
>; to blosxom which does something silly with it. The ScriptAlias
> directive is apparently changing the meaning of /native_suburbia

Yes, that is exactly what it does. It instructs Apache to treat every
request under that location as a call to the specified script.

The mod_rewrite suggestion of another person is closer to what you
want, but also universally rewrites everything under /native_suburbia
to call blosxom. Because you have non-blog static content that you
want served up, you'll need rewrite rules like this:

Options +FollowSymLinks +ExecCGI

RewriteEngine on
RewriteBase /native_suburbia

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ blosxom.cgi/$1 [L,QSA]

in native_suburbia/.htaccess.

This tell apache that for any request under that directory that doesn't
correspond to an existing file or directory, call blosxom.cgi instead.
(You might need to adjust the path to blosxom.)

-kevin

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-06 02:56:37

Kevin,

This looks logical, but I must be missing some detail. I'll type in
the steps in dummy level detail (because that is what I apparently
need) and I would appreciate a proofreading. Maybe this thread will
help someone else in the future.

1. create file /library/webserver/documents/native_suburbia/.htaccess

2. make sure it is readable; chmod 644

3. check the path of blosxom.cgi
Mine is at /library/webserver/cgi-executables/blosxom.cgi
(Not sure if it is relevant, but there is a ScriptAlias entry in
httpd.conf that makes cgi-bin the preferred way of referencing that
directory.)

4. Put the following in the .htaccess file:
Options +FollowSymLinks +ExecCGI

RewriteEngine on
RewriteBase /native_suburbia

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ blosxom.cgi/$1 [L,QSA]

4. access website at http://www.icode6.net/native_suburbia
Blog should appear as default page

BUT... it doesn't. Instead I get a nice listing of the files in /
library/webserver/documents/native_suburbia

My initial conclusions were that either mod_rewrite is not executing
or I have the path to blosxom.cgi wrong.

After a many hours of reading and trying MANY different guesses, I
still cannot get this thing to work. Well, it does work if you type
in http://www.icode6.net/native_suburbia/../cgi-bin/blosxom.cgi
But of course that is not pretty.

I tried to better understand mod_rewrite by reading the docs.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

I did learn that "L&quot; stands for LAST RULE and QSA= Query String Append

I understand that the rule is actually matched first and then the
Rewrite conditions are evaluated to determine if the rewrite will be
used.

(Just thought I would show that I have been trying to work on this
problem on my own as well.)

I have tried every different path I can think of for blosxom.cgi in
that RewriteRule.
Where would blosxom.cgi be in the example given in the previous
post? (Would it need to be in /library/webserver/documents/
native_suburbia?)
How would I specify that rule when it is in /library/webserver/cgi-
executables/blosxom.cgi?

I tried adding something to my .htaccess to get some debug information:
RewriteLog /library/webserver/documents/rewrite_debug.log
RewriteLogLevel 9

No log was created. Is mod_rewrite not functioning at all? How can
I tell? Is there something in my httpd.conf that is not set right?

I am really stuck. Thanks for your patience.

-Don

On Jul 4, 2006, at 6:03 PM, Kevin Scaldeferri wrote:
&gt;
>
&gt; The mod_rewrite suggestion of another person is closer to what you
> want, but also universally rewrites everything under /native_suburbia
>; to call blosxom. Because you have non-blog static content that you
> want served up, you'll need rewrite rules like this:
>;
> Options +FollowSymLinks +ExecCGI
>
&gt; RewriteEngine on
> RewriteBase /native_suburbia
>;
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^(.*)$ blosxom.cgi/$1 [L,QSA]
&gt;
> in native_suburbia/.htaccess.
>;
> This tell apache that for any request under that directory that
> doesn't
&gt; correspond to an existing file or directory, call blosxom.cgi instead.
> (You might need to adjust the path to blosxom.)
>

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-06 08:14:56

> No log was created. Is mod_rewrite not functioning at all? How can
> I tell? Is there something in my httpd.conf that is not set right?
Just a wild guess, perhaps this is not possible from within htaccess? (or
actually, not allowed? There should be an AllowOverride <something> somewhere
that allows rewriting in htaccess. Not sure what something would be, but
";All" should do for debugging. Another way to check this is to put the Rewrite
directives in your httpd.conf instead (though you need to rethink them a
little I guess).

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-06 17:32:45


On Jul 5, 2006, at 7:56 PM, Donald M. Zouras II wrote:
&gt;
> 4. Put the following in the .htaccess file:
>; Options +FollowSymLinks +ExecCGI
>
&gt; RewriteEngine on
> RewriteBase /native_suburbia
>;
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^(.*)$ blosxom.cgi/$1 [L,QSA]
&gt;
>
> 4. access website at http://www.icode6.net/native_suburbia
&gt; Blog should appear as default page
>
>
>; BUT... it doesn't. Instead I get a nice listing of the files in /
> library/webserver/documents/native_suburbia
>

Ah, right... you're trying to do something a little different from me.
(I'm running a "hybrid-mode&quot; installation where the directory pages are
statically generated, so I always have an index.html in each
directory.)

Try taking out the line:

&gt; RewriteCond %{REQUEST_FILENAME} !-d

and see if it works.

>
> My initial conclusions were that either mod_rewrite is not executing
> or I have the path to blosxom.cgi wrong.

Yeah, you almost certainly need to add the appropriate path before
blosxom.cgi.

>;
> I tried adding something to my .htaccess to get some debug information:
> RewriteLog /library/webserver/documents/rewrite_debug.log
>; RewriteLogLevel 9
>
&gt; No log was created. Is mod_rewrite not functioning at all? How can
> I tell? Is there something in my httpd.conf that is not set right?
&gt;

Probably the user that Apache is running as (probably www or nobody)
doesn't have write permissions on that directory. I would specify the
rewrite log to be in the same directory as your normal access and error
logs.

-kevin

__._,_.___
.

__,_._,___
Blosxom blog as default page
user name
2006-07-06 23:54:21

Things are looking promising. I am still testing to make sure
everything is working, but I think it's close.

Here is a lesson learned for anyone who is having trouble doing this
on a Mac using the default Apache install...

If you intend to use .htaccess and mod_rewrite, you will also need to
change the following in /private/etc/httpd/httpd.conf:

# This controls which options the .htaccess files in directories can
# override. Can also be "All&quot;, or any combination of "Options",
"FileInfo";,
# "AuthConfig";, and "Limit"
#
AllowOverride None

Change the None to All in order to allow rewrite rules in .htaccess
files.

And in order to help debug you can add the following to your httpd.conf:
RewriteLog /private/var/log/httpd/rewrite_debug.log
RewriteLogLevel 9

Being able to see the details of what mod_rewrite was doing helped me
greatly in understanding what it was doing with my requests and how I
needed to fix the rewriterule.
Be sure to take/comment out the logging when you have everything
working in order to avoid the unnecessary overhead.

Isn't it refreshing to see a post from me that isn't full of
whining?

Back to refining my website...

On Jul 6, 2006, at 12:32 PM, Kevin Scaldeferri wrote:

>
> Ah, right... you're trying to do something a little different from me.
> (I'm running a "hybrid-mode&quot; installation where the directory pages
> are
> statically generated, so I always have an index.html in each
> directory.)
>
&gt; Try taking out the line:
>;
>> RewriteCond %{REQUEST_FILENAME} !-d
>
> and see if it works.
&gt;

__._,_.___
.

__,_._,___
[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )