'분류 전체보기'에 해당되는 글 93건

  1. 2017.09.09 [Trouble Shooting] wordpress 설치도중 500에러 2
  2. 2017.08.08 [기타] rsync 설치 및 사용법
  3. 2017.08.03 [apache] letsencrypt 설치 및 설정 2
  4. 2017.08.03 [ 기타 ] vsftpd 설치
  5. 2017.07.20 [Trouble Shooting] putty 접속시 한글깨짐현상
  6. 2017.06.03 [apache] ssl 키 발급 및 적용
  7. 2017.05.09 [php 언어셋 문제]
  8. 2017.04.27 [ 윈도우서버 ] 가상서버에서 시간 동기화를 해도 시간 틀어질 때
  9. 2017.04.27 [apache] cband 모듈설치
  10. 2017.04.26 [apache] rewrite 모듈을 이용한 http -> https 포워딩
  11. 2017.04.05 [php] pecl_http , raphf , propro 모듈설치
  12. 2017.03.09 [기타] 리눅스 시간 동기화
  13. 2017.02.20 [mysql] myisam -> innodb 변경
  14. 2017.02.18 [트러블슈팅] sendmail @localhost.localdomain
  15. 2017.01.31 [기타] phpmyadmin yum으로 설치
  16. 2017.01.25 [기타] tcpdump 사용방법
  17. 2017.01.10 [apache] 모듈 userdir
  18. 2017.01.08 [기타] 바이오스설정
  19. 2017.01.08 [기타] path 설정방법
  20. 2017.01.06 [트러블슈팅] vi 들여쓰기문제
  21. 2017.01.06 [업무파악] 스위치 셋팅 (엣지코어L2)
  22. 2016.12.22 [기타] parted 사용법
  23. 2016.12.14 [php] php버전별 컨피그값
  24. 2016.12.14 [개발공부] php 개발
  25. 2016.12.09 [mysql] 버전별 컨피그 값
  26. 2016.12.04 [기타] root 계정으로 바로 접근 막기
  27. 2016.12.04 [기타] centos7 싱글모드 진입
  28. 2016.11.27 [기타] tomcat 설치 및 연동
  29. 2016.11.27 [기타] java 설치방법
  30. 2016.11.15 [mysql] mysql5.5.29 버전 my.cnf 기본값

[ wordpress 설치도중 500에러 ]


wordpress 를 다운로드 후 웹에서 접근할 경우 500에러가 발생되는 경우가 있다.


php.ini 에서 memory_limit = 32M 를 올려준다.


수정전 memory_limit = 32M


수정후 memory_limit = 64M



Posted by 실력키우기

[ rsync 설치 ]


# rpm -qa |grep rsync    -->    해당 패키지 설치되어있는지 확인 , 없을경우 설치


# yum install -y rsync


# rpm -qa |grep xinetd   -->    해당 패키지 설치되어있는지 확인 , 없을경우 설치


# yum install -y xinetd




# vi /etc/rsyncd.conf      -->     해당 파일이 없을 가능성이 크다. 해당 파일이 없을경우 vi 로 만들고 아래 내용 추가


[rsync_test]                  -->     사용할 rsync 서비스 이름

path=/data/rsync_test/        -->     데이터 원본 경로

comment = rsync_test        -->     코멘트

uid = root                    -->    권한 사용자

gid = root                    -->    권한 그룹

use chroot = yes

read only = yes

#hosts allow = 115.68.220.220    --> rsync 클라이언트 IP. localhost일 경우 입력하지 않아도 됨

max connections = 3

timeout=600



# vi /etc/xinetd.d/rsync 


service rsync

{

    disable = yes    -->    no로 변경

    flags       = IPv6

    socket_type     = stream

    wait            = no

    user            = root

    server          = /usr/bin/rsync

    server_args     = --daemon

    log_on_failure  += USERID


# /etc/init.d/xinetd restart




[ rsync 사용법 ]


[ 현재 접속한서버에서 다른서버로 파일을 보낼 경우 ]


rsync -avzPog /usr/local/src/test les@115.68.220.220:/home/les/    ->    해당서버의 test파일을 220.220번 서버의 /home/les/ 에 복사


rsync -avzPog -e 'ssh -p1990' java les@115.68.220.220:/home/les/     ->    위에 내용과 같지만, 다른점은 원격포트가 22번이 아닌 1990일때 옵션값 추가



[ 현재 접속한서버에서 다른서버의 파일을 가져올 경우 ]

rsync -avzPog les@115.68.220.220:/home/les/test /usr/local/src/    ->    220.220서버의 /home/les/test 파일을 현재 서버의 /usr/local/src/ 경로에 복사


rsync -avzPog -e 'ssh -p1990' les@115.68.220.220:/home/les/test /usr/local/src/    ->    위에 내용과 같지만,다른점은  원격포트가 1990일때 옵션값 추가





'Linux Server > etc' 카테고리의 다른 글

[ 기타 ] 해킹점검  (0) 2018.03.02
[기타] Iptables 설치 및 설정  (1) 2018.02.26
[기타] 리눅스 시간 동기화  (0) 2017.03.09
[기타] tcpdump 사용방법  (0) 2017.01.25
[기타] 바이오스설정  (0) 2017.01.08
Posted by 실력키우기

[ letsencrypt 설치 및 설정 ]


# git clone https://github.com/letsencrypt/letsencrypt


# cd letsencrypt


# ./letsencrypt-auto --help     ->  다운받은 폴더로 이동 후 아래 명령을 실행하면 자동으로 관련 의존성을 다운받아서 설치 된다.


# ./letsencrypt-auto certonly -a webroot --agree-tos -m <이메일> -w <webrootpath> -d <SSL발급도메인명> --rsa-key-size 4096

ex) ./letsencrypt-auto certonly -a webroot --agree-tos -m les4707@naver.com -w /home/web/ -d leeeunseok.xyz --rsa-key-size 4096



주의) 발급을 원하는 도메인은 반드시 웹접속이 가능한 상태어어야 한다. ( 웹서버, DNS , 방화벽 확인 필요)
 (주) 최초 발급 시도시 아래의 메세지가 표시되며, 이후 물어보지 않는다.
 EFF의 Let’s Encrypt 관련 소식을 이메일로 받고 싶다면 “y”를 원하지 않는 다면, “n” 입력 한다.
-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: n



기본 포트를 SSL으로 이용하는 경우


vi /usr/local/apache/conf/extra/httpd-ssl.conf


<VirtualHost *:443>


DocumentRoot 웹루트경로

ServerName 도메인명:443

SSLEngine on 

SSLCertificateFile /etc/letsencrypt/live/도메인명/cert.pem

SSLCertificateKeyFile /etc/letsencrypt/live/도메인명 /privkey.pem

SSLCertificateChainFile /etc/letsencrypt/live/도메인명/fullchain.pem  


