Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Feature Requests

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 17th October 2006, 20:17
PSIplus PSIplus is offline
Junior Member
 
Join Date: Oct 2006
Location: Vienna/Austria
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to PSIplus Send a message via AIM to PSIplus Send a message via Yahoo to PSIplus Send a message via Skype™ to PSIplus
Exclamation

However... Are there any plans to ship it with future releases? And can I help?
__________________
PSIplus' Site
Reply With Quote
Sponsored Links
  #12  
Old 19th October 2006, 09:27
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,777
Thanks: 821
Thanked 5,332 Times in 4,184 Posts
Default

Quote:
Originally Posted by PSIplus
However... Are there any plans to ship it with future releases?
yes.

Quote:
And can I help?
yes Please register as ISPConfig developer to get SVN write access to the latest ISPConfig dev releases.

http://server1.howtoforge.com/forums...read.php?t=135
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #13  
Old 7th November 2006, 23:37
jeremyh jeremyh is offline
Junior Member
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lighttpd Config Parser

A while ago I started writing a config parser for Lighttpd in PHP. It's been a while since I've worked on it, and is read-only. But it could be a good base if you need a full parser.

http://svn.jeremyh.net/r/LighttpdParser
Reply With Quote
  #14  
Old 17th November 2006, 08:35
jameso jameso is offline
Member
 
Join Date: Nov 2006
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Default

Well, I am totally new to ISPConfig.

I managed to install it, and also use your instructions for using lighttpd instead of apache.

Everything seems ok so far, however I need to test things a lot more.

Thanks for the useful info PSIplus!
Reply With Quote
  #15  
Old 4th March 2007, 15:30
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

wow. I'd love to see this in a more stable version, but I have to wait until edge comes out, make that upgrade and then I'll check back to see how far this project has proceeded...
Reply With Quote
  #16  
Old 5th March 2007, 13:20
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

@PSIplus

can you give me a hand with a similar problem?
I would like to manually compile and install lighttpd on my debian box, have it lsitening on a different port i.e. 88 and import the vhosts from apache.

I plan on using mod_proxy on my apache2 so apache2 will stay the default webserver BUT have it forward static content to lighttpd (I have figured out the forwarding part, but need help with the compilation on debian (running 3.1)

If this works out I'd like to also use lighttpd for ruby on rails

can you help? I could open another thread? or you could send me a pm or whatever :-)
Reply With Quote
  #17  
Old 10th April 2007, 06:11
jlp09550 jlp09550 is offline
Junior Member
 
Join Date: Apr 2007
Location: Louisiana
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via AIM to jlp09550 Send a message via MSN to jlp09550 Send a message via Yahoo to jlp09550
Default

Thanks for the guide.. but can someone please convert it to an easier-to-read format? It's really hard to read what the guide says, muchless properly do it.

Thanks.
Reply With Quote
  #18  
Old 13th May 2007, 17:59
justdave justdave is offline
Junior Member
 
Join Date: May 2007
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
Smile I'd love to see this too...

Hey guys I'd love to see ISPConfig have built in handling for lighttpd. I would be willing to donate some money towards making this a reality. I also know of one other person that would do the same.

If there are others here using Lighty perhaps we can all chip in?
Reply With Quote
  #19  
Old 5th July 2007, 12:13
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 259 Times in 206 Posts
Default

PSIplus, thanks for the great script

As lighttp does not recognize .htaccess files I ran into problems migrating to lighttp.
I extended your script so it now has a (very) rudimentary support for htaccess.

first I changed the modules section to include mod_auth and mod_rewrite
Code:
echo "server.modules=(\"mod_auth\",\"mod_access\",\"mod_cgi\",\"mod_accesslog\",\"mod_fastcgi\",\"mod_ssi\",\"mod_alias\",\"mod_rewrite\")\n";
then I added function calls to the end of the script

Code:
...

    echo "\n\t## Error-Handling ##\n";
    echo "\talias.url=(\"/error/\"=>\"$docroot/$prefix_web$parm[id]/web/error/\")\n";
    if($parm["error"])
    {
        /*
        ErrorDocument 400 /error/invalidSyntax.html
        ErrorDocument 401 /error/authorizationRequired.html
        ErrorDocument 403 /error/forbidden.html
        ErrorDocument 404 /error/fileNotFound.html
        ErrorDocument 405 /error/methodNotAllowed.html
        ErrorDocument 500 /error/internalServerError.html
        ErrorDocument 503 /error/overloaded.html
        AliasMatch ^/~([^/]+)(/(.*))? /var/www/web12/user/$1/web/$3
        AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web12/user/$1/web/$3
        */
    }
    // search for .htaccess files and prevent direct access
    echo "\n\turl.access-deny = ( \".htaccess\", \".htpasswd\")\n";
    list($data, $rewdata) = recurse_htaccess("", "$docroot/$prefix_web$parm[id]/web");
    
    echo $data;
    echo $rewdata;

    echo "}\n\n";
...

finally I added my new functions to the end of the script

