Koozali.org: home of the SME Server

Editing / Creating Templates

grahowler

Editing / Creating Templates
« on: June 23, 2003, 04:27:04 PM »
Hi

I am trying to understand the template editing process. I've read the instructions here: http://www.e-smith.org/custom/ but I still can't seem to get it working.

I am trying to make some changes to httpd.conf to make a file with a ".inc" extension process php. Normally I would just go to httpd.conf and add "AddType application/x-httpd-php4 .inc".

Heres what I've done:

1. mkdir /etc/e-smith/templates-custom/etc/httpd.conf
2. Created a file called "10AddType"
3. Placed "AddType application/x-httpd-php4 .inc" in the file
4. Ran /sbin/e-smith/expand-template /etc/httpd.conf
5. Browsed to a file with a ,inc extension and it is not processing php

What have I done wrong?

Thx in advance!

Dave Liquorice

Re: Editing / Creating Templates
« Reply #1 on: June 23, 2003, 05:31:04 PM »
> 4. Ran /sbin/e-smith/expand-template /etc/httpd.conf

Then checked that /etc/httpd.conf does now actually contain the required line?

> 5. Browsed to a file with a ,inc extension and it is not processing php

",inc" not .inc?

Restarted the webserver?

Cheers
Dave.

grahowler

Re: Editing / Creating Templates
« Reply #2 on: June 24, 2003, 01:58:04 AM »
Thanks for the reply Dave.

> Restarted the webserver?

Yes

> ",inc" not .inc?

Sorry ",inc" was a typo in my post, I definitely used .inc

> Then checked that /etc/httpd.conf does now actually contain the required line?

No /etc/httpd/conf/httpd.conf doesn't contain the required line.

I tried again a little different from last time and here's what I did:

1. Navigated to /etc/e-smith/templates-custom/etc/httpd.conf
2. Edited the file called "10AddType"
3. Placed "AddType application/x-httpd-php .inc" in the file
4. Ran /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
5. Restarted Apache
5. Looked at /etc/httpd/conf/httpd.conf in vi and the line is missing

Obviously I am doing something wrong but I can't figure out what!

Anyway, I appreciate the assistance.

Cheers.

Dave Liquorice

Re: Editing / Creating Templates
« Reply #3 on: June 24, 2003, 03:24:59 AM »
Thought it was typo but best check.  B-)

> No /etc/httpd/conf/httpd.conf doesn't contain the required line.

Thats the problem, how to get it in there...

> I tried again a little different from last time and here's what I did:
>
> 1. Navigated to /etc/e-smith/templates-custom/etc/httpd.conf

As the actual config file resides at /etc/httpd/conf/httpd.conf, I think the custom template fragment should be in:

/etc/e-smith/templates-custom/etc/httpd/conf/http.conf

Note the extra "httpd/conf/"...

> 2. Edited the file called "10AddType"

In my 5.6u4 box all the addtype stuff is 75AddType... With 75AddType00 containing example fragments of what you are trying to do. I'd copy that file from the /etc/e-smith/templates/etc/httpd/conf/httpd.conf directory to the templates-custom one and edit as you want.

> 3. Placed "AddType application/x-httpd-php .inc" in the file

Looks OK but I'm still on the vertical part of the templates learning curve.  B-)

4. Ran /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

Looks OK again.

grahowler

Re: Editing / Creating Templates
« Reply #4 on: June 24, 2003, 06:36:21 AM »
Yep, that did the trick!

Thanks a million Dave.

Of course the directory structure needed to be the same, it seems obvious now.

I am using 5.5 and the /etc/e-smith/templates/etc/httpd/conf/httpd.conf directory didn't contain a 75AddType00 file. So I didn't copy any across but I created one and called it 75AddTypeCustomMIME00 and that worked. I don't understand the relevanceof 75SomeFileName... or 90SomeFileName... fo you know where the relevant documentation is for that?

I am right wiht you on the learning curve thing, in fact a little behind you!

Anyway, I appreciate the help :o)

Dave Liquorice

Re: Editing / Creating Templates
« Reply #5 on: June 25, 2003, 12:48:35 AM »
> I don't understand the relevanceof 75SomeFileName... or
> 90SomeFileName...

It controls the order in which the items are processed.

>  fo you know where the relevant documentation  is for that?

There is some documentation about the templates system here but when I looked at it when first playing with SME it just made the headache worse. I must revisit it now that I have some grasp at what is going on.

>  I am right wiht you on the learning curve thing, in fact a little
> behind you!

Here, grab this rope but don't pull to hard I might fall off!  B-)

Cheers
Dave.