블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

2022. 3. 10. 14:19 Linux

[서버 환경]

CentOS 7.2

 

리눅스에서 PHP Composer 설치는 아래와 같이 curl, 혹은 php -r 옵션을 이용해 설치가 가능하다.

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/
php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin/

설치후 symbolic link

sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer

하지만 아래와 같은 오류가 나는 경우가 있는데

 

PHP Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in Command line code on line 1 PHP Warning: copy(): Failed to enable crypto in Command line code on line 1 PHP Warning: copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1

 

 

아래와 같이 해결 가능하다.

 

wget http://curl.haxx.se/ca/cacert.pem

 

php.ini에서 편집

 

openssl.cafile=저장경로/cacert.pem

반응형
posted by Rootrator
2021. 7. 5. 16:12 Linux

[서버 환경]

CentOS6.5 32bit

 

CentOS6은 2020/11/30 시점으로 end of life cycle 에 따라 지원 종료되었다.

따라서 기본 yum repositary도 전부 사용이 불가능하게 변경되었다.

 

이럴 경우 repo 변경으로 임시로 사용이 가능하지만

EOL(End-of-life)된 버전은 새로운 버전으로 마이그레이션 해주는 것이 좋다.

 

 

[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)

[root@localhost ~]# yum info httpd
Loaded plugins: fastestmirror, security
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

 

지원종료된 상태에선 yum 실행시 위와 같은 메세지를 보게 된다.

 

centos에선 EOL제품의 repo를 별도로 제공하고 있으니 repo를 변경해 주자.

 

[root@localhost ~]# cd /etc/yum.repo.d/

[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo_EOL

[root@localhost ~]# vi CentOS-Base.repo

[base]
name=CentOS-$releasever -  Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
priority=1
protect=1

[update]
name=CentOS-$releasever -  Updates
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=0
priority=1
protect=1

 

위 내용을 넣어주고 yum을 다시 실행 시켜보자.

워낙 오래된 버전일 경우 openssl 버전이 낮아 ssl오류 메시지가 보이지만 실행은 된다.

 

[root@localhost /etc/yum.repos.d]# yum info httpd
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * epel: d2lzkl7pfhq30w.cloudfront.net
base                                                                                                                                                                                       | 3.7 kB     00:00
http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-6/i386/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-6/SRPMS/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
update                                                                                                                                                                                     | 3.4 kB     00:00
update/primary_db                                                                                                                                                                          |  11 MB     00:35
Available Packages
Name        : httpd
Arch        : i686
Version     : 2.2.15
Release     : 69.el6.centos
Size        : 844 k
Repo        : base
Summary     : Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

반응형

'Linux' 카테고리의 다른 글

PHP Composer 설치시 오류  (0) 2022.03.10
CentOS8 설치 : Raid Disk가 안보일 경우  (0) 2021.03.04
libphp5.so: undefined symbol: unixd_config  (1) 2019.08.29
tar exclude 옵션 사용  (0) 2019.08.09
R 설치와 devtools 설치  (0) 2019.07.22
posted by Rootrator
2021. 3. 4. 17:41 Linux

access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/hardware-enablement_considerations-in-adopting-rhel-8#removed-adapters_hardware-enablement

 

Chapter 11. Hardware enablement Red Hat Enterprise Linux 8 | Red Hat Customer Portal

The Red Hat Customer Portal delivers the knowledge, expertise, and guidance available through your Red Hat subscription.

access.redhat.com

 

레드헷에 따르면 RH8 에서 많은 Driver와 Adapter가 remove되었다고 한다.

 

설치 단계에서 Raid Disk가 목록에 보이지 않는다면 드라이버를 직접 올려줘야 한다.

 

 

현재 설치하려는 시스템은 R430 으로 megaraid-sas 를 사용한다.

 

elrepo.org/linux/dud/el8/x86_64/ 에서 자신에게 맞는 드라이버를 찾아 USB에 ISO파일 그대로 담아준다.

 

1] 설치 화면에서 Tab으로 설치 옵션 뒤에 추가해준다.

 modprobe.blacklist=ahci inst.dd

 

2] 설치 단계에서 Driver가 담겨있는 USB를 선택해준다.

(Page 1 of 1) Driver disk divice selection

      /DEVICE TYPE     LABEL                      UUID

    1) sda1

    2) sdb1

 

3] Device에 담긴 ISO 파일 리스트가 나오는데 파일 선택 후 진행해 주면 된다.

 