<VirtualHost>


이후 아파치 재시작


[root@techsmile-6580 letsencrypt]# /etc/init.d/apachectl stop

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

Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration


아파치 재시작시 위와 같이 에러발생할경우 아래파일을 열고 주석해제

vi /usr/local/apache/conf/httpd.conf

LoadModule ssl_module modules/mod_ssl.so -> 해당부분 주석해제



[root@techsmile-6580 letsencrypt]# /etc/init.d/apachectl stop

AH00526: Syntax error on line 76 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?).


아파치 재시작시 위와 같이 에러발생할경우 아래파일을 열고 주석해제

vi /usr/local/apache/conf/httpd.conf

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so     -> 해당부분 주석해제





letsencrypt는 3달에 한번씩 갱신해줘야하며, 아래 내용은 도메인 갱신하는 명령어입니다.


/letsencrypt-auto certonly -a webroot --agree-tos --renew-by-default -w <webrootpath> -d <ssl갱신도메인명> --rsa-key-size 4096



vi letscron.sh    ->    스크립트 만들고 크론탭에 약2달에한번 실행되도록 등록할것

#!bin/sh

echo /letsencrypt-auto certonly -a webroot --agree-tos --renew-by-default -w /home/web/ -d leeeunseok.xyz --rsa-key-size 4096

'Linux Server > apache' 카테고리의 다른 글

[apache] http_error_code  (0) 2018.02.26
[apache] ip 접속 제어  (0) 2018.02.09
[apache] ssl 키 발급 및 적용  (0) 2017.06.03
[php 언어셋 문제]  (0) 2017.05.09
[apache] cband 모듈설치  (0) 2017.04.27
Posted by 실력키우기

[ vsftpd 설치]


# yum install -y vsftpd    ->    설치


# vi /etc/sysconfig/iptables  -> 20, 50001:50005 포트등록


# vi /etc/vsftpd/vsftpd.conf    ->    해당파일 열어서 전부 지우고 아래내용 삽입


anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

xferlog_file=/var/log/xferlog

xferlog_std_format=YES

chroot_local_user=YES

listen=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES


pasv_enable=yes

pasv_min_port=50001

pasv_max_port=50005



# /etc/init.d/vsftpd restart    ->    ftp 재시작

'Linux Server > Server 구축' 카테고리의 다른 글

[기타] 우분투 repository 구축  (0) 2018.08.26
[기타] mediawiki 설치 방법  (0) 2018.08.26
[기타] phpmyadmin yum으로 설치  (0) 2017.01.31
[기타] tomcat 설치 및 연동  (0) 2016.11.27
[기타] java 설치방법  (0) 2016.11.27
Posted by 실력키우기

[ putty 접속시 한글깨짐현상 ]


putty 실행 -> Translation -> CP949


없을경우 use front encofing 선택후 접속

Posted by 실력키우기

