All posts

전체 글

connect() to unix:/var/run/php-fpm/php-fpm.sock failed (2: No such file or directory)

2020/08/14 10:05:46 [crit] 8538#0: *2 connect() to unix:/var/run/php-fpm/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: [my_IP_address], server: [my_domain], request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "[my_domain]:82"
2020/08/14 10:05:46 [error] 8538#0: *2 open() "/var/www/html/wordpress/nginx-logo.png" failed (2: No such file or directory), client: [my_IP_address], server: [my_domain], request: "GET /nginx-logo.png HTTP/1.1", host: "[my_domain]:82", referrer: "http://[my_domain]:82/"
2020/08/14 10:05:46 [error] 8541#0: *1 open() "/var/www/html/wordpress/poweredby.png" failed (2: No such file or directory), client: [my_IP_address], server: [my_domain], request: "GET /poweredby.png HTTP/1.1", host: "[my_domain]:82", referrer: "http://[my_domain]:82/"

I had to integrate websites that used Nginx and php into other web servers. This content describes the process of resolving errors that occurred during Web server consolidation.

 

 

First, I checked the versions of Nginx and php.

Before integrating the web server, I matched the same version of Nginx and php. However, when I checked the php version, php was activating the existing version, and I upgraded the version in a new way.

 

How to upgrade PHP version:

The same version of Nginx and php were matched, but the same error occurred. So I reinstalled php-fpm. But the result was same.

// Check package name
# yum list php*fpm

// Remove
# yum remove php70w-fpm -y

// Reinstall
# yum install php70w-fpm -y

 

And I check the path of php-fpm again,

 

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

I've just recently moved my websites from apache2 to Nginx as my new web server backend. got to love problems aha. HTML files in the web host director work prior to php files making there way main

stackoverflow.com

 

Finally, it was resolved through LISTEN value modification and permission setting.

/etc/php-fpm.d/www.conf

[www]
;user = apache
user = nginx
;group = apache
group = nginx

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock

;listen.owner = nobody
listen.owner = nginx
;listen.group = nobody
listen.group = nginx
listen.mode = 0660
# systemctl restart nginx php-fpm
 

Permission Denied for fastcgi_pass using PHP7

I'm running LEMP with PHP7.0. I've got this in my server block fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; But when I open the site, it returns a 502 Bad Gateway. Below is the error log. *1

serverfault.com

 

NGINX: connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) – The new polyglot

This website uses cookies. If you continue to use this site we will assume that you are happy with this. Accept

www.the-new-polyglot.co.uk

 

1) Check the existing php version.

# php -v

 

2) Remove existing php.

# yum remove php-*
# yum remove php-common mod_php php-cli

 

3) Upgrade the php installation package

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

# yum --enablerepo=remi update remi-release

 

4) Install php and related packages

# yum install php70w

# yum install php70w-cli php70w-common php70w-dba php70w-devel php70w-fpm php70w-gd php70w-imap -y
# yum install php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-odbc php70w-opcache -y
# yum install php70w-pdo php70w-pdo_dblib php70w-pear php70w-pecl-imagick php70w-pecl-imagick-devel -y 
# yum install php70w-pgsql php70w-phpdbg php70w-process php70w-snmp php70w-soap php70w-tidy php70w-xml php70w-xmlrpc -yHTML 

 

5) Check the current php version.

# php -v

전체 DB 목록 조회

SELECT name FROM master.dbo.sysdatabases

 

DB별 계정 및 역할(Role) 조회

SELECT
	[UserName] = CASE memberprinc.[type] 
		WHEN 'S' THEN memberprinc.[name]
		WHEN 'U' THEN ulogin.[name] COLLATE Latin1_General_CI_AI
		END,   
	[Role] = roleprinc.[name]
FROM 
	sys.database_role_members members
JOIN
	sys.database_principals roleprinc ON roleprinc.[principal_id] = members.[role_principal_id]
JOIN
	sys.database_principals memberprinc ON memberprinc.[principal_id] = members.[member_principal_id]
LEFT JOIN
	sys.login_token ulogin on memberprinc.[sid] = ulogin.[sid]

 

여러 방법을 이용하여 DB별 계정과 역할을 한 번에 조회하려고 했으나 모두 실패했다.

일단, 'USE' 에서 변수 사용이 되지 않아서 배열, 프로시저, 임시 테이블 등의 방법을 사용해도 제대로 작동하지 않는다.

 

결국에는 DB 전체 목록을 출력해서 조회 했다.

 

참고 사이트: 

 

SQL Server query to find all permissions/access for all users in a database

I would like to write a query on a sql 2008 that will report all the users that have access to a specific database, or objects within the database such as tables, views, and stored procedures, either

stackoverflow.com

 

 

The system drive usage was very high, so I started looking for the cause, and the cause was the cab_xxxxx files in the Windows temporary folder.

 

However, those files were not easily erased. I checked a little more, the cab_xxxxx files were creating when the CBS log file was compressing. Usually, the temporary folder files are automatically deleted, but it is confirmed as an error that occurred because the CBS log file could not be compressed.

 

Anyway, I thought deleting the CBS log files would make it easier to delete the cab_xxxx files in the Windows temporary folder.

 

The following is the way for deleting CBS logs and cab_xxxxx files:

 

1) Delete CBS Logs

 Path: %WINDIR%\log\CBS\

 delete CBS.log and CbsPersist*.log files

 

2) Delete cab_xxxxx files

 Path: %WINDIR%\Temp\
 delete cab_xxxxx files

 

AWS 용어


EIP -> Static Public IP

 그냥 Public IP 사용할 경우 IP값이 변경 됨. 고정 IP가 필요한 경우 사용.

 EIP를 할당만 받고 사용하지 않을 경우 추가 요금 발생.

VPC -> Network

 기존 Switch, Router, FW 등의 네트워크 관련 서비스.

Security Group -> firewall, security

 보안그룹. 기존의 ACL, firewall-cmd 등.

IAM -> Permission

 권한 설정.

 

ROUTE53 -> DNS

 

ELB -> Load Balancer

 기존 L4, 부하 분산 장비.

Cloud Front -> CDN

 클라우드 앞단에서 서비스한다고 하여 Cloud Front라고 붙여짐.

Cloud Watch -> Monitoring

 기본 5분 간격으로 모니터링. 추가 요금 지불하여 1분 간격 모니터링 가능.

 

AMI -> OS Image

 기존 ISO 개념.

EC2 -> Server

 EC2의 각 인스턴스가 기존 하나의 서버.

EBS -> Disk

 기존 로컬 디스크 개념

S3 -> Storage

 기본으로 제공되는 용량 무제한 스토리지

 Glacier -> 장기 보관용 스토리지

RDS -> DB

 Paas 형태의 데이터베이스.

 

 

Global Services -> region에 영향 받지 않음.

 IAM, Route 53, CDN


EIP, Elastic IP addresses

VPC, Virtual Private Cloud

IAM, Identity and Access Management

ELB, Elastic Load Balancing

AMI, Amazon Machine Images

EC2, Elastic Compute Cloud

EBS, Elastic Block Store

S3, Simple Cloud Storage

RDS, Relational Database Service