Koozali.org: home of the SME Server

httpd.conf template issue

Offline clm314159

  • *
  • 13
  • +0/-0
httpd.conf template issue
« on: October 31, 2010, 02:37:59 AM »
I have an SME Server 7.5.1 install with PHP5 installed.

I have recently started to learn about the template system in SME and have a fair understanding of how it works but I have run into a problem that I need help with.

I have a system that is hosting multiple websites using the mediawiki CMS (and other CMSs). I have set up these sites in ibays manually by copying the files for mediawiki into the HTML folder and configuring the site/db accordingly. Recently I have decided to configure some of these sites to use pretty (short) URLs. To do this I have found a set of directions to follow on this page:

http://www.mediawiki.org/wiki/Manual:Short_URL.

It says to make changes to the httpd.conf file which is produced by the template system. Specifically I need to add an alias line to the site that is getting the pretty URLs. When I look at the template fragment for that section I see a script that is querying the db and generating a set of alias lines based on the ibays present. So, my question is where does my alias line need to go? There are multiple sections of alias lines delimited with lines such as: <VirtualHost 0.0.0.0:443> (an IP with all 0s and port 80 or 443). Also the alias lines are grouped by ibay within these IP:port groupings.  Can my line go anywhere or does it need to be within any grouping? Do I need to insert it into the code or can I just stick it at the end and if I do need to insert it into the code, is this bash and should I use the echo command?

Well that is about 3 ways to ask the same question  8-) so I will stop there.

Thanks,
Chris

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: httpd.conf template issue
« Reply #1 on: October 31, 2010, 10:58:54 PM »
Can my line go anywhere or does it need to be within any grouping?
No, take a look at the templates tree and see that the fragments are ordered by number as well as per VirtualHost section.

Do I need to insert it into the code or can I just stick it at the end and if I do need to insert it into the code, is this bash and should I use the echo command?
Never add to original template fragments, always make a copy in the templates-custom tree (maintaining the relative path as compared to templates/) and add your additions in this fragment. That way your changes will survive updates and configuration changes.

Well that is about 3 ways to ask the same question  8-) so I will stop there.
Yes, most of them should have been clear if you read the information on the template system as you said you did. :-)

IIRC you can create a directory inside the VirtualHost folder with the original fragments from the VirtualHosts folder, after modifying the template fragments to your needs you can then alter the configuration of the (virtual) domain to make it use a different template directory:
Code: [Select]
db accounts ibay setprop TemplatePath name-of-your-folder-holding-the-modified-templates
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline clm314159

  • *
  • 13
  • +0/-0
Re: httpd.conf template issue
« Reply #2 on: November 03, 2010, 12:39:16 AM »
Ok, first, thanks for responding. Second I need to clarify some things. After reading your response and rereading my post I can see that I did not do a good job of conveying my question to you.

So I will start by specifying what I do know about the template system. I have successfully worked through the tutorial on making changes to config files. I modified the PHP config file. I know about making new fragments in the file structure and placing files there so that they do not get changed during an upgrade. When I was asking about where to place the alias line, I was refering to where in the httpd.conf file itself. This is what caused the confusion.

I have taken a look at the files that you mention and all of them contain script that accesses the db. Is this script Bash? Do I need to modify the code itself or can I insert the alias line into the db and have it generated at the same time as the rest of the alias lines?

I am afraid that I did not follow your solution. Will this cause the alias lines for this ibay to be copied in from the other file? It seems to me that this must be wrong since the custom-template tree would do this already.

Sorry for the confusion...