[ openssl 키발급

# openssl genrsa -des3 -out leeeunseok.xyz.key 2048

# openssl req -new -key leeeunseok.xyz.key -out leeeunseok.xyz.csr


Country Name ( 국가코드) [] : KR
State or Province Name ( 지역 ) [] : Seoul
Locality Name ( 시/군/구 ) [] : Seocho
Organization Name ( 회사명 ) [] : Hanbiro Inc
Organizational Unit Name ( 부서명 ) [] : Linux Team
Common Name ( 서비스도메인명 ) [] : www.hanbiro.com
Email Address [] : hanbiro@hanbiro.com




[ ssl 적용 


apache 2.4버전 



Listen 443


##

##  SSL Global Context

##

##  All SSL configuration in this context applies both to

##  the main server and all SSL-enabled virtual hosts.

##


#   SSL Cipher Suite:

#   List the ciphers that the client is permitted to negotiate.

#   See the mod_ssl documentation for a complete list.

SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5


#   Speed-optimized SSL Cipher configuration:

#   If speed is your main concern (on busy HTTPS servers e.g.),

#   you might want to force clients to specific, performance

#   optimized ciphers. In this case, prepend those ciphers

#   to the SSLCipherSuite list, and enable SSLHonorCipherOrder.

#   Caveat: by giving precedence to RC4-SHA and AES128-SHA

#   (as in the example below), most connections will no longer

#   have perfect forward secrecy - if the server's key is

#   compromised, captures of past or future traffic must be

#   considered compromised, too.

#SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5

#SSLHonorCipherOrder on 


#   Pass Phrase Dialog:

#   Configure the pass phrase gathering process.

#   The filtering dialog program (`builtin' is an internal

#   terminal dialog) has to provide the pass phrase on stdout.

#SSLPassPhraseDialog  builtin

SSLPassPhraseDialog exec:/usr/local/apache/conf/ssl_pass.sh


#   Inter-Process Session Cache:

#   Configure the SSL Session Cache: First the mechanism 

#   to use and second the expiring timeout (in seconds).

#SSLSessionCache         "dbm:/usr/local/apache/logs/ssl_scache"

SSLSessionCache        "shmcb:/usr/local/apache/logs/ssl_scache(512000)"

SSLSessionCacheTimeout  300


##

## SSL Virtual Host Context


<VirtualHost _default_:443>


#   General setup for the virtual host



ServerAdmin joyjts@naver.com

DocumentRoot /home/les/public_html

ServerName leeeunseok.com:443

ErrorLog "/usr/local/apache/logs/leeeunseok.com_SSL_error_log"

TransferLog "/usr/local/apache/logs/leeeunseok.com_SSL_access_log"


#   SSL Engine Switch:

#   Enable/Disable SSL for this virtual host.

SSLEngine on


SSLCertificateFile "/usr/local/apache/conf/SSL_2017/leeeunseok.com_cert.pem"

SSLCertificateKeyFile "/usr/local/apache/conf/SSL_2017/leeeunseok.com.key"

SSLCertificateChainFile "/usr/local/apache/conf/SSL_2017/leeeunseok.com_ChainCA.crt"



위처럼 키값 및 패스워드 자동 적용되도록 설정 후 /usr/local/apache/conf/ssl_pass.sh로 스크립트 생성

vi ssl_pass.sh

#!/bin/sh 
echo "password"


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



Listen 443


AddType application/x-x509-ca-cert .crt

AddType application/x-pkcs7-crl    .crl


SSLPassPhraseDialog  builtin

SSLSessionCache        "shmcb:/usr/local/apache/logs/ssl_scache(512000)"

SSLSessionCacheTimeout  300

#SSLMutex  "file:/usr/local/apache/logs/ssl_mutex"


<VirtualHost int.empel.co.kr:443>

DocumentRoot "/home/les/public_html"

ServerName int.les.co.kr:443

ServerAlias int.les.co.kr

ErrorLog "/usr/local/apache/logs/error_log"

TransferLog "/usr/local/apache/logs/access_log"

SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile "/usr/local/apache/conf/extra/SSL/empel/int.les.co.kr.crt"

SSLCertificateKeyFile "/usr/local/apache/conf/extra/SSL/empel/int.les.co.kr.key"

SSLCertificateChainFile "/usr/local/apache/conf/extra/SSL/empel/int.les.co.kr.Chain.crt"

<FilesMatch "\.(cgi|shtml|phtml|php)$">

    SSLOptions +StdEnvVars

</FilesMatch>

<Directory "/usr/local/apache/cgi-bin">

    SSLOptions +StdEnvVars

</Directory>

BrowserMatch ".*MSIE.*" \

         nokeepalive ssl-unclean-shutdown \

         downgrade-1.0 force-response-1.0

CustomLog "/usr/local/apache/logs/ssl_request_log" \

          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>


'Linux Server > apache' 카테고리의 다른 글

[apache] ip 접속 제어  (0) 2018.02.09
[apache] letsencrypt 설치 및 설정  (2) 2017.08.03
[php 언어셋 문제]  (0) 2017.05.09
[apache] cband 모듈설치  (0) 2017.04.27
[apache] rewrite 모듈을 이용한 http -> https 포워딩  (0) 2017.04.26
Posted by 실력키우기

http://m.blog.naver.com/csaiur/220237429476

Posted by 실력키우기

[ 윈도우 가상서버에서 시간 동기화를 해도 시간 틀어질 때 ]

가상 윈도우 서버에서 시간 동기화를 해도 시간이 틀어지는 경우가 있습니다.

그럴경우 hyper-v time synchronization service  서비스를 사용 안함으로 바꿔주면 해결이 됩니다.

"시작” 버튼 클릭    ->     “실행”    ->     "services.msc"  입력    ->     서비스 목록 에서 hyper-v time synchronization service 서비스 중지 및 사용안함으로 변경

Windows 2012 는 서버관리자 실행    ->    도구    ->    서비스   클릭하여 해당 서비스 중지 및 사용안함 변경



Posted by 실력키우기

[cband 모듈설치]


cband 모듈이란 도메인 별로 트래픽을 제한할수 있으며, 트래픽 사용량을 확인할 수 있다.



# tar -zxvf mod-cband-0.9.7.5.gz    ->    해당 파일 압축풀기


# cd mod-cband-0.9.7.5    ->    해당 결로 이동


# ./configure --with-apxs=/usr/local/apache/bin/apxs    ->    컨피그


# make    ->    make 시 아래처럼 에러가 발생할 가능성이 있다.


/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c

/usr/local/apache/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include  -Wall -DDST_CLASS=3  -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo

src/mod_cband.c: In function 'mod_cband_create_traffic_size':

src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior

src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior

src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior

src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior

src/mod_cband.c: In function 'mod_cband_get_dst':

src/mod_cband.c:1333: error: 'conn_rec' has no member named 'remote_ip'

src/mod_cband.c: In function 'mod_cband_get_remote_host':

src/mod_cband.c:1362: error: 'struct conn_rec' has no member named 'remote_ip'

src/mod_cband.c:1363: error: 'struct conn_rec' has no member named 'remote_ip'

src/mod_cband.c:1365: error: 'struct conn_rec' has no member named 'remote_addr'

apxs:Error: Command failed with rc=65536

.

make: *** [src/.libs/mod_cband.so] 오류 1


# cd /home/les/mod-cband-0.9.7.5/src/    ->    해당 경로로 이동


# vi mod_cband.c    ->    해당 파일 수정


빨간색 : 수정전

파란색 : 수정후


1333번 라인

p.add.sin.s_addr = inet_addr(r->connection->remote_ip);
p.add.sin.s_addr = inet_addr(r->connection->client_ip);

1342번 라인
   fprintf(stderr,”%s leaf %s\n”,r->connection->remote_ip,leaf);
   fprintf(stderr,”%s leaf %s\n”,r->connection->client_ip,leaf);

1362~1365번 라인
if (c->remote_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->remote_addr->sa.sin.sin_addr.s_addr;

if (c->client_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->client_addr->sa.sin.sin_addr.s_addr;

# make

# make install

이후에 httpd.conf 파일에 LoadModule cband_module       modules/mod_cband.so 이 생성되어있을 것이다.

# vi httpd.conf     ->    해당 파일 열어서 설정 값 입력

<IfModule mod_cband.c>

    <Location /cband-status-me>

        SetHandler cband-status-me

    </Location>

    <Location /~*/cband-status-me>

        SetHandler cband-status-me

    </Location>

    <Location /cband-status>

        SetHandler cband-status

        Order deny,allow

        Deny from all

        Allow from all    ->    all 대신 ip 입력시 해당 ip에서만 상태페이지 접속 가능

    </Location>

</IfModule>


# vi httpd-vhost.conf

<VirtualHost *>

    ServerName yourdomain.com    

    Document /home/test/

    CBandLimit 500Mi    ->  500M 허용

    CBandPeriod 1D    ->     1일간

    CBandExceededURL http://yourdomain.com/traffic_exceeded.html    ->     트래픽초과시 보여지는 페이지

</VirtualHost>


이후에 yourdomain/cband-status 로 접속하시면 트래픽 사용량을 확인할 수 있습니다.


'Linux Server > apache' 카테고리의 다른 글

[apache] ssl 키 발급 및 적용  (0) 2017.06.03
[php 언어셋 문제]  (0) 2017.05.09
[apache] rewrite 모듈을 이용한 http -> https 포워딩  (0) 2017.04.26
[apache] 모듈 userdir  (0) 2017.01.10
[apache] apache 소스설치 (2.4.3)  (0) 2016.09.21
Posted by 실력키우기

[ apache rewrite 모듈을 이용한 http -> https 포워딩 ]


웹사이트 http 에서 https 자동으로 포워딩 하고 싶을때 rewrite 모듈을 이용하면 된다.


mod_ssl 과 rewrite 모듈이 설치가 되어 있어야 한다.



[apache rewrite 모듈 설치]


# cd /usr/local/src/APM-setup/httpd-2.4.3/modules/mappers    ->    모듈을 설치하기 위해 컴파일 했던 위치로 이동


# /usr/local/apache/bin/apxs -a -i -c mod_rewrite.c


# vi /usr/local/apache/conf/httpd.conf    ->    아래 설정 값 수정


LoadModule rewrite_module modules/mod_rewrite.so    ->    해당 라인 주석 해제


AllowOverride none    ->    해당 부분을 AllowOverride All 로 변경



[rewrite 설정 적용]


# vi /usr/local/apache/conf/extra/httpd-vhost.conf    -> 해당 vhost에 아래내용 삽입하거나 , 아래처럼 홈디렉터리에 .htaccess 파일 만들어서 삽입

# vi /home/test/.htaccess    ->    해당 홈 디렉토리에 .htaccess 파일 생성 하여 아래값 작성


RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]



아파치 재시작

'Linux Server > apache' 카테고리의 다른 글

[php 언어셋 문제]  (0) 2017.05.09
[apache] cband 모듈설치  (0) 2017.04.27
[apache] 모듈 userdir  (0) 2017.01.10
[apache] apache 소스설치 (2.4.3)  (0) 2016.09.21
[apache] mod_rewrite 설치  (0) 2016.09.14
Posted by 실력키우기

[ php pecl_http 모듈 설치 ]


pecl_http 모듈을 설치하면 아래와 같은 함수들을 사용할수 있다.

HttpUtil, HttpMessage, HttpRequest, HttpRequestPool, HttpRequestDataShare, HttpDeflateStream,

HttpInflateStream, HttpResponse, HttpQueryString




pecl_http 모듈을 설치하기 위해선 php 5.3 버전 이상 , raphf , propro 모듈이 설치되어 있어야 한다.

해당 소스파일들은 https://pecl.php.net/package-stats.php 사이트에서 다운받을 수 있다.

또한    libcurl 버전최소 요구 사항이 7.18.2 버전 이다. lib 변동작업은 위험함.(서버 정상작동 안할 가능성 있음)




 # wget https://pecl.php.net/get/raphf-1.1.2.tgz    ->    해당파일 다운받기


 # tar -zxvf raphf-1.1.2.tgz    -> 압축 풀기


 # cd raphf-1.1.2    -> 해당 디렉토리로 이동


 # /usr/local/php/bin/phpize     ->    해당명령어로 configure 활성화


 # ./configure --with-php-config=/usr/local/php/bin/php-config     ->    컨피그 시작


 # make


 # make install


 # vi /usr/local/apache/conf/php.ini     ->    해당설정파일에서 extention 경로 잡아주기


extension_dir= "/usr/local/php/lib/php/extensions/no-debug-zts-20090626/"

extension=raphf.so



 # wget https://pecl.php.net/get/propro-1.0.2.tgz     ->    해당파일 다운받기


 # tar -zxvf propro-1.0.2.tgz     


 # cd propro-1.0.2   


 # /usr/local/php/bin/phpize 


 # ./configure --with-php-config=/usr/local/php/bin/php-config 


 # make


 # make install


 # vi /usr/local/apache/conf/php.ini     ->    해당설정파일에서 extention 경로 잡아주기


extension_dir= "/usr/local/php/lib/php/extensions/no-debug-zts-20090626/"

extension=propro.so


 # wget https://pecl.php.net/get/pecl_http-2.5.6.tgz


 # tar -zxvf pecl_http-2.5.6.tgz 


 # cd pecl_http-2.5.6


 # ./configure --with-php-config=/usr/local/php/bin/php-config 


 # make


 # make install


 # vi /usr/local/apache/conf/php.ini     ->    해당설정파일에서 extention 경로 잡아주기


extension_dir= "/usr/local/php/lib/php/extensions/no-debug-zts-20090626/"

extension=http.so



'Linux Server > php' 카테고리의 다른 글

[php] php버전별 컨피그값  (0) 2016.12.14
[php] ZendOptimizer 설치  (0) 2016.10.27
[php] Zend Guard Loader 설치  (0) 2016.10.27
[php] php 소스설치  (0) 2016.09.22
[모듈] soap모듈 설치하기  (0) 2016.09.11
Posted by 실력키우기

[리눅스 시간 동기화]


# yum install -y rdate    ->    rdate 설치


# vi /etc/sysconfig/iptables    ->    방화벽 열어서 어래내용 추가 (udp 137열어줌)


-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m tcp --dport 137 -j ACCEPT


# /etc/init.d/iptables restart    ->    centos6 경우


# service iptables restart    ->    centos7 경우 (6에서도 가능)


# rdate -s time.bora.net     ->    보라넷으로 동기화 (해외망 열어야함)  ->    보라넷으로 동기화 (해외망 열어야함)


'Linux Server > etc' 카테고리의 다른 글

[기타] Iptables 설치 및 설정  (1) 2018.02.26
[기타] rsync 설치 및 사용법  (0) 2017.08.08
[기타] tcpdump 사용방법  (0) 2017.01.25
[기타] 바이오스설정  (0) 2017.01.08
[기타] path 설정방법  (0) 2017.01.08
Posted by 실력키우기
  • MySQL Version : 5.1.73
  • OS : CentOS 7

1. 기존(MyISAM으로 설정된) DB를 Dump 백업합니다.

mysqldump -u {로그인아이디} -p {백업할 데이터베이스 이름} > {덤프파일 명}

# mysqldump -u root -p test_db > test_db.sql



엔진이 정상적으로 변경 되었음에도 불구하고 database에 프로시저가 덤프가 안떠져서 소스코드나 , 어플이 정상작동 안할수있다.

아래 옵션을 주고 덤프하면 procedure, function, trigger 를 포함하여 백업이 가능하다.


# mysqldump --routines  --trigger -u유저이름 -p패스워드 DB명 > 백업파일


# mysqldump --routines --trigger -u root -p les > les.sql

2. 복원시 InnoDB로 적용하기 위해 덤프파일의 내용을 변경합니다.

# sed -e 's/ENGINE=MyISAM/Engine=InnoDB/g' {덤프파일 명} > {새로 적용할 덤프파일 명}

# sed -e 's/ENGINE=MyISAM/Engine=InnoDB/g' test_db.sql > test_db2.sql

3. mysql 콘솔에 접속 후 기존의 데이터베이스를 삭제하고 새로 생성합니다.

mysql> drop database {삭제할 데이터베이스 명}

mysql> drop database test_db

mysql> create database {생성할 데이터베이스 명}

mysql> create database test_db

4. 변경된 덤프파일을 이용해 데이터 베이스를 복원합니다.

# mysql -u {로그인 아이디} -p {복원할 데이터베이스 명} < {새로 적용할 덤프파일 명}

# mysql -u root -p test_db < test_db2.sql

출처 : http://www.33gram.com/



'Linux Server > mysql' 카테고리의 다른 글

[mysql] 버전별 컨피그 값  (0) 2016.12.09
[mysql] mysql5.5.29 버전 my.cnf 기본값  (0) 2016.11.15
[mysql] 리플리케이션  (0) 2016.10.31
[mysql] bin 파일 복구  (0) 2016.10.22
[mysql] mysql5.6.14 설치  (0) 2016.09.17
Posted by 실력키우기

[ sendmail 특정 사이트에서 안받아지는 문제 ]


sendmail 을 사용중에 google.com , naver.com 등에서는 메일을 잘 받는데 daum.net에서는 못받을 경우가 있다.

/var/log/maillog.log 를 확인해보면 아이디@localhost.localdomain 으로 뜨며 faild 가 발생하는 로그가 찍혀있을 것이다.

이런 증상일경우 아래처럼 설정파일을 바꿔주면 된다.


# vi /etc/mail/sendmail.cf    -> 해당 설정파일 열어서 아래내용 추가


Dj$ 부분이 있을텐데 이부분 주석해제하고 고객메일서버 도메인 적어주면 된다.

Posted by 실력키우기

yum install epel-release


sudo yum install phpmyadmin



출처: http://getpost.tistory.com/6 [이씨의 일상]

yum install epel-release


sudo yum install phpmyadmin



출처: http://getpost.tistory.com/6 [이씨의 일상]

[phpmyadmin yum으로 설치]


# yum install epel-releas


# yum install phpmyadmin



'Linux Server > Server 구축' 카테고리의 다른 글

[기타] mediawiki 설치 방법  (0) 2018.08.26
[ 기타 ] vsftpd 설치  (0) 2017.08.03
[기타] tomcat 설치 및 연동  (0) 2016.11.27
[기타] java 설치방법  (0) 2016.11.27
[기타] vqadmin 설치방법  (0) 2016.11.07
Posted by 실력키우기

[tcpdump 사용방법]


# tcpdump -nni eth1    -> 서버에서 통신되는 tcpdump 확인


# tcpdump -nni eth1 host 192.168.9.15    -> 서버에서 통신되는 tcpdump 확인


# tcpdump -nni eth1 port 80 -A -s 1500 |grep Host    -> 해당 서버에 80포트로 생기는 도메인 검색


# tcpdump -nni eth1 host 192.168.9.15 and port 80 -A -s 1500 |grep Host    -> 해당 아이피로 들어오는 것중 도메인 검색 (tc서버에서 확인할때 유용)


# tcpdump -nni eth0 not port 22    -> 개인 서버에서 덤프뜰때 ssh로 접근하기 때문에 로컬 pc 아이피가 계속 통신되기때문에 해당 포트 제외한 옵션


# tcpdump -nni eth0 port 80    -> 80포트로 통신되는것만 덤프




'Linux Server > etc' 카테고리의 다른 글

[기타] rsync 설치 및 사용법  (0) 2017.08.08
[기타] 리눅스 시간 동기화  (0) 2017.03.09
[기타] 바이오스설정  (0) 2017.01.08
[기타] path 설정방법  (0) 2017.01.08
[기타] parted 사용법  (0) 2016.12.22
Posted by 실력키우기

[userdir 모듈]


아파치를 사용하다보면 도메인 없이 여러개의 사이트를 구축하고 확인을 해보아야 할떄가 있다.

사용자 계정별로 디렉토리가 있으며, 사이트가 여러개가 있는 환경일 경우

mod_userdir 을 사용하면된다.



# ll /usr/local/apache/modules/     -> 해당 경로에 mod_userdir.so 모듈이 존재하는지 확인 (없을경우 설치)


# vi /usr/local/apache/conf/httpd.conf    -> 해당 파일 열어서 주석처리 해제


#LoadModule userdir_module modules/mod_userdir.so    -> 해당문구 주석처리 해제

#Include conf/extra/httpd-userdir.conf        -> 해당문구 주석처리 해제


# vi /usr/local/apache/conf/extra/httpd-userdir.conf    -> 해당 파일을 열어서 내용 설정 (기본적으로 되어있기 때문에 변경 안해도됨)


UserDir public_html    -> 홈계정 아래 해당 디렉토리가 있어야 하며, 디렉터리 이름은 변경 가능하다


#

# Control access to UserDir directories.  The following is an example

# for a site where these directories are restricted to read-only.

#

<Directory "/home/*/public_html">        -> 경로에 맞게 변경해줘야 될것같지만.. 이름을 다르게해도 된다.. 솔직히 왜 되는지 모르겠다.

    AllowOverride FileInfo AuthConfig Limit Indexes

    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

    Require method GET POST OPTIONS

</Directory>


# /etc/init.d/apachectl restart    -> 설정 마친 후 아파치 재시작



위처럼 설정을 마친후 사용자 디렉토리에 public_html 이라는 디렉터리를 만들고, 그 안에 소스파일을 넣어주면됨.


ex) 


# mkdir /home/les/public_html


# vi index.html    -> 해당 명령어로 해당파일 생성후 아래처럼 아무렇게나 글씨 작성


asdfkjlhasdfjkasdfh


url 에 아이피/~les 적으면 asdfkjlhasdfjkasdfh 이런식으로 나옴 (해당계정에 대한 페이지가 뜸)







'Linux Server > apache' 카테고리의 다른 글

[php 언어셋 문제]  (0) 2017.05.09
[apache] cband 모듈설치  (0) 2017.04.27
[apache] rewrite 모듈을 이용한 http -> https 포워딩  (0) 2017.04.26
[apache] apache 소스설치 (2.4.3)  (0) 2016.09.21
[apache] mod_rewrite 설치  (0) 2016.09.14
Posted by 실력키우기

[BIOS 설정]

전원이 나갔다 들어오면 서버가 자동으로 켜지게 설정을 할수 있다.


바이오스접속    ->    어드벤스    ->    리스토어 옵션    ->    파워 on 으로 변경


'Linux Server > etc' 카테고리의 다른 글

[기타] 리눅스 시간 동기화  (0) 2017.03.09
[기타] tcpdump 사용방법  (0) 2017.01.25
[기타] path 설정방법  (0) 2017.01.08
[기타] parted 사용법  (0) 2016.12.22
[기타] root 계정으로 바로 접근 막기  (0) 2016.12.04
Posted by 실력키우기

[PATH 설정방법]


java로 예를 들어 설명하겠습니다.

java 같은경우 이미 yum 으로 설치되어있을 경우나 버전이 다른 경우 새로 소스설치할 상황이 있다.

그럴경우 path를 다시잡아줘야 하는데 아래처럼 하면 된다.


# which java    -> 현재 자바버전 확인


# ls -l /usr/bin/java    -> 자바 링크경로 확인


# unlink /usr/bin/java    -> 새로운 버전 링크지정하기 위해 기존 링크 끊어주기


# ln -s /usr/local/java/bin/java  /usr/bin/java    -> 새로 설치한 자바 위치가 /usr/local/java/bin/java 이기 때문에 이렇게 잡아줌.


# java -version     -> 해당 명령어로 최종확인, 물론 /etc/profile 에는 자바 path 설정이 되어있어야 한다.



'Linux Server > etc' 카테고리의 다른 글

[기타] tcpdump 사용방법  (0) 2017.01.25
[기타] 바이오스설정  (0) 2017.01.08
[기타] parted 사용법  (0) 2016.12.22
[기타] root 계정으로 바로 접근 막기  (0) 2016.12.04
[기타] centos7 싱글모드 진입  (0) 2016.12.04
Posted by 실력키우기

[vi에서 들여쓰기문제]


vi에서 붙여넣기 할때 #처리 된것까지 함께 복사 붙여넣기 할 경우 주석처리가 안된것까지 전부 주석처리가 되고, 들여쓰기도 엉망으로 되는경우가 있다.


이럴경우 vi 편집기에서 :set paste 이후 입력모드로 바꾼 뒤 붙여넣기 하면 해결된다.

Posted by 실력키우기

노트북으로 콘솔연결

tera team 프로그램 실행
설정->시리얼포트 속도를 115200으로 맞춰준다.


1.

#configure


#prompt L2GS104-2


2. snmp-server community dedisnmp ro (10분개통 같은경우 rw로 입력)


3. username admin password 0 [암호]


4. ip 및 gateway 설정


# interface vlan 1


# ip address [IP 주소] [255.255.255.224]


# exit


# ip defalut-gateway [게이트 웨이]


5.

management all-client  115.68.비밀.1 115.68.비밀.254

management all-client 115.68.비밀.1 115.68.비밀.30


6.

no ip http server

no ip http secure-server


7. 그룹


# interface port-channel 1


# exit


# interface ethernet 1/23-24


# channel-group 1


추가1) 기존 snmp는 삭제 시켜 준다.

# no snmp-server community [이름]    ->   (private , public)


추가2) 완료됬으면 저장을 하고 reload를 해본다.

