How to , and other stuff about linux, photo, php … Another blog just like others on internet

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;

 

April 25, 2017

how to disable gzip for specific file

Filed under: Linux,Php — Tags: , , , , , , — admin @ 1:33 pm

The short answer is

RewriteRule ^dashboard/index - [E=no-gzip:1]
SetEnvIf REDIRECT_no-gzip 1 no-gzip

Some explination of that solution

The – means NOOP, E means set variable, 1 is the value. After redirects, the variables are renamed and prepended with REDIRECT_.

This work for php FPM

If you have a mod dso you can use also this

apache_setenv('no-gzip', '1');

January 4, 2017

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

Filed under: Linux — Tags: , , , — admin @ 6:01 pm

Today I wanted to upgrade a php webserver with php5.6 . However the epel didn’t work .
After a yum clean all got this title error

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

To fix this I needed to upgrade the ceritiface without epel .

yum upgrade ca-certificates –disablerepo=epel
After this all works.

December 7, 2016

There was a problem removing the alias. Park::unpark( ) failed: You cannot unpark a user’s main domain name.

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

Today I have another cpanel problem. Someone manage to add a domain as parking one and after this manage to create a main account also . Because the parking domain was first on httpd.conf vhosts when I was trying to access domain actually vhost was on parked one.  When I try to delete the parking from account the title of this subject was the error of the cpanel.

“There was a problem removing the alias. Park::unpark( ) failed: You cannot unpark a user’s main domain name.”

So how to fix this ?

Well first of all you will have a dns1 ( line on /var/cpanel/users/useraccount )

I delete this line but wasn’t enough .

After some search I find out that is also located into

/var/cpanel/userdata/username/

There are some files that they say not to modify them , but comparing two files one with parked and one without I figure it out what is the syntax. So I made a backup of original files and modify those from there  and delete parked domain .

After this you must run

/scripts/updateuserdomains

After I rebuild httpd.conf the domain was ok .

/scripts/rebuildhttpdconf

Hope this article will give some hint for someone else also .

The link that help me was from here

https://forums.cpanel.net/threads/error-from-domain-wrapper-subdomain-does-not-exist-for-user-solution.221782/

Also it appear this will influence /etc/userdatadomains

« Newer PostsOlder Posts »

Powered by WordPress