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
  #1  
Old 8th October 2006, 09:25
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
Lightbulb lighttpd-Support

Hi! ... Thanx for such a great (and at least secure ;-) ) thing!

I just wanted to ask if you are working on lighttpd-support, because lighttpd is very fast and good configurable...

If you haven't started such a thing yet, I did it (only poorly, but effective...)

It's quite easy but effective:
- I made a PHP-Script to query my ispconfig-vhosts from mysql and return lighttpd configuration directives
- I added the script to my lighty-config (include_shell "/root/ispconfig/patchwork/lighttpd_vhosts.php")

And adapted the config to run under my webserver-user (www-data:www-data) ... Basically, that's it... I currently leave ispconfig and it's components untouched, but i would need to write some stuff that makes makes me .htaccess-files out of the "custom apache parameter" option... But that's not my no1 priority right now...

It would be pretty nice if you would offer something like this built-in, because it is unbeleavable easy, and ispconfig would then support a living alternative to the big big apache... ;-)
Reply With Quote
Sponsored Links
  #2  
Old 8th October 2006, 12:06
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,495
Thanks: 835
Thanked 5,534 Times in 4,352 Posts
Default

That sounds interesting. Maybe you can provide my with you code by email to dev [at] ispconfig [dot] org and I will have a look how we can integrate it in the ISPConfig dev branch.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 8th October 2006, 19:49
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
Default

Nice! ... I'll make a prototype-setup (because my testserver is currently very wasted) and cleanup the code a bit... You'll get the code tonight (CET ;-) ) via mail...
Reply With Quote
  #4  
Old 8th October 2006, 22:24
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
Red face

Soooo... This is, how to do it:

You need the following Script, the location doesn't matter... Currently it is not very advanced but it longs to run ispconfig with lighttpd:

//////// BEGIN /root/ispconfig/custom/lighttpd.conf.php
Code:
#!/usr/bin/php -q
<?

$go_info["server"]["db_host"] = "localhost";
$go_info["server"]["db_name"] = "db_ispconfig";
$go_info["server"]["db_user"] = "root";
$go_info["server"]["db_password"] = "12345";
$go_info["server"]["db_type"] = "mysql";

mysql_pconnect($go_info["server"]["db_host"],$go_info["server"]["db_user"],$go_info["server"]["db_password"]);
mysql_select_db($go_info["server"]["db_name"]);

list($shost,$sdomain,$docroot,$user,$group,$log,$sname)=mysql_fetch_array(mysql_query("select server_host,server_domain,server_path_httpd_root,server_httpd_user,server_httpd_group,server_path_httpd_log,dist_httpd_daemon from isp_server limit 1"));

if($shost)$sdomain="$shost.$sdomain";

echo "server.name=\"$sdomain\"\n";
echo "server.tag=\"ispconfig/lighttpd@$sdomain\"\n";
echo "server.username=\"$user\"\n";
echo "server.groupname=\"$group\"\n";
echo "server.document-root=\"$docroot/sharedip\"\n";
echo "accesslog.filename=\"$log\"\n";

$db_res=mysql_query("select doc_id,web_host,web_domain,web_cgi,optionen_directory_index from isp_isp_web");

$yr=date("Y");
$mn=date("m");

echo "\n\n########## VHOSTS ########\n\n";

/* I should assign the additional domains from isp_isp_domain here as well,
   but right now I don't know how they are assigned... ;-) */

while(list($id,$host,$domain,$cgi,$dirindex)=mysql_fetch_array($db_res))
{
    $vhlist[$domain]=array("id"=>$id,"dirlist"=>true,"cgi"=>$cgi);
    if($host) $vhlist["$host.$domain"]=array("id"=>$id,"dirlist"=>true,"cgi"=>$cgi);
}

reset($vhlist);
while(list($host,$parm)=each($vhlist))
{
    echo "\$HTTP[\"host\"]==\"$host\" {\n";
    echo "\tserver.name=\"$host\"\n";
    echo "\tserver.document-root=\"$docroot/web$parm[id]/web\"\n";
    echo "\t#accesslog.filename=\"/var/log/lighttpd/web$parm[id]-access.log\"\n";
    echo "\taccesslog.filename=\"$docroot/web$parm[id]/log/$yr/$mn/web.log\"\n";
    echo "\tserver.dir-listing=\"".(($parm["dirlist"])?"enable":"disable")."\"\n";
    if($parm["cgi"]) echo "\tcgi.assign=(\n\t\t\".pl\"=>\"/usr/bin/perl\",\n\t\t\".py\"=>\"/usr/bin/python\",\n\t)\n";
    echo "}\n\n";
}