# copy run start


종료 후 다시 연결

# reload



초기화


# dir


File Name Type Startup Modified Time Size (bytes)
------------------------------ ------- ------- ------------------- ------------
Unit 1:
ECS4110-52P_V1.2.3.4.bix OpCode Y 2014-07-02 03:57:37 8940876
Factory_Default_Config.cfg Config N 2014-06-10 08:22:23 455
dedi.cfg Config Y 2015-10-08 02:45:08 1987
startup1.cfg Config N 2014-07-02 03:44:14 1409


# comfigure


config)#boot system config:Factory_Default_Config.cfg
(config)#exit
#reload
y

reload


Posted by 실력키우기

[parted 사용법]


하드디스크 2TB 이상부터는 fdisk 로 파티션 나누는 것이 불가능하다. 그렇기 때문에 parted 라는 명령어를 통해서 파티션 분할이 가능하다.


[root@os1 ~]# parted /dev/sdb


(parted) mklabel gpt


(parted) mkpart primary 0 3TB        -> 0부터 사용범위 지정


(parted) mkpart primary 3TB 100%        -> 3TB 부터 마지막까지 지정


(parted) print        -> 해당 명령어로 파티션 나눠진것을 확인할수 있다.


포멧


mkfs.ext4 /dev/sdb1 


mkfs.ext4 /dev/sdb2 


parted -l 로 파티션 나눠진것을 확인


mount /dev/sdb1 /backup

mount /dev/sdb2 /backup2

Posted by 실력키우기





[php 5.2.17]

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-language=korean --with-kerberos --with-imap-dir --with-imap-ssl --with-mysql=/usr/local/mysql --with-tiff-dir --with-pdflib --with-cpdflib --with-mhash --enable-sockets --with-regex=php --with-mod_charset --enable-track-vars --enable-ftp --enable-modules=so --enable-inline-optimization --disable-debug --with-config-file-path=/usr/local/apache/conf --with-zlib --with-zlib-dir --with-curl --with-iconv --with-dbx --with-gdbm --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-mbstring --enable-mbregex --enable-sigchild --with-xml --enable-dba --with-zend-multibytei --enable-saft-mode --enable-magic-quotes --enable-debugger --enable-sysvsem --enable-sysvshm



[php 5.2.17]

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-mysql=/usr/local/mysql --with-curl --with-openssl --with-gd --with-gdbm --with-freetype-dir --with-png-dir --with-jpeg-dir --with-iconv --with-gettext --with-mcrypt --with-mhash --with-bz2 --with-zlib --with-pear --with-readline --with-xmlrpc --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --enable-mbstring=all --enable-mbregex --enable-bcmath --enable-ftp --enable-exif --enable-gd-native-ttf --enable-dba --enable-roxen-zts --enable-ipv6 --enable-pcntl --enable-libxml --enable-zip=shared --enable-soap=shared --disable-debug

