RockyLinux8 (CentOS8) 이상부터는 파일명에 공백이나 특수문자가 포함된 경우 파일명이 작은 따옴표로 감싸지는 현상이 있다.

이 따옴표가 매우 걸리적거려 해결방법을 검색하다가 해외포럼에서 해결책을 찾게 되었다. 아래는 그 내용에 대한 정리다.

[원문]
This was a highly unpopular feature introduced to version 8.25 of the GNU coreutils package as recently as 2016, by a consensus of just three developers.

Arguments cited by critics of the change include that it makes the output of ls look considerably more unsightly, unnecessarily diverges from nearly half a century of Unix tradition, and due to the way it was implemented (opt-out instead of opt-in) breaks compatibility with long-standing existing scripts and utilities.

Because the feature was introduced to the coreutils package - which virtually every Linux distribution depends on and which ls is a part of - the change affects every Linux or Linux-like system imaginable, from Arch Linux to Cygwin.

In the case of Debian and Debian-derived distros like Ubuntu, the change was at some point reverted after considerable protest, before being once again reinstated in October 2017.

As this answer makes clear, the best way to register your disappointment at this change would be to contact the coreutils developers directly via a bug report and (politely) make the argument that they've made a huge mistake. As per the open source ethos, a critical mass of users respectfully but adamantly insisting that the way ls used to behave be properly reinstated should in theory be enough to convince the coreutils developers to listen to the Linux community.

[번역]
이것은 단지 3명의 개발자들의 합의에 의해 2016년까지만 해도 GNU 코어유틸스 패키지 버전 8.25에 도입된 매우 인기 없는 기능이었습니다.

이러한 변화에 대한 비평가들이 인용한 주장으로는 ls의 출력을 훨씬 더 보기 흉하게 만들고, 거의 반세기에 걸친 유닉스 전통과 불필요하게 괴리가 있으며, 구현 방식으로 인해 (opt-in 대신 opt-out) 오래된 기존 스크립트 및 유틸리티와의 호환성이 깨진다는 것 등이 있습니다.

이 기능은 사실상 모든 리눅스 배포판이 의존하고 어떤 ls가 속해 있는지에 따라 결정되는 코어유틸리티 패키지에 도입되었기 때문에, 이러한 변화는 Arch Linux에서 Cygwin에 이르기까지 상상할 수 있는 모든 Linux 또는 Linux와 유사한 시스템에 영향을 미칩니다.

우분투와 같은 데비안 및 데비안 파생 디스트로의 경우 상당한 항의 끝에 변경이 어느 정도 번복되었다가 2017년 10월에 다시 복원되었습니다.

이 답변이 분명히 밝힌 바와 같이, 이러한 변화에 대한 실망감을 등록하는 가장 좋은 방법은 버그 보고서를 통해 코어유틸리티 개발자들에게 직접 연락하여 (정중하게) 그들이 큰 실수를 저질렀다고 주장하는 것입니다. 오픈 소스의 기풍에 따르면, 이론적으로 이전에 행동했던 방식이 적절하게 복원되어야 한다고 주장하는 사용자들의 비판적인 집단은 이론적으로 코어유틸리티 개발자들이 리눅스 커뮤니티에 귀를 기울이도록 설득하기에 충분해야 합니다.

[해결책] 2가지 방법 중 편한 것을 이용

1) 로그인 유저의 .bashrc파일에 아래 내용을 추가

export QUOTING_STYLE=literal

[참고] 전체 유저에 적용하고 싶다면 /etc/profile 파일 최하단에 추가하면 된다.

2) ls -N 명령어를 alias 설정

alias ls="ls -N"    ( -N, --literal print entry names without quoting)

위 내용을 적용을 희망하는 계정 내  .bashrc 파일에 추가한다.

원문 : http://www.openssh.com/legacy.html

If the client and server are unable to agree on a mutual set of parameters then the connection will fail. OpenSSH (7.0 and greater) will produce an error message like this:

Unable to negotiate with legacyhost: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 

For the case of the above error message, OpenSSH can be configured to enable the 

diffie-hellman-group1-sha1

 key exchange algorithm (or any other that is disabled by default) using the 

KexAlgorithms

 option - either on the command-line:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@legacyhost 

or in the ~/.ssh/config file:

Host somehost.example.org 
KexAlgorithms +diffie-hellman-group1-sha1 

OpenSSH 7.0 이상에서는 해당 옵션이 기본으로 enable 되어 있지 않기 때문에옵션을 넣어줘야 한다.항상 넣기 귀찮으니 config를 만들어서 넣고 쓰도록 하자.config파일이 없으면 그냥 생성하면 적용 됨.

OpenSSH 버전확인 명령어 : ssh -V