?>
//////// END /root/ispconfig/custom/lighttpd.conf.php

You can run it directly and see it's output - these are standard lighttpd configuration directives. Now create a corresponding lighttpd configuration:

//////// BEGIN /etc/lighttpd/lighttpd.conf
Code:
############## Module Prefs ################

server.modules=("mod_access","mod_cgi","mod_accesslog","mod_fastcgi")

############### Generic Preferences #############

server.errorlog="/var/log/lighttpd/error.log"
server.pid-file="/var/run/lighttpd.pid"
#accesslog.filename="/var/log/lighttpd/access.log"
index-file.names=("index.html","index.htm")
url.access-deny=("~",".inc")
server.event-handler="linux-sysepoll"
#You can set this to port 9999 to run lighttpd besides apache2
#server.port=9999
server.port=80

include_shell "/usr/share/lighttpd/create-mime.assign.pl"

############# Basic Dirlist-Settings  ################

server.dir-listing="enable"
dir-listing.encoding="iso-8859-15"
dir-listing.hide-dotfiles="enable"
#dir-listing.external-css="/dir.css"

############# PHP-Fastcgi-Stuff ################

index-file.names+=("index.php")

fastcgi.server=(
    ".php"=>(
        "localhost"=>(
            "bin-path"=>"/usr/bin/php5-cgi",
            "socket"=>"/tmp/php5-socket",
            "max-procs"=>2,
            "bin-environment"=>(
                "PHP_FCGI_CHILDREN"=>"1",
                "PHP_FCGI_MAX_REQUESTS"=>"10000",
            ),
            "bin-copy-environment"=>(
                "PATH",
                "SHELL",
                "USER",
            ),
            "broken-scriptfilename"=>"enable"
        )
    )
)

############# And now, our VHOST-Handling ################

include_shell "/root/ispconfig/custom/lighttpd.conf.php"
//////// END /etc/lighttpd/lighttpd.conf

This expects debian/ubuntu style lighttpd-package, where there is a mime-script at /usr/share/lighttpd/create-mime.assign.pl ... you can comment the line and put the mime-handling from the example-config in it if you don't want this.

Maybe you have to adapt the fastcgi-configuration to your needs, for example if your php-cgi fastcgi enabled binary is not at /usr/bin/php5-cgi ... Also, this is my lightweight configuration example (only a few fcgi-processes)

You can create the entire lighttpd-config this way from MySQL-Informations, they will refresh every time you reload lighty... So it is quite easy to switch from apache2 to lighty without making major changes to existing apache2-configs...

As you can see, while I don't know much about ISPCONFIG-Internals, my script is poorly using it's features, I guess you can make one much better in five minutes or so ;-)

Have Fun!
Martin
__________________
PSIplus' Site
Reply With Quote
  #5  
Old 9th October 2006, 04:53
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
Default

WOW...
It is possible to put the fastcgi.server stuff into the "virtual hosts", using lighty's execwrap to gain maximum security!! At least I can have the suexec-effect for php-scripts...

I know this is possible with apache2-fastcgi+suexec as well, but I never got this running well... I think this is a nice solution...

Maybe we can make a stable implementation out of this, that could be really usefull (espacially thinking of the latest php, ... bugs and possible security breaches by insecure user scripts)
__________________
PSIplus' Site
Reply With Quote
  #6  
Old 9th October 2006, 19:14
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
Talking Update :-)

I overworked it a bit... And got it now running on one of my smaller servers (runs pretty stable :-) )

lighttpd.conf:
Code:
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/root/ispconfig/scripts/lighttpd.conf.php"
/root/ispconfig/scripts/lighttpd.conf.php:
Code:
#!/root/ispconfig/php/php -q
<?

$go_info["server"]["db_host"] = "localhost";
$go_info["server"]["db_name"] = "db_ispconfig";
$go_info["server"]["db_user"] = "ispconfig_root";
$go_info["server"]["db_password"] = "12345";
$go_info["server"]["db_type"] = "mysql";

