Program/Linux

G클라우드 설정

하랑파파♡ 2018. 8. 28. 14:08
728x90
반응형
SMALL

※G클라우드 CentOS6 기준
#APM 설치(yum)
- SSH에 root 계정으로 접속
- yum update 명령어로 yum 업데이트
- rpm -qa libjpeg* libpng* freetype* gd-* 명령어로 이미지 관련 라이브러리 설치 유무 확인
- yum install libjpeg* libpng* freetype* gd-* 명령어로 이미지 관련 라이브러리 설치
- yum install httpd 명령어로 apache 설치
- yum install mysql mysql-server 명령어로 mysql 설치
- yum install php php-mysql 명령어로 php 및 mysql 연동 설치
- rpm -qa httpd mysql php 명령어로 정상 설치 유무 확인
- vi /etc/httpd/conf/httpd.conf 명령어로 apache 서버 셋팅
     => User apache를 User nobody로 변경
     => Group apache를 Group nobody로 변경
     => ServerName을 도메인명 혹은 ip로 설정
          ==>ServerName [ www.test.com:80 or 192.168.119.132:80 ]
- vi /etc/httpd/conf/httpd.conf 명령어로 PHP 관련 셋팅
     => DirectoryIndex index.html 부분에 index.php 추가
     => AddType application/x-httpd-php .php .html .htm .inc 추가
     => AddType application/x-httpd-php-source .phps 추가

#계정 생성
useradd 계정명
passwd 계정 비밀번호
usermod -g 그룹명 계정명

#디렉토리 소유자 수정
chown -R 계정명.그룹명 디렉토리

#윈도우 IIS SSL 보안인증서를 리눅스 apache SSL 보안인증서로 변경
- 인증서명.pfx 를 IIS 에서 추출
- openssl pkcs12 -in 인증서명.pfx -clcerts -nokeys -out 인증서명.crt 명령어를 이용하여 crt 파일 추출
- openssl pkcs12 -in 인증서명.pfx -nocerts -nodes -out 인증서명.key 명령어를 이용하여 key 파일 추출

#Virtual hosts 설정
- httpd.conf 파일 수정
     => ServerName www.example.com:80 을 검색해서  ServerName bemymom.co.kr:80 와 같이 도메인명으로 변경
     => LoadModule foo_module modules/mod_foo.so 을 검색해서 하단에  LoadModule ssl_module modules/mod_ssl.so 추가
     => Include conf.d/*.conf 을 검색해서 하단에
     # Virtual hosts
     Include conf/httpd-vhosts.conf
     # Secure (SSL/TLS) connections
     Include conf/httpd-ssl.conf
     => DocumentRoot "/var/www/html" 을 검색해서  DocumentRoot "/home/www" 으로 변경
- httpd-ssl.conf 수정
     => httpd-ssl.conf 파일 생성(httpd.conf 파일과 동일 위치에 만들어도 됨.)
     => 첨부파일 중 conf 디렉토리의 httpd-ssl.conf 파일의 내용 복사 & 붙여넣기
     => 아래 내용을 해당 서버 및 도메인에 맞게 수정
     <VirtualHost *:443>
          DocumentRoot /home/www
          ServerName 도메인:443
          <Location / >
               Options FollowSymLinks
          </Location>
          ErrorLog "/etc/httpd/logs/ssl_error_log"
          TransferLog "/etc/httpd/logs/ssl_access_log"
          SSLEngine on
          SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
          SSLCertificateFile "/home/SSL/도메인.crt"
          SSLCertificateKeyFile "/home/SSL/도메인.key"
          SSLCACertificateFile "/home/SSL/Chain_RootCA_Bundle.crt"
          CustomLog "/etc/httpd/logs/ssl_request_log" \
                      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
     </VirtualHost>
- httpd-vhosts.conf 수정
     => httpd-vhosts.conf 파일 생성(httpd.conf 파일과 동일 위치에 만들어도 됨.)
     => 첨부파일 중 conf 디렉토리의 httpd-vhosts.conf 파일의 내용 복사 & 붙여넣기
     => 아래 내용을 해당 서버 및 도메인에 맞게 수정
     <VirtualHost *:80>
          DocumentRoot 디렉토리
          ServerName 도메인
          <Location / >
               Options FollowSymLinks
          </Location>
     </VirtualHost>

728x90
반응형
LIST