Code:
function recurse_htaccess($curdir, $basedir) {
    $dir = opendir($basedir . $curdir);
    
    $data = "";
    $rewdata = "";
    
    while (false !== ($file = readdir($dir))) {
        if ($file != "." && $file != "..") {
            if(is_dir($basedir . $curdir . "/" . $file)) {
                list($ndata, $rdata) = recurse_htaccess($curdir . "/" . $file, $basedir);
                $data .= $ndata;
                $rewdata .= $rdata;
            } elseif($file == ".htaccess") {
                list($ndata, $rdata) = get_htaccess($curdir . "/" . $file, $basedir);
                $data .= $ndata;
                $rewdata .= $rdata;
            }
        }
    }
    
    return array($data, $rewdata);
}

function get_htaccess($file, $basedir) {
    $data = "";
    
    $rewexp = array();
    
    $fpath = $basedir . $file;
    $file = str_replace(".htaccess", "", $file);

    $fp = fopen($fpath, "r");
    if(!$fp) return "";

    if(!file_exists($fpath)) return "";

    $lines = file($fpath);
    if(!is_array($lines) || count($lines) < 1) return "";

    $match = false;
    $data = "";
    $data .= "\t\$HTTP[\"url\"] =~ \"^$file\" {\n";
    $data .= "\t\tauth.backend = \"htpasswd\"\n";
    
    $rewbase = "";
    
    $reqdata = "\"$file\" => (\n";
    // method / realm / require...
    $first = true;
    foreach($lines as $line) {
        if(preg_match("'authtype\s+(\w+)'is", $line, $matches)) {
            $match = true;
            if(!$first) $reqdata .= ",\n";
            $reqdata .= "\t\t\t\"method\" => \"" . strtolower(trim($matches[1])) . "\"";
        } elseif(preg_match("'authname\s+\"?([^\"]+)\"?'is", $line, $matches)) {
            $match = true;
            if(!$first) $reqdata .= ",\n";
            $reqdata .= "\t\t\t\"realm\" => \"" . trim($matches[1]) . "\"";
        } elseif(preg_match("'require\s+\"?([^\"]+)\"?'is", $line, $matches)) {
            $match = true;
            if(!$first) $reqdata .= ",\n";
            $reqdata .= "\t\t\t\"require\" => \"" . trim($matches[1]) . "\"";
        } elseif(preg_match("'authuserfile\s+\"?([^\"]+)\"?'is", $line, $matches)) {
            $match = true;
            if(trim($matches[1]) != "") $data .= "\t\tauth.backend.htpasswd.userfile = \"" . trim($matches[1]) . "\"\n";
        } elseif(preg_match("'rewritebase\s+(\S+)'is", $line, $matches)) {
            $rewbase = trim($matches[1]);
        } elseif(preg_match("'rewriterule\s+(\S+)\s+(\S+)'is", $line, $matches)) {
            $srch = trim($matches[1]);
            $rewexp["$srch"] = trim($matches[2]);
        }
        
        $first = false;
    }
    $data .= "\t\tauth.require = ( ";
    $data .= $reqdata . ")\n\t\t)\n";
    $data .= "\t}\n";
    if($match == false) $data = ""; // reset it

    $rewdata = "";

    if(count($rewexp) > 0) {
        $rewdata = "\n\turl.rewrite-once = ( ";
        $first = true;
        foreach($rewexp as $search => $replace) {
            if($first == false) $rewdata .= ",";
            if($rewbase != "") {
                $search = preg_replace("'^\^'", "^$rewbase", $search);
            }
            $rewdata .= "\n\t\t\"$search\" => \"$replace\"";
            
            $first = false;
        }
        $rewdata .= ")\n";
    }
    
    

    return array($data, $rewdata);
}
Sorry for the missing code comments... But I had no time for these.

As I said this is VERY basic .htaccess support...
I managed to get all my .htaccess directory access limits running.
My basic rewrite rules are working, too (no rewrite conditions).

Host-based or file-based access limit in .htacess files does not yet work, maybe I'll get this to work later
Reply With Quote
  #20  
Old 25th July 2007, 22:50
Murder4Al Murder4Al is offline
Junior Member
 
Join Date: Apr 2007
Posts: 12
Thanks: 1
Thanked 3 Times in 2 Posts
 
Default

I just started using this script, and discoverd two flaws:
- it doesn't support wildcard domains, something I frequently use
- the .htaccess patch is to slow on big sites (and i mean BIG, over 100k folder really kills the perfornance)

Below is a patched version that adds wildcard support.
The .htaccess patch is included but disabled
I also added a few extra lighttpd options; especially a port parameter, so you can run lighttpt next to your apache2 to test the performance/validy of this script.

(had to rename file to .txt for the forum to accept it)
Attached Files
File Type: txt lighttpd.conf.php.txt (9.9 KB, 732 views)
Reply With Quote
The Following 2 Users Say Thank You to Murder4Al For This Useful Post:
falko (26th July 2007), till (27th July 2007)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR: The PHP binary coming with ISPConfig does not work properly on your system! micko_escalade Installation/Configuration 35 30th March 2007 11:31
ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" Problem with ISPConfig chipw Installation/Configuration 6 30th October 2006 09:38
Problem with BIND and ISPConfigs's DNS Manager Nejko Installation/Configuration 66 22nd April 2006 20:47
setup fails on debian 3.1 dtrumbower Installation/Configuration 7 7th March 2006 13:42
ISPConfig Failure on SuSe 9.3 gimhan90 Installation/Configuration 13 2nd February 2006 10:29


All times are GMT +2. The time now is 04:27.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.