글걸이

[Linux] tar: /path/to/filename.bz2: Wrote only 4096 of 10240 bytes

[root@test ~]# tar jcpfP /path/to/filename.bz2 /path/to/directory/* /bin/sh: line 1: bzip2: command not found tar: /path/to/filename.bz2: Wrote only 4096 of 10240 bytes tar: Child returned status 127 tar: Error is not recoverable: exiting now "Wrote only 4096 of 10240 bytes"는 파일 압축이 제대로 되지 않았음을 뜻할 수 있다. 이 경우에는 bzip2 프로그램이 깔리지 않아서 tar 파일...

[PHP] 이름이 같은 함수를 또 선언했을 때 - PHP Fatal error: Cannot redeclare...

PHP Fatal error: Cannot redeclare my_function() (previously declared in /.../index.php:150) in /.../index.php on line 159 이름이 같은 함수를 다시 선언하면 위와 같은 오류가 나올 수 있다. 이미 만든 함수 내용을 복사하고 붙여넣기하여 다른 함수를 만들다가 함수 이름을 바꾸는 것을 깜빡하면 이런 오류를 겪을 수 있다. <?php ... function my_function() { ... } function my_function() { ... } .....

[dnf/yum] Killed

# sudo yum update Killed # sudo dnf update Killed # sudo dnf module list php Killed yum이나 dnf를 실행할 때 모두 Killed라고 나오고 멈춘다면, 메모리가 모자라기 때문일 수 있다. # sudo sysctl vm.swappiness vm.swappiness = 0 sysctl로 vm.swappiness 값을 확인해 본다. 값이 0이면 가상 메모리를 쓰지 못하는 상태일 수 있으므로, 1 이상으로 높혀 준다. # sudo sysctl vm.swappiness=30 vm.swap...

[openssh] [SELinux] Cannot bind any address

Dec 15 02:21:34 MyServer systemd[1]: sshd.service: Main process exited, code=exited, status=255/EXCEPTION ░░ Subject: Unit process exited ░░ Defined-By: systemd ░░ Support: https://access.redhat.com/support ░░ ░░ An ExecStart= process belonging to unit sshd.service has exited. ░░ ░░ The process' exit code is 'exited' and its exit status is 255. Dec 15 0...

[nginx] getpwnam("apache") failed in /etc/nginx/nginx.conf:1

# nginx -t nginx: [emerg] getpwnam("apache") failed in /etc/nginx/nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed nginx를 깔면 nginx가 사용자로 등록된다. 그러므로 nginx.conf 파일에 nginx가 사용자로 들어가야 맞다. 그러나 apache를 깐 적이 없어도 nginx.conf에 apache가 사용자로 들어가 있기도 해서 이런 오류가 나올 수 있다. /etc/nginx/nginx.conf 파일을 열어...

[certbot] error: unrecognized arguments: --dns-rfc2136-credentials...

# certbot certonly --dns-rfc2136 --dns-rfc2136-credentials /etc/letsencrypt/rfc2136.ini --dns-rfc2136-propagation-seconds 60 -d example-abc.com -d *.example-abc.com usage: certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ... Certbot can obtain and install HTTPS/TLS/SSL certificates. By default, it will attempt to use a webserver both for obtaining and insta...

[SELinux] [nginx] cannot load certificate "/etc/pki/tls/certs/default_ssl.crt": BIO_new_file() failed

-- Unit nginx.service has finished shutting down. Jan 15 01:32:43 test_server systemd[1]: Starting nginx - high performance web server... -- Subject: Unit nginx.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit nginx.service has begun starting up. Jan 15 01:32:43 test_server nginx[2131...

[nginx] [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in ...

nginx 1.25.1부터 listen 지시문에 http2이 들어가면 아래와 같은 경고문이 나올 수 있다. $ nginx -t nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/???.conf:2 nginx 새 판에서 listen 지시문에 들어가는 매개변수에 http2을 받아들이지 않을 것임을 예고하고 있다. 아직은 경고문이 나오고 작동은 하지만, 나중에 나오는 nginx 판...

[nginx] [selinux] open() "/var/run/nginx.pid" failed (13: Permission denied)

아래는 CentOS 7에서 nginx를 실행하여 실패했을 때 'journalctl -xe'로 본 오류 로그. May 29 17:53:05 main-server systemd[1]: Unit nginx.service entered failed state. May 29 17:53:05 main-server systemd[1]: nginx.service failed. May 29 17:53:05 main-server polkitd[549]: Unregistered Authentication Agent for unix-p lines 1166-1188/1188 (END) May 29 17:53:05 main-server system...

[nginx] [PHP] File not found.

미리보기 그림 - [nginx] [PHP] File not found.
웹에서 PHP 프로그램을 실행했을 때 "File not Found."라고 나온다면, nginx 설정에서 fastcgi_param 지시문에 SCRIPT_FILENAME를 잘못 지정했기 때문일 수 있다. nginx.conf 또는 nginx.conf에서 읽어들이는 설정 파일에 아래 내용을 새로 넣거나 고쳐 넣는다. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;