'Linux Server > php' 카테고리의 다른 글

[php] pecl_http , raphf , propro 모듈설치  (0) 2017.04.05
[php] ZendOptimizer 설치  (0) 2016.10.27
[php] Zend Guard Loader 설치  (0) 2016.10.27
[php] php 소스설치  (0) 2016.09.22
[모듈] soap모듈 설치하기  (0) 2016.09.11
Posted by 실력키우기

[php 언어 공부



정적 변수 : 지역 변수의 값을 그대로 유지하여 사용하는변수    -> static 키워드를 사용


상수 : 똑같은 값을 가지는 변하지 않는 수    -> define() 함수를 이용




Posted by 실력키우기

[mysql 버전별 컨피그값]


mysql은 버전별로 컨피그 옵션이 다르다.

그렇기 때문에 해당 버전별로 컨피그 옵션을 줘야 설치가 정상적으로 된다.


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


[mysql 5.5.29 설치]



1) mysql 사용자 및 그룹 추가

# groupadd mysql
# useradd -g mysql mysql

 

2) 소스코드파일 압축해제 및 설치(/usr/local/src/ 디렉토리에 mysql-5.5.10.tar.gz 파일을 저장했다.)

# cd /usr/local/src/

# tar xvfz mysql-5.5.10.tar.gz
# cd mysql-5.5.10

 

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1

 

설명)

mysql 설치 디렉토리는 /usr/local/mysql

mysql DB 디렉토리는 /usr/local/mysql/data

mysql 기본언어셋은 utf8

mysql 사용포트는 3306

 

# make && make install

 

# cp support-files/my-huge.cnf /etc/my.cnf            <---mysql 설정파일 복사

# cp support-files/mysql.server /etc/init.d/mysqld    <---mysql 실행데몬 복사     
# vi /etc/init.d/mysqld
--------------------------------------
datadir=/usr/local/mysql/data              <---DB디렉토리 지정 하고 저장
---------------------------------------

 

# chmod 755 /etc/init.d/mysqld             <---mysql 데몬 실행 권한 부여

# chown -R mysql:mysql /usr/local/mysql              

# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data                           <---DB생성

# /etc/init.d/mysqld start                     <---mysql 구동 (시작)  또는 /usr/local/server/mysql/bin/mysqld_safe &

# chkconfig --add mysqld                    

# /usr/local/server/mysql/bin/mysqladmin -u root password 암호           <---mysql root 패스워드 설정

# ln -s /usr/local/server/mysql/bin/mysql /usr/bin/                           <---링크

# ln -s /usr/local/server/mysql/bin/mysqldump /usr/bin/



----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


[mysql 5.0.96]


