Koozali.org: home of the SME Server

Help whit default mod_rewrite and php config

allo888

Help whit default mod_rewrite and php config
« on: December 17, 2006, 10:21:38 PM »
hello everyone,

i am trying to set up SME for a small school because its easy for them to maintain afterbut i have 2 problemes:

1) how do i change the defaut mod_rewrite rules ? i am trying to set-up moodle in their primary ibay but by default SME was a rewrite rule for the /files dir that is conflicting whit moodle. If i remouve the line in httpd.conf everything work fine but as soon as i restart the machine this line get re-writen. i have looked into the templates for httpd.conf but i cant seam to find the right file to modify.

2) as of 1.6 moodle must dl the diffrent languages file after the install but when i go to the language installation tool i get an error. basicly it cannot connect to the site to get the file list. On the moodle forum i have found other user whit the same issues but no sollution except that pepole said it was an over zelous php configuration that was the cause but since it was a discussion about share hosting the never said how to fix it and just sugested to mouve to a more reasonable hosting corp. I have looked at the php.ini file but i dont know what is causing this ???


again any help is appreciated

thanks  :D

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Help whit default mod_rewrite and php config
« Reply #1 on: December 18, 2006, 10:36:02 AM »
Quote from: "allo888"
hello everyone,

i am trying to set up SME for a small school because its easy for them to maintain afterbut i have 2 problemes:

1) how do i change the defaut mod_rewrite rules ? i am trying to set-up moodle in their primary ibay but by default SME was a rewrite rule for the /files dir that is conflicting whit moodle. If i remouve the line in httpd.conf everything work fine but as soon as i restart the machine this line get re-writen. i have looked into the templates for httpd.conf but i cant seam to find the right file to modify.

Have a look at the development guide and especially the section about the configuration templates. You will probably have to modify the ibays section of the httpd template.
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)

allo888

Help whit default mod_rewrite and php config
« Reply #2 on: December 18, 2006, 01:19:38 PM »
yes i saw that and i understand i need to modify a template but which one ???? the only thing i could find is this ( recursive grep in the httpd.conf templates looking for: files)

<Directory /home/e-smith/files/server-resources>
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/cgi-bin>\n";
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/files>\n";
                $OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n";
                    || ("/home/e-smith/files/ibays/" . $ibay->key . "/");


so it dose not look to be the ticket anyone can point me to the right file i need to modify ???????

allo888

Help whit default mod_rewrite and php config
« Reply #3 on: December 18, 2006, 01:19:59 PM »
sorry doble tap

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Help whit default mod_rewrite and php config
« Reply #4 on: December 18, 2006, 05:25:53 PM »
Quote from: "allo888"
yes i saw that and i understand i need to modify a template but which one ???? the only thing i could find is this ( recursive grep in the httpd.conf templates looking for: files)

<Directory /home/e-smith/files/server-resources>
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/cgi-bin>\n";
        $OUT .= "<Directory /home/e-smith/files/ibays/$key/files>\n";
                $OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n";
                    || ("/home/e-smith/files/ibays/" . $ibay->key . "/");


so it dose not look to be the ticket anyone can point me to the right file i need to modify ???????
If you would have read the developer guide it would have stated how to handle the template stuff.

Locate the section that is responsible for the files alias in the /etc-e-smith/templates/etc/httpd/conf folder and copy that to the /etc/e-smith/templates-custom/etc/httpd/conf folder (making the necesarry directory structure in the /etc/e-smith/templates-custom folder just like in the /etc/e-smith/templates folder if it does not exist).

Then make modifications to the template fragment to make your fix and issue the following commands to regenerate the configuration file:
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf verify your changes to the template section made a valid httpd.conf file and to restart the httpd daemon to refelct your changes:
Code: [Select]
/etc/rc7.d/S86httpd-e-smith restart
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)

allo888

Help whit default mod_rewrite and php config
« Reply #5 on: December 19, 2006, 04:48:37 AM »
thats what i did but for the life of me i cannot find wich file to modify   :oops:  like i said i did grep search of all the content and i also try looking at the files but whiout sucess. think that the line i need to find is a mix of what the developpement guide call the text engin (perl in the config) and mod_rewrite syntax so its too cryptic for me and i just dont see it ???

Offline utti

  • *
  • 9
  • +0/-0
    • http://www.mankkaaya.fi
Help whit default mod_rewrite and php config
« Reply #6 on: December 19, 2006, 07:36:54 PM »
Problem 1:    Moodle files and e-smith files ...
My answer is that you change alias files to ffiles and rename ibay path files to ffiles. If I remember right, you find alias files when you go /etc/e-smith/templates/etc/httpd/config/virtuahosts/ .. or so.
There you find several template stuff. One of them handle alias stuff. Change there every alias and path files to ffiles. Expand httpd.conf and reboot system.
That was my answer and it works well !!!

Problem 2: My install process worked without any problem ... because I made files->ffiles before installation.
...

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Help whit default mod_rewrite and php config
« Reply #7 on: December 19, 2006, 10:50:10 PM »
Quote from: "allo888"
thats what i did but for the life of me i cannot find wich file to modify   :oops:  like i said i did grep search of all the content and i also try looking at the files but whiout sucess. think that the line i need to find is a mix of what the developpement guide call the text engin (perl in the config) and mod_rewrite syntax so its too cryptic for me and i just dont see it ???


Issuing the following command
Code: [Select]
grep -iHnR '/files' *in the /etc/e-smith/templates/etc/httpd/conf/httpd.conf folder I find the following references for /files in the templates file:

Code: [Select]
50DocRoot:5:DocumentRoot /home/e-smith/files/ibays/Primary/html
80DenyHTAccess:4:</FilesMatch>
85HordeAccess:23:    </FilesMatch>
85ServerResourcesAccess:3:<Directory /home/e-smith/files/server-resources>
90e-smithAccess40ibays:102:     $OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
90e-smithAccess40ibays:116:         $OUT .= "    </FilesMatch>\n";
90e-smithAccess40ibays:138:     $OUT .= "<Directory /home/e-smith/files/ibays/$key/cgi-bin>\n";
90e-smithAccess40ibays:158:     $OUT .= "<Directory /home/e-smith/files/ibays/$key/files>\n";
95AddType00PHP2ibays:12:                $OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n";
95AddType00PHP2ibays:18:                    || ("/home/e-smith/files/ibays/" . $ibay->key . "/");
VirtualHosts/28SubversionContent:220:                    $OUT .= "        SVNPath /home/e-smith/files/repositories/$key\n";
VirtualHosts/40ServerResources:2:    Alias /server-resources/ /home/e-smith/files/server-resources/
VirtualHosts/20IbayContent:11:    my $basedir = "/home/e-smith/files/ibays/$ibay";
VirtualHosts/20IbayContent:28:    $OUT .= "    Alias       /files   $basedir/files\n";
VirtualHosts/20IbayContent:38:      my $basedir = "/home/e-smith/files/ibays/$key";
VirtualHosts/20IbayContent:59:      $OUT .= "    Alias       /$key/files   $basedir/files\n";


Not all of them are relevant here but the following are (I think):
  • 90e-smithAccess40ibays:158
  • VirtualHosts/20IbayContent:28
  • VirtualHosts/20IbayContent:59
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)