mysql_connect($go_info["server"]["db_host"], $go_info["server"]["db_user"], $go_info["server"]["db_password"]) or die("Could not connect to MySQL server!");
mysql_select_db($go_info["server"]["db_name"]);

$year=date("Y");
$month=date("m");
$prefix_web="web";

$db_res=mysql_query("select isp_isp_web.doc_id,isp_isp_domain.domain_host,isp_isp_domain.domain_domain from isp_isp_domain,isp_isp_web,isp_dep where isp_dep.parent_doc_id=isp_isp_web.doc_id and isp_dep.child_doc_id=isp_isp_domain.doc_id and isp_dep.parent_doctype_id=isp_isp_web.doctype_id and isp_dep.child_doctype_id=isp_isp_domain.doctype_id");
while(list($id,$hs,$dm)=mysql_fetch_array($db_res))$ahosts[$id][]=array($hs,$dm);

list($shost,$sdomain,$docroot,$user,$group,$log,$sname)=mysql_fetch_array(mysql_query("select server_host,server_domain,server_path_httpd_root,server_httpd_user,server_httpd_group,server_path_httpd_log,dist_httpd_daemon from isp_server limit 1"));

if($shost)$sdomain="$shost.$sdomain";

echo "\n\n## Static Preferences ##\n\n";
echo "server.modules=(\"mod_access\",\"mod_cgi\",\"mod_accesslog\",\"mod_fastcgi\",\"mod_ssi\",\"mod_alias\")\n";
echo "server.errorlog=\"/var/log/lighttpd/error.log\"\n";
echo "server.pid-file=\"/var/run/lighttpd.pid\"\n";
echo "index-file.names=(\"index.html\",\"index.htm\")\n";
echo "url.access-deny=(\"~\",\".inc\")\n";
echo "server.event-handler=\"linux-sysepoll\"\n";

echo "\n\n## Dynamic Preferences ##\n\n";
echo "server.name=\"$sdomain\"\n";
echo "server.tag=\"ispconfig/lighttpd@$sdomain\"\n";
echo "server.username=\"$user\"\n";
echo "server.groupname=\"$group\"\n";
echo "server.document-root=\"$docroot/sharedip\"\n";
echo "accesslog.filename=\"$log\"\n";
//echo "#accesslog.filename=\"/var/log/lighttpd/access.log\"\n";
system("chown $user:$group $log");

echo "\n\n## Global Dirlist-Settings ##\n\n";
echo "server.dir-listing=\"enable\"\n";
echo "dir-listing.encoding=\"iso-8859-15\"\n";
echo "dir-listing.hide-dotfiles=\"enable\"\n";
echo "#dir-listing.external-css=\"/dir.css\"\n";



$db_res=mysql_query("select * from isp_isp_web");

echo "\n\n## Dynamic VHOSTS ##\n\n";