./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr --with-mysql-user=mysql --with-extra-charsets=all --enable-thread-safe-client        -> 언어셋을 utf8로 바꾸고 싶다면 euc_kr부분을 바꿔주면된다.


#make

#make install


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


[mysql 5.6.14]


# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1            -> 언어셋을 euc_kr로 바꾸고 싶다면 utf8부분을 바꿔주면된다.


# gmake

# gmake install


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



'Linux Server > mysql' 카테고리의 다른 글

[mysql] myisam -> innodb 변경  (0) 2017.02.20
[mysql] mysql5.5.29 버전 my.cnf 기본값  (0) 2016.11.15
[mysql] 리플리케이션  (0) 2016.10.31
[mysql] bin 파일 복구  (0) 2016.10.22
[mysql] mysql5.6.14 설치  (0) 2016.09.17
Posted by 실력키우기

[ root 계정으로 바로 접근 막기 ]

 

# vi /etc/pam.d/su        -> 해당 파일 열고 아래내용 수정

 

#auth           required        pam_wheel.so use_uid        -> 해당 라인 주석 해제

 

# groupadd wheel     -> wheel 그룹 생성 (이미 생성되어있을 가능성이 높다.)

 

# chgrp wheel /bin/su        ->  su 명령어를 wheel 그룹에서만 실행할수 있도록 소유자 변경

 

# chmod 4750 /bin/su        -> su 명령어 접근 권한 변경  

 

# usermod -G wheel "계정이름"        -> 계정에 wheel 그룹 추가 (root 권한 얻을수 있는 계정 추가)

 

# vi /etc/ssh/sshd_config         ->  ssh 설정에서 root 로 바로 로그인이 되지 않도록 설정

 

PermitRootLogin yes        -> no 로 변경

 

위와 같이 설정하면 wheel 그룹에 포함된 계정만 su - 명령어를 통해 root 권한으로 변경 가능하다

 

-------------------------------------------------------------------------------------------

 

[ SSH 특정 계정만 접근되도록 설정 ]

 

# vi /etc/ssh/sshd_config        -> 해당 파일 열고 아래내용 수정
AllowUsers les les421          -> AllowUsers 추가 후 옆에 적어준 계정만 ssh 접속이 가능

#PermitRootLogin yes        -> 주석 해제 후 yes 부분을 no로 변경

 

 

 

'Linux Server > etc' 카테고리의 다른 글

[기타] path 설정방법  (0) 2017.01.08
[기타] parted 사용법  (0) 2016.12.22
[기타] centos7 싱글모드 진입  (0) 2016.12.04
[기타] ftp설치 하지 않고 ftp 사용법 (sftp)  (0) 2016.11.01
[기타] 강제 umount 하기  (0) 2016.10.11
Posted by 실력키우기

[centos 7 싱글모드 진입]


1



1. 키보드 방향키 위와 아래버튼을 누르다보면 위처럼 커널 선택하는 화면이 나올텐데 저 상태에서  ‘e’ 버튼을 눌러줍니다.




 

2



3

 

2. rhgb quiet를 init=/bin/bash로 변경한후 Ctrl -x를 눌러 싱글모드로 진입합니다.
    CentOS 5 또는 6와는 싱글모드 진입이 변경된것을 알수있습니다. 

#  rhgb quiet 삭제 init=/bin/bash 추가

 


 



6

 

3. / root를 다시 마운트 한후 패스워드를 변경합니다.

# mount -o remount,rw /
# passwd root

 



 

8

 

4. 나머지 두가지의 명령어를 입력하여 리부팅을 진행합니다.

SELinux 관련 명령어 (다른곳에서도 사용하는것으로 보입니다.)
# touch /.autorelabel   

리부팅 명령어
# exec /sbin/init


 


 출처 - http://idchowto.com/?p=18651

Posted by 실력키우기

[tomcat 설치]


apache-tomcat 다운받기


# tar -zxvf apache-tomcat-7.0.42.tar.gz                     -> 압축풀기


# mv apache-tomcat-7.0.42 /usr/local/tomcat           -> 해당경로에 옮기기

    

# cd /usr/local/tomcat/                                                -> 해당 경로로 이동

  

# vi /etc/profile                                                            -> java가 설치되어 있어야 하며, 파란색부분 추가



JAVA_HOME=/usr/local/java

CATALINA_HOME=/usr/local/tomcat

CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/lib-jsp-api.jar:$CATALINA_HOME/lib/servlet-api.jar

PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

export JAVA_HOME CLASSPATH PATH CATALINA_HOME


 

# source /etc/profile                                                    -> 해당 명령어로 profile 수정내용 갱신

  

# /usr/local/tomcat/bin/startup.sh                             -> 해당파일 실행


# vi /etc/sysconfig/iptables                                         -> iptables 열어서 8080 , 8005 , 8009 등 포트 등록

  

# /etc/init.d/iptables restart                                        -> iptables 재시작


cp -arp /usr/local/tomcat/bin/catalina.sh /etc/init.d/tomcat        -> tomcat 실행파일 init.d/ 에 등록

chkconfig --add tomcat                        -> 리부팅시 자동으로 올라오도록 설정

[tomcat 및 아파치 연동]

# wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.42-src.tar.gz    -> 해당 파일을 다운받는다.
# tar -zxvf tomcat-connectors-1.2.42-src.tar.gz    -> 압출 해제한다
# cd tomcat-connectors-1.2.42-src/native/        -> 해당 디렉토리로 들어간다
./configure --with-apxs=/usr/local/apache/bin/apxs     -> 컨피그 해준다 (아파치경로)
# make
# make install

# cd /usr/local/apache/conf/
# vi workers.properties

workers.tomcat_home=/usr/local/tomcat

workers.java_home=/usr/local/java

# BEGIN workers.properties

worker.list=ajp13

worker.ajp13.port=8009

worker.ajp13.host=localhost

worker.ajp13.type=ajp13

worker.ajp13.lbfactor=1

# END workers.properties


# /usr/local/apache/conf/extra/httpd-vhosts.conf


