+ Reply to Thread
Results 1 to 4 of 4

Thread: SetEnv equivalent for LiteSpeed?

  1. #1
    Fluent in PHP
    Join Date
    Apr 2008
    Location
    West Vancouver, BC
    Posts
    5

    Question SetEnv equivalent for LiteSpeed?

    Hiya

    Is there a SetEnv equivalent for LiteSpeed? I'd like to specify a variable in my root .htaccess and have it accessible by any script. If someone could point me in the right direction for this, that would be great.

    On the LiteSpeed forums it was suggested to someone that they "create a dedicated lsphp external application for that vhost, then add environment there." I wouldn't even know where to start!

    I suppose I could just use an auto_prepend_file and have the PHP script set the variable there. That wouldn't cause unnecessary overhead, would it?

    -Mango
    Last edited by Mango; 06-09-2008 at 01:28 PM. Reason: Got another idea.

  2. #2
    I love LAMP.
    Join Date
    Jul 2004
    Location
    Chicago, Illinois, United States
    Posts
    201

    Default

    We can't really support creating separate lsphp configurations for different customers due to the number of virtualhosts on these systems. I would imagine a solution that uses PHP directly should be fine until LiteSpeed gets around to implementing SetEnv in their Apache configuration directive handler.
    Kevin Stange
    Chief Technology Officer
    Steadfast Networks
    http://steadfast.net
    kevin@steadfast.net

  3. #3
    Junior Member
    Join Date
    Apr 2007
    Posts
    21

    Default

    You can use mod_rewrite to set environment variables.

    RewriteRule ^(.*) /path/to/file/$1 [E=VAR:VAL]

    RewriteRule ^(.*) /hsphere/local/home/USERNAME/DOMAIN/$1 [E=Name:Magnify]

    Something similar to that, you'd make it match every file, and return that file.

    If your using steadfast's shared hosting, then you'd replace username, and domain to your username, and domain name.

    [E=Name:Magnify]
    Would set the 'Name' variable to 'Magnify'

    You'll probally have to play around with, and read up on mod_rewrite to get it to work correctly, also this approach adds more overhead than using SetEnv.

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Posts
    6

    Default

    Any reason you can't simply store the variable in a php file and include it whenever its needed?
    The Universes - Server Management and PHP/MySQL scripting

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts