Koozali.org: home of the SME Server

Is it possible to enable register_globals just for a single

Offline Tillebeck

  • ****
  • 76
  • +0/-0
Is it possible to enable register_globals just for a single
« on: January 16, 2007, 02:50:16 PM »
I know there are many good posts on how to enable register_globals. But it seems to be so it is enabled or disabled for the entire server.
e.g. http://forums.contribs.org/index.php?topic=33895.0

Is it possible to do the same but only for a single ibay? This way the server would not so easily be vulnarable if some software in another ibay would harmfull when register globals set to enabled.

Also... I need to add some custom lines to the httpd.conf but only for a single ibay. Any suggestion on how to accomplish that using a custom template?

BR. Anders

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Is it possible to enable register_globals just for a single
« Reply #1 on: January 16, 2007, 04:11:03 PM »
Code: [Select]
db accounts setprop ibayname PHPRegisterGlobals enabled
expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/rc7.d/S86httpd-e-smith restart
Regards,
William

IF I give advise.. It's only if it was me....

Offline Tillebeck

  • ****
  • 76
  • +0/-0
Is it possible to enable register_globals just for a single
« Reply #2 on: January 17, 2007, 02:11:19 PM »
Hi William

Thanks you for your reply. That was what I was searching for :-)

BR. Anders

Offline Tillebeck

  • ****
  • 76
  • +0/-0
Is it possible to enable register_globals just for a single
« Reply #3 on: January 17, 2007, 02:30:00 PM »
William... it seems like you are fairly well into the configurations parts of the SME Server.

I hope you can answer this tricky question:
My programmer tells me to add these lines to the httpd.conf for two domains/urls pointing to the same ibay:
Code: [Select]
RewriteRule ^/(shop).?([a-z0-9_]*).?([0-9]*).?([0-9]*).?([0-9]*)$ /home/e-smith/files/ibays/mercator/html/index.php?mod=shop&op=$2&category_id=$3&parent_id=$4&article_id=$5 [NC]
RewriteRule ^/(author|topic|title|year|magazine)[\.|/]?([a-z0-9_]*)[\.|/]?([a-z0-9_]*)[\.|/]?$ /home/e-smith/files/ibays/mercator/html/index.php?mod=shop&op=list&type=$1&list=$2&page=$3 [NC]
RewriteRule ^/(search).?$ /home/e-smith/files/ibays/mercator/html/index.php?mod=search [NC]
RewriteRule ^/(show)[\.|/]?([a-z0-9_]*)[\.|/]?([a-z0-9_]*)[\.|/]?$ /home/e-smith/files/ibays/mercator/html/index.php?mod=shop&op=show&type=$2&id=$3 [NC]
RewriteRule ^/(page)[\.|/]?([0-9_]*)[\.|/]?$ /home/e-smith/files/ibays/mercator/html/index.php?mod=main&top=0&parent=0&id=$2 [NC]


As it is now I keep adding them manually and the SME - of cause - delete them again almost as fast. Can you just in broad terms guide me on how to add them permanently using the template system?

Thanks in advance,
Anders

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Is it possible to enable register_globals just for a single
« Reply #4 on: January 17, 2007, 02:58:38 PM »
Sorry. Don't know straight up.

Probably have to make a custom template from one of the ones in /etc/e-smith/templates/etc/httpd/conf/httpd.conf and copy it into /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf


Does your code do what it is suppose to do? I think httpd.conf only get written over at reboot. Not sure if just restarting httpd will.

/etc/rc.d/rc7.d/S86httpd-e-smith restart
Regards,
William

IF I give advise.. It's only if it was me....

Offline Tillebeck

  • ****
  • 76
  • +0/-0
Is it possible to enable register_globals just for a single
« Reply #5 on: January 17, 2007, 03:23:40 PM »
Yes, the site is running smothly while the code is in the httpd.conf. But it is only needed to be inserted two places in the httpd.conf and not within each configuration blok for each of the domain on the server

So I guess I have to add some code in a template saying:
  if domain==myDomain insert these lines
  else do nothing.

I will post any findings here.

Thanks for your time :-)
Anders

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Is it possible to enable register_globals just for a single
« Reply #6 on: January 18, 2007, 02:28:49 PM »
Usually web applications don't go into ibays.

Install something like phpmyadmin and see how the files are put in /opt and there is a custom template under httpd.conf to make it work.
Regards,
William

IF I give advise.. It's only if it was me....