while($qline=mysql_fetch_array($db_res))
{
    $parlist=array
    (
        "id"=>$qline["doc_id"],
        "dirlist"=>true,
        "cgi"=>$qline["web_cgi"],
        "php"=>$qline["web_php"],
        "safemode"=>$qline["web_php_safe_mode"],
        "ssi"=>$qline["web_ssi"],
        "error"=>$qline["web_individual_error_pages"],
    );
    $vhlist[$qline["web_domain"]]=$parlist;
    if($qline["web_host"]&&$qline["web_host"]!="NULL") $vhlist[$qline["web_host"].".".$qline["web_domain"]]=$parlist;
    if(is_array($ahosts[$qline["doc_id"]]))
    {
        reset($ahosts[$qline["doc_id"]]);
        while(list(,list($hs,$dm))=each($ahosts[$qline["doc_id"]]))
        {
            if(!$vhlist[$dm])$vhlist[$dm]=$parlist;
            if($hs&&$hs!="NULL"&&!$vhlist["$hs.$dm"])$vhlist["$hs.$dm"]=$parlist;
        }
    }
}
reset($vhlist);
while(list($host,$parm)=each($vhlist))
{
    if(!is_dir("$docroot/$prefix_web$parm[id]/log/$year/$month"))system("mkdir -p $docroot/$prefix_web$parm[id]/log/$year/$month");
    touch("$docroot/$prefix_web$parm[id]/log/$year/$month/web.log");
    system("chown -R $user:$group $docroot/$prefix_web$parm[id]/log");
    echo "\$HTTP[\"host\"]==\"$host\" {\n";
    echo "\tserver.name=\"$host\"\n";
    echo "\tserver.document-root=\"$docroot/$prefix_web$parm[id]/web\"\n";
    echo "\taccesslog.filename=\"$docroot/$prefix_web$parm[id]/log/$year/$month/web.log\"\n";
    echo "\tserver.errorlog=\"$docroot/$prefix_web$parm[id]/log/error.log\"\n";
    echo "\tserver.dir-listing=\"".(($parm["dirlist"])?"enable":"disable")."\"\n";

    if($parm["cgi"]) echo "\n\t## CGI-Settings ##\n\tcgi.assign=(\n\t\t\".pl\"=>\"/usr/bin/perl\",\n\t\t\".py\"=>\"/usr/bin/python\",\n\t)\n";

    if($parm["php"])
    {
        echo "\n\t## FastCGI-PHP-Settings ##\n";
        echo "\tindex-file.names+=(\"index.php\")\n\n";
        echo "\tfastcgi.server=(\n";
        echo "\t    \".php\"=>(\n";
        echo "\t        \"localhost\"=>(\n";
        echo "\t            \"bin-path\"=>\"/usr/bin/php5-cgi -c /etc/php5/cgi/php".(($parm["safemode"])?"_safe":"").".ini\",\n";
        echo "\t            \"socket\"=>\"/tmp/php5-".(($parm["safemode"])?"safe-":"")."socket\",\n";
        echo "\t            \"max-procs\"=>4,\n";
        echo "\t            \"bin-environment\"=>( \n";
        echo "\t                \"PHP_FCGI_CHILDREN\"=>\"4\",\n";
        echo "\t                \"PHP_FCGI_MAX_REQUESTS\"=>\"10000\",\n";
        echo "\t                \"TMP\"=>\"$docroot/tmp\",\n";
        echo "\t                \"TEMP\"=>\"$docroot/tmp\",\n";
        echo "\t            ),\n";
        echo "\t            \"bin-copy-environment\"=>(\n";
        echo "\t                \"PATH\",\n";
        echo "\t                \"SHELL\",\n";
        echo "\t                \"USER\",\n";
        echo "\t            ),\n";
        echo "\t            \"broken-scriptfilename\"=>\"enable\"\n";
        echo "\t        )\n";
        echo "\t    )\n";
        echo "\t)\n";
    }

    if($parm["ssi"])
    {
        echo "\n\t## SSI-Settings ##\n\tssi.extension=(\".shtml\")\n";
    }

    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
        */
    }

    echo "}\n\n";
}

?>
It works pretty well and even sets the permissions on startup :-)

However, someday I should use the config.inc stuff to connect to mysql...

And: You should update the apache_reload-function to restart lighttpd instead of apache, I've done it, but I forgot where... But this solution is VERY stable...

You can adapt the settings below "Static Preferences" with values from ispconfig...

Yes, and I made php a bit more secure by creating php_safe.ini für safemode, set open_basedir to /var/www there and as tempdir /var/www/tmp ... However, it would be absolutely easy to use the suexec-stuff and improve this even more, maybe I'll do this someday ;-)

Have Fun!
__________________
PSIplus' Site
Reply With Quote
  #7  
Old 10th October 2006, 14:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Quote:
Originally Posted by PSIplus
And: You should update the apache_reload-function to restart lighttpd instead of apache, I've done it, but I forgot where...
It's in /root/ispconfig/scripts/lib/config.lib.php.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 11th October 2006, 19:32
MisterAoD MisterAoD is offline
Junior Member
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gentleman,

It would be great if ISP would fully support lighty.
Can anyone provide me with a complete walk-through please a bit confusing... on PSIplus's post, btw, great post man

Hope someone can help
Reply With Quote
  #9  
Old 5th July 2007, 13:13
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 932
Thanks: 16
Thanked 262 Times in 208 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
  #10  
Old 25th July 2007, 23: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, 743 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 12:31
ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" Problem with ISPConfig chipw Installation/Configuration 6 30th October 2006 10:38
Problem with BIND and ISPConfigs's DNS Manager Nejko Installation/Configuration 66 22nd April 2006 21:47
setup fails on debian 3.1 dtrumbower Installation/Configuration 7 7th March 2006 14:42
ISPConfig Failure on SuSe 9.3 gimhan90 Installation/Configuration 13 2nd February 2006 11:29


All times are GMT +2. The time now is 16:20.


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