출처: https://bluelimn.tistory.com/entry/ssh사용-시-diffiehellmangroup1sha1-관련 [ANMIAN:티스토리]

1. intl 설치

# cd /usr/local/src/php-5.6.25/ext/intl
# /usr/local/php/bin/php/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-intl
# make && make install
# vi /usr/local/apache/conf/php.ini
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=intl.so

설치 시 오류사항

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
# yum install libicu-devel

2. soap 설치

# cd /usr/local/src/php-5.6.25/ext/soap (실제 php 소스파일의 경로는 이와 다를 수 있음)
# ./configure --enable-soap --with-php-config=/usr/local/php/bin/php-config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# vi /etc/httpd/conf/php.ini (아파치 설치 경로에 따라 다를 수 있음)
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=soap.so

3. imagick 설치

1) 필수 패키지 설치

yum -y install ImageMagick ImageMagick-devel

2) 최신 파일 다운로드 및 설치

최신 버전 다운로드 사이트 : http://pecl.php.net/package-stats.php 

# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-3.4.3.tgz
# tar xvfz imagick-3.4.3.tgz
# cd imagick-3.4.3
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

# vi /etc/httpd/conf/php.ini (아파치 설치 경로에 따라 다를 수 있음)
[extension]
extension_dir=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
extension=imagick.so

설치 시 오류사항

php-config 실행시 아래와 같이 에러 발생 시
configure: error: Cannot locate header file MagickWand.h
이는 MagickWand.h 파일이 들어있는 디렉토리의 이름이 ImageMagick 가 아닐 경우 나온다.  
ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick (심볼릭 링크 처리)

3) 아파치 재시작 후 모듈 적재 확인

아파치 재시작 후 /usr/local/php/bin/php -m 실행 결과 목록에 Imagick가 있는 경우 정상 로드 된 것임.
세부적인 확인은 /usr/local/php/bin/php -i | grep -i imagick 입력 하면 자세한 모듈 정보를 불러온다.

'Works > 확장모듈설치매뉴얼' 카테고리의 다른 글

apache mod_proxy.so 컴파일 방법  (0) 2023.09.08
apache mod_unique_id module 추가  (0) 2023.04.20
[PHP] GeoIP 확장(Extension) 모듈 설치  (0) 2017.08.11
Zend Guard Loader 설치  (0) 2017.05.17
APC 확장모듈 설치  (0) 2017.04.26

인증서는 보통 1년 또는 2년짜리로 발급받으며, 제때에 인증서를 업데이트 하지 않으면 사용자에 불편을 초래할 수 있다.

SSL 인증서 만료기간을 확인하는 방법은 아래와 같다.

1. 브라우저 주소창에서 인증서 확인하기

브라우저 주소 입력창에서 https:// 로 호출 한 후, "자물쇠" 모양을 클릭하면 인증서 기간(시작일자 - 만료일자)을 확인할 수 있다.

2. openssl 명령어로 cert 파일 해독하기

* 명령어
$ openssl x509 -in [SSL 인증서 경로]/[cert 파일명] -noout -dates

* 예시)

$ openssl x509 -in /data/www_sample.crt -noout -dates

notBefore=May 2 09:10:11 2020 GMT
notAfter=May 1 09:10:11 2021 GMT

3. openssl 명령어로 원격에 설치되어 있는 인증서 만료일 확인

* 명령어
$ echo | openssl s_client -servername [서버/DNS] -connect [서버/DNS:포트] 2>/dev/null | openssl x509 -noout -dates

* 예시)

$ echo | openssl s_client -servername www.sample.co.kr -connect www.sample.co.kr:443 2>/dev/null | openssl x509 -noout -dates
또는
$ echo | openssl s_client -servername 10.x.x.x -connect 10.x.x.x:443 2>/dev/null | openssl x509 -noout -dates

notBefore=May 2 09:10:11 2020 GMT
notAfter=May 1 09:10:11 2021 GMT

APACHE 2.4에 SSL을 적용 후 재구동하였을때 아래와 같은 메세지가 나왔다

AH00526: Syntax error on line 92 of /usr/local/apache/conf/extra/httpd-ssl.conf:

SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).

위 에러는 모듈을 로드 해줘야 한다

httpd.conf 를 열어 아래의 모듈을 추가 해주자

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

추가 후 APACHE를 재구동 해주면 정상작동되는 것을 확인 할 수 있다.


출처 : https://note-it.tistory.com/29

파일 탐색기 다시 시작
파일 탐색기는 전체 Windows 시스템의 기본 프로세스 중 하나입니다. 좋은 출발점은 다시 시작하고 문제의 파일이나 폴더가 나중에 잠금 해제되는지 확인하는 것입니다.