반응형
posted by Rootrator
2019. 8. 29. 16:45 Linux

[설치 환경]

CentOS 6.10 64bit

Apache 2.4.9

php 5.2.17

 

apache 2.4 버전에서 생기는 문제 같은데 해당 오류가 발생하게 아래 경로의 파일을 수정해 줘야 한다.

 

]# cd /소스파일 압축해제 경로/sapi/apache2handler/

]# vi php_function.c

 

파일을 편집기로 열고 unix_config를 ap_unix_config로 수정해 주면 된다.

총 4군데로 386, 417 라인에 존재한다.

 

재컴파일 후 확인해 보면 오류가 사라진다.

반응형
posted by Rootrator
2019. 8. 9. 16:50 Linux

[서버 환경]

CentOS 6.9

 

tar를 이용해서 데이터를 압축시 log파일 혹은 session파일같이 큰 의미는 없지만 갯수가 너무 많아

 

데이터 압축이 굉장이 오래 걸릴 경우 exclude를 통해 해당 디렉토리를 제외할수 있다.

 

/home 아래에 abc라는 계정 밑에 public_html/log/logs 를 제외할 경우

 

현재 디렉토리를 /home이라고 했을때

 

]# cd /home

]# tar cvzfp backup_abc_log.tar.gz --exlclude "./abc/public_html/log/logs" ./abc/

 

--exclude 혹은 -X로 사용 가능하며 확장자가 log파일만 제외할 경우 *.log 로 사용도 가능하다.

반응형

'Linux' 카테고리의 다른 글

CentOS8 설치 : Raid Disk가 안보일 경우  (0) 2021.03.04
libphp5.so: undefined symbol: unixd_config  (1) 2019.08.29
R 설치와 devtools 설치  (0) 2019.07.22
CentOS7 SSL 인증서 설치하기  (0) 2018.11.28
대량 파일 삭제하기  (0) 2018.09.12
posted by Rootrator
2019. 7. 22. 16:25 Linux

[설치환경]

Unutu 16.04

 

R repository 추가

sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list

 

R keystring 생성

gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9

gpg -a --export E084DAB9 | sudo apt-key add -

 

 

sudo apt-get update

sudo apt-get install r-base r-base-dev

 

간혹 dependency 관련 오류가 날 경우 repo를 잘 확인해 보자.

 

 

R --vanilla

install.packages("devtools")

.

.

.

.

 

/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppExports.o' failed
make: *** [RcppExports.o] Error 1

 

R에서 devtools 설치시 컴파일 에러 발생

 

 

Rscript -e 'rhub::check_with_sanitizers(env_vars = c(MAKEFLAGS = "CXX11FLAGS+=-std=c++11\\ -Wno-ignored-attributes CXXFLAGS+=-std=c++11\\ -Wno-ignored-attributes"))'

R실행 후 xml2 설치 진행

OR

R실행 후 withr::with_makevars(c(CXX = "g++ -std=c++11"),install.packages("xml2", verbose = TRUE))

 

이후 devtools 설치 다시 진행

반응형

'Linux' 카테고리의 다른 글

libphp5.so: undefined symbol: unixd_config  (1) 2019.08.29
tar exclude 옵션 사용  (0) 2019.08.09
CentOS7 SSL 인증서 설치하기  (0) 2018.11.28
대량 파일 삭제하기  (0) 2018.09.12
php_screw 설치하여 php 소스코드 암호화  (0) 2017.03.22
posted by Rootrator
2018. 11. 28. 16:40 Linux


[서버환경]

CentOS 7.2

Apache 2.4


Yum으로 설치되었으며 mod_ssl 설치가 안되어 설치를 진행.


]# yum -y install mod_ssl


conf.d 아래이 ssl.conf 가 생성된다. 해당 설정파일에서 가상호스트를 작성한다.


<VirtualHost _default_:443> 해당 부분을 알맞게 수정.


<VirtualHost *:443>

 ServerName abc.com

 ServerAlias www.abc.com

 DocumtnRoot /home/abc/www


 SSLEngine On

 SSLCertificateFile /etc/httpd/cert/abc.com.crt

 SSLCertificateKeyFile /etc/httpd/cert/abc.com.key

</VirtualHost>


]# service httpd restart

Redirecting to /bin/systemctl restart  httpd.service



서비스 재시작하는 부분에서 에러가 뜰수 있는데 해당 내용을 살펴보면


]# systemctl status httpd.service

