答案 0 :(得分:1)
发布的解决方案中链接(http://www.pgpool.net/docs/latest/pgpool-en.html#pcp_comand_password)中的页面不再存在。
我能够通过将.pcppass文件从postgres用户的目录复制到/ var / www /并将其所有者更改为apache系统用户来解决此问题。
sudo cp /home/postgres/.pcppass /var/www/
sudo chown apache /var/www/.pcppass
sudo chmod 600 /var/www/.pcppass
答案 1 :(得分:0)
.pcppass文件。
要解决问题,你可以解决这个问题:
http://www.pgpool.net/docs/latest/pgpool-en.html#pcp_comand_password
确保.pcppass文件具有权限0600.您可能还需要将其所有者/组更改为apache / www-data用户,具体取决于您的系统。
答案 2 :(得分:0)
всемпривет)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct headbmp {
int filesize,
offset;
short resval1,
resval2;
char formatidentifier[2];
};
struct headdib {
int headersize,
width,
height,
compressionscheme,
imagesize,
horizontalres,
verticalres,
palette,
importantcolors;
short planes,
bitsperpixel;
};
struct headrgb {
unsigned char red, blue, green;
};
void invert (char *file)
{
struct headbmp bmp;
struct headdib dib;
struct headrgb rgb;
FILE *fp;
fp = fopen (file, "rb+");
if (fp == NULL) {
perror ("fopen - file");
exit (EXIT_FAILURE);
}
/*--------bmp--------*/
if (fread (bmp.formatidentifier, 1, 2, fp) != 2) {
perror ("fread - bmp.formatidentifier");
exit (EXIT_FAILURE);
}
if (bmp.formatidentifier[0] != 'B' || bmp.formatidentifier[1] != 'M') {
printf ("we do not support this type of file! \n");
exit (-1);
}
if (fread (&bmp.filesize, 1, 4, fp) != 4) {
perror ("fread - bmp.filesize");
exit (EXIT_FAILURE);
}
if (fread (&bmp.resval1, 1, 2, fp) != 2) {
perror ("fread - bmp.resval1");
exit (EXIT_FAILURE);
}
if (fread (&bmp.resval2, 1, 2, fp) != 2) {
perror ("fread - bmp.resval2");
exit (EXIT_FAILURE);
}
if (fread (&bmp.offset, 1, 4, fp) != 4) {
perror ("fread - bmp.offset");
exit (EXIT_FAILURE);
}
/*--------dib--------*/
if (fread (&dib.headersize, 1, 4, fp) != 4) {
perror ("fread - dib.headersize");
exit (EXIT_FAILURE);
}
if (dib.headersize != 40) {
printf ("we do not support this type of file! \n");
exit (EXIT_FAILURE);
}
if (fread (&dib.width, 1, 4, fp) != 4) {
perror ("fread - dib.width");
exit (EXIT_FAILURE);
}
if (fread (&dib.height, 1, 4, fp) != 4) {
perror ("fread - dib.height");
exit (EXIT_FAILURE);
}
if (fread (&dib.planes, 1, 2, fp) != 2) {
perror ("fread - dib.planes");
exit (EXIT_FAILURE);
}
if (fread (&dib.bitsperpixel, 1, 2, fp) != 2) {
perror ("fread - dib.bitsperpixel");
exit (EXIT_FAILURE);
}
if (fread (&dib.compressionscheme, 1, 4, fp) != 4) {
perror ("fread - dib.compressionscheme");
exit (EXIT_FAILURE);
}
if (fread (&dib.imagesize, 1, 4, fp) != 4) {
perror ("fread - dib.imagesize");
exit (EXIT_FAILURE);
}
if (fread (&dib.horizontalres, 1, 4, fp) != 4) {
perror ("fread - dib.horizontalres");
exit (EXIT_FAILURE);
}
if (fread (&dib.verticalres, 1, 4, fp) != 4) {
perror ("fread - dib.verticalres");
exit (EXIT_FAILURE);
}
if (fread (&dib.palette, 1, 4, fp) != 4) {
perror ("fread - dib.palette");
exit (EXIT_FAILURE);
}
if (fread (&dib.importantcolors, 1, 4, fp) != 4) {
perror ("fread - dib.importantcolors");
exit (EXIT_FAILURE);
}
/*--------rgb--------*/
int i = 0;
while (i < dib.width) {
int j = 0;
while (j < dib.height) {
if (!fread (&rgb.red, 1, 1, fp)) {
fprintf (stderr, "error: fread - red (%d,%d)\n", i, j);
exit (EXIT_FAILURE);
}
unsigned int r = rgb.red;
r = ~r;
rgb.red = (char) r;
if (!fread (&rgb.green, 1, 1, fp)) {
fprintf (stderr, "error: fread - green (%d,%d)\n", i, j);
exit (EXIT_FAILURE);
}
unsigned int g = rgb.green;
g = ~g;
rgb.green = (char) g;
if (!fread (&rgb.blue, 1, 1, fp)) {
fprintf (stderr, "error: fread - blue (%d,%d)\n", i, j);
exit (EXIT_FAILURE);
}
unsigned int b = rgb.blue;
b = ~b;
rgb.blue = (char) b;
if (fseek (fp, -3, SEEK_CUR) == -1) {
perror ("fseek -3");
exit (EXIT_FAILURE);
}
if (!fwrite (&rgb.red, 1, 1, fp)) {
perror ("fwrite - red");
exit (EXIT_FAILURE);
}
if (!fwrite (&rgb.green, 1, 1, fp)) {
perror ("fwrite - green");
exit (EXIT_FAILURE);
}
if (!fwrite (&rgb.blue, 1, 1, fp)) {
perror ("fwrite - blue");
exit (EXIT_FAILURE);
}
j++;
}
i++;
}
if (fclose (fp) == -1)
perror ("fclose - fp");
}
int main (int argc, char *argv[])
{
if (argc < 3) {
fprintf (stderr, "error: insufficient input.\n"
"usage: %s -invert <filename.bmp>\n", argv[0]);
return 0;
}
if (strncmp (argv[1], "-invert", 7) == 0) {
invert (argv[2]);
}
else
fprintf (stderr, "error: unrecognized option.\n");
return 0;
}
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
chown www-data /var/www/.pcppass
chmod 0600 /var/www/.pcppass
前三个字段中的每一个都可以是文字值,或者*,它匹配任何内容