Koozali.org: home of the SME Server

Question regarding custom-templates and httpd.conf

Gman

Question regarding custom-templates and httpd.conf
« on: August 21, 2002, 08:46:14 AM »
After reading for several hours tonight, I think I may need some help.  When I create a "VirtualHost" and new IBay it places the DocumentRoot like this on the server:

www.somedomain.com/new_directory

What I want to do is simple, I know how to do it via any standard httpd.conf file.  However since moving over to e-smith, I am having some problems and would like some guidance.  (like I stated above, I have searched the archives for about 4 hours this evening - words searched on "custom-templates httpd.conf" and so on)

I want to have multiple sites running on e-smith, I want them to run as this:

www.somedomain1.com
www.somedomain2.com
www.somedomain3.com

I need to have the "DocumentRoot" point back to the correct location from within the httpd.conf file.

So is this how I do it ?

#   Step 1  #

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

#   Step 2   #

#This is where I get hung up at ?  

pico "some file", it states to add a number to it ?, like "81VirtualHosts", I think.  What file do I create ?  What is the name of it ?

#   Step 3   #

#Add the text to the file:

##################

   ServerName   www.somedomain1.com
   DocumentRoot   /home/e-smith/files/ibays/somedoamin1/html
   ErrorLog                   /home/e-smith/files/ibays/somedomain1/error_log
   CustomLog   /home/e-smith/files/ibays/somedomain1/access.log combined


    Options None
    AllowOverride None
    order deny,allow
    deny from all
    allow from none



##########################

#   Step 3   #

#Run
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

What do I not get ?  Am I completely lost ?

Thanks for any help and not laughing !

G

gman_at_accelerus.com

Bill Talcott

Re: Question regarding custom-templates and httpd.conf
« Reply #1 on: August 21, 2002, 08:08:57 PM »
If you haven't yet, look in /etc/e-smith/templates/etc/httpd/conf/httpd.conf (the original e-smith templates for that file). You want to create a custom fragment with the virtual host info. It looks like the stuff at 80 is Aliases, so 81 looks like a good place to stick in virtual host info. It really doesn't matter what the file is called. When you expand the template, it will just go through the e-smith template dir and your custom template dir, and create a new httpd.conf using whatever fragments are there.

gman

Re: Question regarding custom-templates and httpd.conf
« Reply #2 on: August 21, 2002, 10:52:06 PM »
First off - Thank you for taking the time to answer !

Yes, I have been through what appears to be the "real" httpd.conf file.  That's why I got scared.  I'll give it a try.  Second question ?  For every VirtualHost I create (new domain), can I just add (append) it to the first file I created ?  Or do I have to keep adding files like: 81VirtualHost, 82VirtualHost, 83VirtualHost ?

This sounds pretty simple, I just don't want to mess up the httpd.conf file.

Thanks again !

G

PS. Is there a help file/achive somewhere on "Template Fragments"

Charlie Brady

Re: Question regarding custom-templates and httpd.conf
« Reply #3 on: August 21, 2002, 11:30:26 PM »
Gman wrote:

> I want to have multiple sites running on e-smith, I want them
> to run as this:
>
> www.somedomain1.com
> www.somedomain2.com
> www.somedomain3.com

That's exactly what you should get.  Does it not work? If not, what exactly doesn't work?

Charlie

gman

Re: Question regarding custom-templates and httpd.conf
« Reply #4 on: August 23, 2002, 12:31:21 AM »
I guess I was just confused.  According to the 5.5 documentation, it places "IBays" like this:  "www.somedomain.com/somedomain1".  That's why I was asking how to place the RootDocument to a different directory path.  I did build and add a few domains last night and YES - Charlie, it does work as you described.

I know I have a lot of learning to do with this slick product..  

Thanks for everybodys comments and help !

Thanks again !

G