How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

June 27, 2017

change root password for mysql 5.7 fresh installed

Filed under: Linux — Tags: , , — admin @ 11:35 am

In order to find out actual password you need to grep log file

grep password /var/log/mysqld.log

This will provide you with root password .

After login on your mysql server with

mysql -u root -p

Then you must change root password with

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘newpassword’;

 

June 14, 2017

apache 2.2 run php as username with fcgid

Filed under: Linux — Tags: , , , — admin @ 12:25 pm

One of my problem is to secure a little websites at least to run as their user and not as apache . In this way if one wordpress is hacked not all website to be modify by that script .

On internet you will find something like this

<IfModule mod_fcgid.c>
MaxRequestLen 15728640
FcgidConnectTimeout 20
SuexecUserGroup username groupname
<Directory /var/www/vhosts/site.com>

Options +ExecCGI
AllowOverride All
AddHandler fcgid-script .php
FCGIWrapper /var/www/wraper/site.com/php-fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>

All is fine in some situation works . However I notice that if you have the php 5.6 installed this won’t work . I try all loglevel debug and other stuff but it simply didn’t start that wraper with that user in process list.

After some more dig I found out that /etc/httpd/conf.d/php.conf is different then on other php version and in this 5.6 that file have a SetHandler .

So the solution is to overwrite again that SetHandler

So in your vhost before add this IfModule you need to add also

<FilesMatch \.php$>
SetHandler None
</FilesMatch>

 

June 13, 2017

How to fix upstream timed out (110: Connection timed out) error in Nginx

Filed under: Linux — Tags: , , , — admin @ 1:36 pm

In order to fix that you need to add

proxy_read_timeout 300;

 

Powered by WordPress