<VirtualHost *:80>

    DocumentRoot "/usr/local/apache/htdocs"

    ServerName 115.68.220.220

    ErrorLog "logs/115.68.220.220_error_log"

    CustomLog "logs/115.68.220.220_access_log" common

     JkMount /*.jsp ajp13


</VirtualHost>


# vi /usr/local/apache/conf/httpd.conf 

LoadModule jk_module modules/mod_jk.so


<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkShmFile logs/mod_jk.shm
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H :%M :%S %Y]"
</ifModule>
JkMount /*.jsp ajp13

<Directory />


cd /usr/local/tomcat/webapps/ROOT/ 해당경로가 tomcat DocumentRoot




[tomcat의 vhost 변경하고 싶을경우]
vi /usr/local/tomcat/conf/server.xml 해당 경로에 아래의 빨간부분 처럼 설정

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->
        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>
<Host name="115.68.220.220"  appBase="/home/les/"
            unpackWARs="true" autoDeploy="true">
</Host>
<Host name="leeeunseok.xyz"  appBase="/home/web/"
            unpackWARs="true" autoDeploy="true">
</Host>
    </Engine>
  </Service>
</Server>

위처럼 원하는 도메인 및 원하는 경로를 설정후 저장하여 빠져나옵니다.
이후에 톰캣을 재시작하면 /usr/local/tomcat/conf/Catalina/ 경로에 자신이 설정한 도메인이름으로 디렉터리가 생성됩니다.
그 디렉터리 안에 ROOT.xml 파일을 생성후 아래처럼 내용추가해줍니다.
<?xml version='1.0' encoding='utf-8'?>
<Context
    docBase="/home/web/"      ->     원하는 경로 입력
    debug="0"
    privileged="true"
    reloadable="true">
</Context>

위처럼 원하는 도메인 및 원하는 경로를 설정후 저장하여 빠져나온 후 톰캣을 재시작 하면 해당 도메인으로 질의하였을때 java관련 파일은 해당경로에서 정상적으로 읽게됩니다.


'Linux Server > Server 구축' 카테고리의 다른 글

[ 기타 ] vsftpd 설치  (0) 2017.08.03
[기타] phpmyadmin yum으로 설치  (0) 2017.01.31
[기타] java 설치방법  (0) 2016.11.27
[기타] vqadmin 설치방법  (0) 2016.11.07
[기타] sendmail 설치  (0) 2016.10.12
Posted by 실력키우기

[java 설치방법]


자바와 톰캣을 설치할때 자바 먼저 설치를 한다.


jdk 다운받기


# tar -zxvf jdk1.7.0_45-x86_64.tar.gz         -> 압축 풀기


# mv jdk1.7.0_45 /usr/local/java                -> 해당경로로 java로 이름 바꾼 후 이동

# vi /etc/profile                                            -> profile 열고 해당파일 상단에 아래 내용 입력

JAVA_HOME=/usr/local/java
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME CLASSPATH PATH


# source /etc/profile                        -> 해당 명령어를 통해 수정된 파일을 적용


# java -version                                -> 해당 명령어로 자바버전 확인


# javac -version                              -> 해당 명령어로 자바버전 확인 아래처럼 화면이 나오면 자바가 잘 깔린것이다.


[root@host-115-68-200-69 ~]# java -version

java version "1.7.0_45"

Java(TM) SE Runtime Environment (build 1.7.0_45-b18)

Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

[root@host-115-68-200-69 ~]# javac -version

javac 1.7.0_45




'Linux Server > Server 구축' 카테고리의 다른 글

[기타] phpmyadmin yum으로 설치  (0) 2017.01.31
[기타] tomcat 설치 및 연동  (0) 2016.11.27
[기타] vqadmin 설치방법  (0) 2016.11.07
[기타] sendmail 설치  (0) 2016.10.12
[기타] 휘슬 설치 및 사용방법  (0) 2016.09.19
Posted by 실력키우기

# Example MySQL config file for very large systems.

#

# This is for a large system with memory of 1G-2G where the system runs mainly

# MySQL.

#

# MySQL programs look for option files in a set of

# locations which depend on the deployment platform.

# You can copy this option file to one of those

# locations. For information about these locations, see:

# http://dev.mysql.com/doc/mysql/en/option-files.html

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# with the "--help" option.


# The following options will be passed to all MySQL clients

[client]

#password       = your_password

port            = 3306

socket          = /tmp/mysql.sock


# Here follows entries for some specific programs


# The MySQL server

[mysqld]

port            = 3306

socket          = /tmp/mysql.sock

skip-external-locking

key_buffer_size = 384M

max_allowed_packet = 64M

table_open_cache = 512

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

query_cache_size = 32M

slow_query_log = 10

slow_query_log_file = /usr/local/mysql/data/mysql-slow-queries.log


#skip-grant-tables


# Try number of CPU's*2 for thread_concurrency

thread_concurrency = 8


# Don't listen on a TCP/IP port at all. This can be a security enhancement,

# if all processes that need to connect to mysqld run on the same host.

# All interaction with mysqld must be made via Unix sockets or named pipes.

# Note that using this option without enabling named pipes on Windows

# (via the "enable-named-pipe" option) will render mysqld useless!


#skip-networking


# Replication Master Server (default)

# binary logging is required for replication

log-bin=mysql-bin


# required unique id between 1 and 2^32 - 1

# defaults to 1 if master-host is not set

# but will not function as a master if omitted

server-id       = 1


# 소켓에러나 mysql 시작 안될시에 추가해줄것

#datadir=/usr/local/mysql/data


# Replication Slave (comment out master section to use this)

#

# To configure this host as a replication slave, you can choose between

# two methods :

#

# 1) Use the CHANGE MASTER TO command (fully described in our manual) -

#    the syntax is:

#

#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,

#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;

#

#    where you replace <host>, <user>, <password> by quoted strings and

#    <port> by the master's port number (3306 by default).

#

#    Example:

#

#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,

#    MASTER_USER='joe', MASTER_PASSWORD='secret';

#

# OR

#

# 2) Set the variables below. However, in case you choose this method, then

#    start replication for the first time (even unsuccessfully, for example

#    if you mistyped the password in master-password and the slave fails to

#    connect), the slave will create a master.info file, and any later

#    change in this file to the variables' values below will be ignored and

#    overridden by the content of the master.info file, unless you shutdown

#    the slave server, delete master.info and restart the slaver server.

#    For that reason, you may want to leave the lines below untouched

#    (commented) and instead use CHANGE MASTER TO (see above)

#

# required unique id between 2 and 2^32 - 1

# (and different from the master)

# defaults to 2 if master-host is set

# but will not function as a slave if omitted

#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
#
# binary logging format - mixed recommended 
#binlog_format=mixed

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
#innodb_data_home_dir = /usr/local/mysql/data


[mysqldump]
quick
max_allowed_packet = 64M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]

key_buffer_size = 256M

sort_buffer_size = 256M

read_buffer = 2M

write_buffer = 2M


[mysqlhotcopy]

interactive-timeout



'Linux Server > mysql' 카테고리의 다른 글

[mysql] myisam -> innodb 변경  (0) 2017.02.20
[mysql] 버전별 컨피그 값  (0) 2016.12.09
[mysql] 리플리케이션  (0) 2016.10.31
[mysql] bin 파일 복구  (0) 2016.10.22
[mysql] mysql5.6.14 설치  (0) 2016.09.17
Posted by 실력키우기
이전버튼 1 2 3 4 이전버튼

블로그 이미지
공 부 하 는 직 장 인
실력키우기

태그목록

공지사항

Yesterday
Today
Total

최근에 달린 댓글