CTRL+ALT+DELETE를 눌러 작업 관리자를 엽니다.
프로세스 탭에서 Windows 탐색기를 찾습니다.
마우스 오른쪽 버튼으로 클릭하고 드롭다운 메뉴에서 다시 시작을 선택합니다.
이제 오류가 사라졌는지 확인하십시오.

apache 설정에서 proxy를 사용하기 위해서 mod_proxy 와 관련된 몇가지 so파일들을 컴파일 하는 방법에 대해 정리해 드리겠습니다.

별로 어렵지 않으니 따라하시다 보면 /modules/ 안에 mod_proxy.so파일이 생성된걸 확인하실수 있으실거예요.

apache mod_proxy.so 컴파일 방법

1) /apache/httpd-2.2.34/modules/proxy 해당 경로 이동

2) 아래 4개 컴파일 수행 (apache-2.2.34 설치된곳 경로지정)

/apache/apache-2.2.34/bin/apxs -i -a -c mod_proxy.c proxy_util.c

/apache/apache-2.2.34bin/apxs -i -a -c mod_proxy_http.c proxy_util.c

/apache/apache-2.2.34bin/apxs -i -a -c mod_proxy_connect.c proxy_util.c

/apache/apache-2.2.34/bin/apxs -i -a -c mod_proxy_ajp.c proxy_util.c ajp_header.c ajp_utils.c ajp_link.c ajp_msg.c

3) /apache/apache-2.2.34/modules 경로에 proxy 관련 파일 생성 확인 (4개)

mod_proxy_ajp.so
mod_proxy_connect.so
mod_proxy_http.so
mod_proxy.so

4) httpd.conf 에 삽입

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

위처럼 하시면 일단 apache 에서 proxy를 사용하기 위핸 최소 조건인 mod_proxy.so파일의 설정이 완료된것입니다.

그럼 열공하세요..^^~

출처 : https://m.blog.naver.com/kletgdgo/90141426279

[root@localhost bin]# ./httpd -t

httpd: Syntax error on line 150 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: unixd_config

아파치 시동시에 위와 같은 에러가 뜬다.

버전정보는

Server version: Apache/2.4.53 (Unix)
PHP 5.2.17 (cli)

보통 위 에러는 apache2와 php4.x로 컴파일 할때에 생기는 오류지만 apache2.4와 php5.2에서도 발생이 되기도 한다.
php압축해제경로/sapi/apache2handler/에서 php_functions.c 파일을 일부 수정한다.
 
[PHP 5.2.17 의 경우]

>line 386

#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
        AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
#endif

 

>line 417

#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
        snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
        php_info_print_table_row(2, "User/Group", tmp);
#endif

 

재 컴파일 후 Syntax 테스트

[root@localhost bin]# ./httpd -t
Syntax OK

[PHP 4.4.8 의 경우]

php4소스파일에서 아래 경로의 파일을 수정해야합니다.

/sapi/apache2handler/php_functions.c

붉게 표시된 부분을 기존 unixd_config -> ap_unixd_config로 수정

373라인
AP_DECLARE_DATA extern unixd_config_rec unixd_config;

404라인
snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);

ap_get_server_version -> ap_get_server_banner로 수정

327라인
return (char *) ap_get_server_version();

수정 후 에 재 컴파일

출처 : https://rootrator.tistory.com/112

 

apache 시동시 에러 "undefined symbol: unixd_config"

[root@localhost bin]# ./httpd -thttpd: Syntax error on line 150 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: unixd_config 아파치 시동시에 위와 같은 에

rootrator.tistory.com

출처 : https://darksharavim.tistory.com/333

 

[PHP]libphp4.so: undefined symbol 오류

환경 : centos7+apache2.4.6(RPM)+php4.4.9(src) 위 환경에서 아파치 구동시 아래와 같이 오류가 발생하여 확인해본 결과 libphp4.so: undefined symbol: unixd_config libphp4.so: undefined symbol: ap_get_server_version apache버전업

darksharavim.tistory.com

 

프로젝트를 진행하면서 특정폴더 안에 있는 파일리스트가 필요한 상황이었는데

DOS 명령어중 dir 명령어에 옵션을 넣어 사용하면 쉽게 파일 리스트를 텍스트 파일로 저장할 수 있습니다.

dir/b

dir 명령어에 /b 옵션을 붙이면  아래와 같이 파일명들만 출력됩니다.

dir/b 명령 결과

dir/b/s

여기에 /s 옵션을 더해주면 파일의 full 경로가 아래처럼 출력됩니다.

dir/b/s 명령 결과

이제 여기서 화면에 출력된 내용을 텍스트 파일로만 저장하면 됩니다.

방법은 > 기호를 사용하여 파일로 저장할 수 있습니다.

위와 같은 명령어를 실행하면 FileList.txt 파일로  파일리스트가 아래와 같이 저장됩니다.

참 쉽죠? ^^