configure apache to use mod_rewrite and mod_dbd using postgreSQL and PHPRedirect, Change URLs or Redirect...
Plagiarism of code by other PhD student
Can we carry rice to Japan?
How do you say "powers of ten"?
If nine coins are tossed, what is the probability that the number of heads is even?
Reason why dimensional travelling would be restricted
Toast materialize
Dystopian novel where telepathic humans live under a dome
Six real numbers so that product of any five is the sixth one
How can I handle a player who pre-plans arguments about my rulings on RAW?
Is there any relevance to Thor getting his hair cut other than comedic value?
Are small insurances worth it
What are all the squawk codes?
Why do phishing e-mails use faked e-mail addresses instead of the real one?
I can't die. Who am I?
Can a space-faring robot still function over a billion years?
Why is it "take a leak?"
Is there a full canon version of Tyrion's jackass/honeycomb joke?
Is 長 in Japanese related to “naga” in Thai and Sanskrit?
What does @RC mean in SSDT SQL Server Unit Testing?
VAT refund for a conference ticket in Sweden
If a set is open, does that imply that it has no boundary points?
Borrowing Characters
For the ranger's Natural Explorer feature, which favored terrain are caves and dungeons classified under?
Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?
configure apache to use mod_rewrite and mod_dbd using postgreSQL and PHP
Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to AskSecure Apache when using mod_proxy_http and mod_rewriteApache 2.4 + mod_rewrite + FastCGI (php-cgi.exe) on Windowsforward slash and mod_rewriteapache2 dbd failed to initialise error AH02654 using postgresql on debian jessieCan I use Apache variables with mod_alias's `Redirect`, instead of using mod_rewrite?how to use mod_rewrite in apache for a rest applicationHow serve different content using apache and (maybe) mod_rewriteApache mod_rewrite and mod_proxy conflictMultiple mod_rewrite parameters for same php file
I am trying to set up Apache to use mod_rewrite and mod_dbd with postgreSQL for a club website. (Kubuntu 18.04, Apache 2.4, PHP 7.2)
I can find some details for mod_dbd with mySQL, but I am having a very hard time with this combination. Any hints, suggestions or answers appreciated.
My current VirtualHost config file:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/example.com/error.log
CustomLog ${APACHE_LOG_DIR}/example.com/access.log combined
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} id=(d+) [nocase]
RewriteCond ${myquery:%1|NOTFOUND} !NOTFOUND [nocase]
RewriteMap myquery "dbd:SELECT page_name FROM page WHERE page_identifier = %1"
RewriteRule ^index.php ${myquery:%1}?
</IfModule>
<IfModule dbd_module>
DBDriver pgsql
DBDParams "hostaddr=127.0.0.1 port=5436 dbname=page user=user password=pass_with_symbols!)$$"
</IfModule> </VirtualHost>
Notes
- Actual domain name redacted. It's not in any shape for public
inspection - Password is not real but it does contain the non letter characters shown
- what I have is partially based on answers to these two questions
https://stackoverflow.com/questions/13623195/assistance-with-a-rewriterule-using-rewritemap
https://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite
as well as
http://httpd.apache.org/docs/current/mod/mod_dbd.html
- I am using a non-standard port for PostgreSQL and the pages work if I
use the unmodified URLs. They are being created from the same
database that I want mod_dbd to access. - the expected urls will be index.php?id=X, where X is a positive integer
Using what I show here, I receive the following error in the site error log and the Apache error log
[dbd:error] [pid 11299] (20014)Internal error (specific information not available): AH00633: failed to initialise
[dbd:error] [pid 10814] (20014)Internal error (specific information not available): AH00632: failed to prepare SQL statements: ERROR: syntax error at or near "%"nLINE 1: ...ery AS SELECT page_name FROM page WHERE page_identifier = %1n
if I put commas between the dbd params, like this,
DBDParams "hostaddr=127.0.0.1, port=5436, ...
I receive a different error:
[dbd:error] [pid 10267] (20014)Internal error (specific information not available): AH00629: Can't connect to pgsql: FATAL: password authentication failed for user "user,"nFATAL: password authentication failed for user "user,"n
(I think that this is wrong, and only applies to MySQL, but I tried it because I found a source that said it needed commas)
apache-2.4 mod-rewrite
New contributor
add a comment |
I am trying to set up Apache to use mod_rewrite and mod_dbd with postgreSQL for a club website. (Kubuntu 18.04, Apache 2.4, PHP 7.2)
I can find some details for mod_dbd with mySQL, but I am having a very hard time with this combination. Any hints, suggestions or answers appreciated.
My current VirtualHost config file:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/example.com/error.log
CustomLog ${APACHE_LOG_DIR}/example.com/access.log combined
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} id=(d+) [nocase]
RewriteCond ${myquery:%1|NOTFOUND} !NOTFOUND [nocase]
RewriteMap myquery "dbd:SELECT page_name FROM page WHERE page_identifier = %1"
RewriteRule ^index.php ${myquery:%1}?
</IfModule>
<IfModule dbd_module>
DBDriver pgsql
DBDParams "hostaddr=127.0.0.1 port=5436 dbname=page user=user password=pass_with_symbols!)$$"
</IfModule> </VirtualHost>
Notes
- Actual domain name redacted. It's not in any shape for public
inspection - Password is not real but it does contain the non letter characters shown
- what I have is partially based on answers to these two questions
https://stackoverflow.com/questions/13623195/assistance-with-a-rewriterule-using-rewritemap
https://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite
as well as
http://httpd.apache.org/docs/current/mod/mod_dbd.html
- I am using a non-standard port for PostgreSQL and the pages work if I
use the unmodified URLs. They are being created from the same
database that I want mod_dbd to access. - the expected urls will be index.php?id=X, where X is a positive integer
Using what I show here, I receive the following error in the site error log and the Apache error log
[dbd:error] [pid 11299] (20014)Internal error (specific information not available): AH00633: failed to initialise
[dbd:error] [pid 10814] (20014)Internal error (specific information not available): AH00632: failed to prepare SQL statements: ERROR: syntax error at or near "%"nLINE 1: ...ery AS SELECT page_name FROM page WHERE page_identifier = %1n
if I put commas between the dbd params, like this,
DBDParams "hostaddr=127.0.0.1, port=5436, ...
I receive a different error:
[dbd:error] [pid 10267] (20014)Internal error (specific information not available): AH00629: Can't connect to pgsql: FATAL: password authentication failed for user "user,"nFATAL: password authentication failed for user "user,"n
(I think that this is wrong, and only applies to MySQL, but I tried it because I found a source that said it needed commas)
apache-2.4 mod-rewrite
New contributor
add a comment |
I am trying to set up Apache to use mod_rewrite and mod_dbd with postgreSQL for a club website. (Kubuntu 18.04, Apache 2.4, PHP 7.2)
I can find some details for mod_dbd with mySQL, but I am having a very hard time with this combination. Any hints, suggestions or answers appreciated.
My current VirtualHost config file:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/example.com/error.log
CustomLog ${APACHE_LOG_DIR}/example.com/access.log combined
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} id=(d+) [nocase]
RewriteCond ${myquery:%1|NOTFOUND} !NOTFOUND [nocase]
RewriteMap myquery "dbd:SELECT page_name FROM page WHERE page_identifier = %1"
RewriteRule ^index.php ${myquery:%1}?
</IfModule>
<IfModule dbd_module>
DBDriver pgsql
DBDParams "hostaddr=127.0.0.1 port=5436 dbname=page user=user password=pass_with_symbols!)$$"
</IfModule> </VirtualHost>
Notes
- Actual domain name redacted. It's not in any shape for public
inspection - Password is not real but it does contain the non letter characters shown
- what I have is partially based on answers to these two questions
https://stackoverflow.com/questions/13623195/assistance-with-a-rewriterule-using-rewritemap
https://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite
as well as
http://httpd.apache.org/docs/current/mod/mod_dbd.html
- I am using a non-standard port for PostgreSQL and the pages work if I
use the unmodified URLs. They are being created from the same
database that I want mod_dbd to access. - the expected urls will be index.php?id=X, where X is a positive integer
Using what I show here, I receive the following error in the site error log and the Apache error log
[dbd:error] [pid 11299] (20014)Internal error (specific information not available): AH00633: failed to initialise
[dbd:error] [pid 10814] (20014)Internal error (specific information not available): AH00632: failed to prepare SQL statements: ERROR: syntax error at or near "%"nLINE 1: ...ery AS SELECT page_name FROM page WHERE page_identifier = %1n
if I put commas between the dbd params, like this,
DBDParams "hostaddr=127.0.0.1, port=5436, ...
I receive a different error:
[dbd:error] [pid 10267] (20014)Internal error (specific information not available): AH00629: Can't connect to pgsql: FATAL: password authentication failed for user "user,"nFATAL: password authentication failed for user "user,"n
(I think that this is wrong, and only applies to MySQL, but I tried it because I found a source that said it needed commas)
apache-2.4 mod-rewrite
New contributor
I am trying to set up Apache to use mod_rewrite and mod_dbd with postgreSQL for a club website. (Kubuntu 18.04, Apache 2.4, PHP 7.2)
I can find some details for mod_dbd with mySQL, but I am having a very hard time with this combination. Any hints, suggestions or answers appreciated.
My current VirtualHost config file:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/example.com
ErrorLog ${APACHE_LOG_DIR}/example.com/error.log
CustomLog ${APACHE_LOG_DIR}/example.com/access.log combined
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} id=(d+) [nocase]
RewriteCond ${myquery:%1|NOTFOUND} !NOTFOUND [nocase]
RewriteMap myquery "dbd:SELECT page_name FROM page WHERE page_identifier = %1"
RewriteRule ^index.php ${myquery:%1}?
</IfModule>
<IfModule dbd_module>
DBDriver pgsql
DBDParams "hostaddr=127.0.0.1 port=5436 dbname=page user=user password=pass_with_symbols!)$$"
</IfModule> </VirtualHost>
Notes
- Actual domain name redacted. It's not in any shape for public
inspection - Password is not real but it does contain the non letter characters shown
- what I have is partially based on answers to these two questions
https://stackoverflow.com/questions/13623195/assistance-with-a-rewriterule-using-rewritemap
https://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite
as well as
http://httpd.apache.org/docs/current/mod/mod_dbd.html
- I am using a non-standard port for PostgreSQL and the pages work if I
use the unmodified URLs. They are being created from the same
database that I want mod_dbd to access. - the expected urls will be index.php?id=X, where X is a positive integer
Using what I show here, I receive the following error in the site error log and the Apache error log
[dbd:error] [pid 11299] (20014)Internal error (specific information not available): AH00633: failed to initialise
[dbd:error] [pid 10814] (20014)Internal error (specific information not available): AH00632: failed to prepare SQL statements: ERROR: syntax error at or near "%"nLINE 1: ...ery AS SELECT page_name FROM page WHERE page_identifier = %1n
if I put commas between the dbd params, like this,
DBDParams "hostaddr=127.0.0.1, port=5436, ...
I receive a different error:
[dbd:error] [pid 10267] (20014)Internal error (specific information not available): AH00629: Can't connect to pgsql: FATAL: password authentication failed for user "user,"nFATAL: password authentication failed for user "user,"n
(I think that this is wrong, and only applies to MySQL, but I tried it because I found a source that said it needed commas)
apache-2.4 mod-rewrite
apache-2.4 mod-rewrite
New contributor
New contributor
New contributor
asked 2 mins ago
user3034958user3034958
1
1
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user3034958 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956938%2fconfigure-apache-to-use-mod-rewrite-and-mod-dbd-using-postgresql-and-php%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
user3034958 is a new contributor. Be nice, and check out our Code of Conduct.
user3034958 is a new contributor. Be nice, and check out our Code of Conduct.
user3034958 is a new contributor. Be nice, and check out our Code of Conduct.
user3034958 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956938%2fconfigure-apache-to-use-mod-rewrite-and-mod-dbd-using-postgresql-and-php%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown