Git Product home page Git Product logo

dbd-modules's Introduction

dbd-modules's People

Watchers

 avatar  avatar  avatar

dbd-modules's Issues

segmentation faults with mod_vhost_dbd

When I use mod_vhost_dbd-1.0.4 with mysql-5.0.60, apr-1.2.11,
apr-util-1.2.10, and apache-2.2.9 on Linux, the server reproducibly exits
with segmentation faults.

This patch solves the problem:
--- mod_vhost_dbd.c.orig    2008-06-24 21:59:56.000000000 +0200
+++ mod_vhost_dbd.c 2008-06-24 22:00:30.000000000 +0200
@@ -77,8 +77,8 @@
 static int setDocRoot(request_rec *r)
 {
     request_rec *mainreq = r;
-    apr_dbd_results_t *res;
-    apr_dbd_row_t *row;
+    apr_dbd_results_t *res = NULL;
+    apr_dbd_row_t *row = NULL;
     ap_dbd_t *dbd;
     apr_dbd_prepared_t *stmt;
     apr_dbd_prepared_t *prestmt;

I spent only little time on debugging this, but it seems reasonable. The
call chain is setDocRoot -> apr_dbd_pselect -> dbd_mysql_pselect ->
dbd_mysql_pselect_internal. In that function you will find:
if (!*res) {
    *res = apr_pcalloc(pool, sizeof(apr_dbd_results_t));
}
If we do not initialise res, it can have any value. But
dbd_mysql_pselect_internal will only allocate memory for the result set, if
res is zero.

The same is true for setDocRoot -> apr_dbd_get_row -> dbd_mysql_get_row.

Original issue reported on code.google.com by [email protected] on 24 Aug 2008 at 4:21

PHP server variable 'document_root' are not set

What steps will reproduce the problem?
1. Install php 5.4.4
2. Set up virtual host to pull documentroot from mysql 5.5.31
3. Create php file and echo phpinfo()
4. Load the created php file in browser.

What is the expected output? What do you see instead?
$_SERVER['DOCUMENT_ROOT'] showing as "/var/www/"
Should be the document root pulled from the database

What version of the product are you using? On what operating system?
Running on debian wheezy with apache 2.2.22 (32 bit prefork)
DBD Modules version 1.0.6

Please provide any additional information below.
Apache2 pulls the document root and serves the correct files from the correct 
location but PHP server variables are not set.

Original issue reported on code.google.com by [email protected] on 30 Sep 2013 at 2:03

php global variable $_SERVER['DOCUMENT_ROOT'] is set to default value

1. Compile latest version according to the manual.
2. Create a few virtual hosts via database table and related folders on the 
host (Example: test1.com - /srv/www/test1, test2.com - /srv/www/test2).
3. Create index.php files under each folder. Files contain the following code:

<?=$_SERVER['DOCUMENT_ROOT']; ?>

4. Open each domain in a web browser.

Each domain should show different path. Instead module resolves domain names 
into directory paths correctly, but DOCUMENT_ROOT is set to default value 
(/srv/www).

I am using dbd-modules.1.0.5? I got the same results under Fedora 13 (64bit) 
Apache/2.2.16 and Fedora 9 (32bit), Apache/2.2.8?


Please provide any additional information below.


Original issue reported on code.google.com by dzysyak on 24 Aug 2010 at 9:51

Attachments:

Feature Request - Read from flat files

I am just thinking out aloud  here. 

Just like a rewritemap reads from a text file or an external program, would it 
be possible to do the same for vhosts/document roots?

Thanks
Ashish

Original issue reported on code.google.com by [email protected] on 11 Feb 2013 at 12:17

mod_vhost_dbd breaks mod_rewrite?

What steps will reproduce the problem?
1. use a DBDocRoot query in a vhost config
2. attempts to use mod_rewrite's RewriteCond and RewriteRule no longer seem to 
work
3. evidence - setting RewriteLog directive shows nothing is logged.

Could it be that just the RewriteLog is broken?  the DBD query seems to work OK 
in other respects... and the rewrite rules work fine on their own, if DBDocRoot 
is switched off.

We're trying to exchange information between the two using an environment 
variable, set via the second column in the query (not using the DocRoot 
variable, since we've seen this is unaffected).




Original issue reported on code.google.com by [email protected] on 6 Jun 2012 at 4:51

  • Merged into: #8

Alias fails with DBDocRoot

What steps will reproduce the problem?
1. Define an alias pointing to a directory outside the original Document Root
2. Call DBDocRoot to set the new Document Root.
3. Serving a file through the alias fails.


What version of the product are you using? On what operating system?

Windows 7 / Apache 2.2.21

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 11 Feb 2013 at 12:42

Missing AllowOverride All option

first of all, thanks for creating this module!
i started working with this a few days ago and so far i like it! i only 
miss one relativly small part: i need to be able to add the following 
option:
<directory %vhost folder%>
AllowOverride All
</directory>

I need this because all my vhosts must be able to have their 
seperate .htaccess configuration so they can use URL rewriting.

is it difficult to add this feature?

roland andriese

Original issue reported on code.google.com by [email protected] on 10 Sep 2008 at 7:40

Getting "unable to execute SQL statement:" errors after a few requests

What steps will reproduce the problem?
1. Installed software on centos 5.6 using apache 2.2.3
2. Configured with custom SQL 
3. Hit server with various requests for various virtual hosts and after several 
requests started getting "unable to execute SQL statement:" error in the apache 
main error.log

What is the expected output? What do you see instead?
Expected result was the module working and displaying the sites as needed.

What version of the product are you using? On what operating system?
Centos 5.6
httpd-devel-2.2.3-53.el5.centos.3
httpd-2.2.3-53.el5.centos.3
httpd-devel-2.2.3-53.el5.centos.3
apr-util-1.2.7-11.el5_5.2
apr-1.2.7-11.el5_6.5
apr-devel-1.2.7-11.el5_6.5
apr-util-1.2.7-11.el5_5.2
apr-util-devel-1.2.7-11.el5_5.2
apr-1.2.7-11.el5_6.5
apr-util-mysql-1.2.7-11.el5_5.2 <- this was downloaded from rpmfind.net

Please provide any additional information below.

Errorlog after a few requests:
[Tue Mar 13 20:53:47 2012] [crit] [client xx] mod_vhost_dbd: Unable to execute 
SQL statement:
[Tue Mar 13 20:53:58 2012] [crit] [client xx] mod_vhost_dbd: Unable to execute 
SQL statement: , referer: http://orlando.xx.com/
[Tue Mar 13 20:53:58 2012] [crit] [client xx] mod_vhost_dbd: Unable to execute 
SQL statement: , referer: http://orlando.xx.com/
[Tue Mar 13 20:53:58 2012] [crit] [client xx] mod_vhost_dbd: Unable to execute 
SQL statement: , referer: http://orlando.xx.com/

Config from apache:

DBDriver mysql
DBDParams 
host=localhost,user=haven_staging,pass=VfMuxrWOUEc4WHbx,db=lotd_haven_staging
DBDOCRoot "select concat('/var/www/html/', substring_index( 
reverse(substring_index(reverse(%s), '.', 2)), '.', 1), '/wpmu/htdocs/') from 
otherstuff(%s, '.', 1)) and otherstuff(%s, '.', -2)) " HOSTNAME HOSTNAME 
HOSTNAME