------------------------httpd[3100]: In order to read them you have to provide the pass phrases.


Pass Phrase 요구한다.


Pass를 Key파일안에 삽입하기로 한다.


]# openssl rsa -in /etc/httpd/cert/abc.com.key -out /etc/httpd/cert/abc.com.key

Enter pass phrase for abc.com.key:

writing RSA key



이후 서비스 재시작


]# service httpd restart

Redirecting to /bin/systemctl restart  httpd.service


포트 확인


]# netstat -lnp | grep 443

tcp6       0      0 :::443                  :::*                    LISTEN      3794/httpd



반응형
posted by Rootrator
2018. 9. 12. 15:53 Linux

[서버환경]

CentOS 5.9




대량 파일을 삭제할 경우에


rm -rf * 삭제시에도 제대로 삭제가 되지 않고 오류가 나온다.


"rm :  arg list too long"







ls -1 -f | xargs rm


위 명령어로는 ls의 기본 옵션인 sort 기능을 끄고 파일 이름을 가져와 rm 시키기 때문에


비교적 빠르게 삭제할 수 있다.

반응형
posted by Rootrator
2017. 3. 22. 13:26 Linux

[서버환경]

Ubuntu 14.04

php-5.5



php_screw 파일 다운은 https://sourceforge.net/projects/php-screw/ 에서 받을수 있으며,


현재일 기준 1.5가 최신버전이다.


다운로드 후에 압축해제한다.


]# wget http://sourceforge.net/projects/php-screw/files/latest/download?source=files

]# tar xvzfp php_screw-1.5.tar.gz

]# cd php_screw-1.5/


설치전에 seed값을 변경하여 암호화/복호화의 사용되는 키값을 변경


]# vi my_screw.h

short pm9screw_mycryptkey[] = {

12311, 312, 4422, 534, 11, 849, 125

};


저장하고 컴파일을 진행한다.


]# phpize

]# ./configure

]# make

make 시에 오류가 뜨는데 php_screw.c파일을 열어 가장 마지막의 CG(extended_info) = 1; 두곳을 주석처리 해준다.


]# vi php_screw.c

PHP_MINIT_FUNCTION(php_screw)

{

        //CG(extended_info) = 1;


        org_compile_file = zend_compile_file;

        zend_compile_file = pm9screw_compile_file;

        return SUCCESS;

}


PHP_MSHUTDOWN_FUNCTION(php_screw)

{

        //CG(extended_info) = 1;

        zend_compile_file = org_compile_file;

        return SUCCESS;

}


]# make

]# make install


so 파일을 extension_dir 에 복사후에 php.ini에 직접 extension을 넣어줘도 되고 아래와 같이 ini파일은 등록해도 된다.


]# cd /etc/php5/mods-available/

]# vi screw.ini

extenion=php_screw.so


]# cd /etc/php5/cli/conf.d/

]# ln -s ../../mods-available/screw.ini 90-screw.ini


이후에 아파치 재시작으로 php_screw 모듈을 설치된다.


php_screw 소스파일 경로로 다시 이동해서 tools/ 로 이동하여 make 실행.


]# cd /usr/local/src/php_screw-1.5/tools/

]# make 


실행하여 생성된 screw가 encryptor파일로 bin 디렉토리로 이동


]# cp -arp screw /usr/bin/screw


사용법은

]# screw 암호화할 php파일의 절대경로


결과물로 php파일은 암호화되고 암호화되기 전의 파일은 php.screw파일로 생성된다.



반응형
posted by Rootrator
2016. 2. 19. 15:50 Linux

OS : CentOS 6.7 32bit

Mysql 5.1.63


mysql function 생성시 아래와 같은 에러 발생

This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)



mysql 에서 아래와 같이 확인해 보면 값이 Off로 설정이 되어있다.

mysql> show global variables like 'log_bin_trust_function_creators';

+---------------------------------+-------+

| Variable_name                       | Value |

+---------------------------------+-------+

| log_bin_trust_function_creators     | OFF  |

+---------------------------------+-------+

1 row in set (0.00 sec)


mysql>SET GLOBAL log_bin_trust_function_creators = 1; 

 

쿼리를 실행시켜주거나 my.cnf 설정 시키거나 실행시에 추가하여 서비스를 올리면 된다.



기존의 서버에서 dump로 function을 가져올땐 --routines 

trigger를 가져올땐 --trigger 옵션으로 포함시킬수 있다.





반응형
posted by Rootrator