My goal is to have the server return a default hostname unless the sql 
(abbreviated above) returns a result (which is the hostname), and if it does 
then use that hostname.  This should let me have *.domain.com pointed to one IP 
and based on a db entry have it point to either a generic website or a "real" 
website.

This seems to work on my debian test server, but on centos this happens.  Maybe 
an overloaded mysql server causing results to fail, and then the modules caches 
the error?

Original issue reported on code.google.com by [email protected] on 14 Mar 2012 at 1:25

mod_vhost_dbd does not take the MySQL timeout into account

What steps will reproduce the problem?

1. Set your MySQL server's wait-timeout (persistent connections) to n seconds.
2. Make an HTTP request to the server. The document root must be set by 
mod_vhost_dbd.
3. Wait approximately n seconds, try step 2. again. The MySQL connection stored 
by the module is lost, resulting in HTTP 500 on the client side.

What version of the product are you using? On what operating system?

Apache 2.2.22 / Debian 7.7

Please provide any additional information below.

The error is triggered in mod_vhost_dbd.c, at line 207. n seconds after the 
first request, the connection to the MySQL daemon is shutdown by the server. 
When the module retrieves it and calls apr_dbd_pselect() to query the database, 
this function returns with error code 2013 (CR_SERVER_LOST). The clients are 
then served HTTP 500 (Internal Server Error) until the module renews its 
connection to the server.

Original issue reported on code.google.com by [email protected] on 28 Oct 2014 at 7:47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.