320x100
320x100

0. 준비사항

- AWS EC2 (RHEL / CentOS 혹은 fedora 등 래드햇 계열 OS)

ㆍAWS EC2 래드햇 세팅 (모두 프리티어로 설정)

 : docs.aws.amazon.com/ko_kr/AWSEC2/latest/UserGuide/EC2_GetStarted.html 

 : https://min-nine.tistory.com/145?category=894684 

 

 

 

- putty (윈도우 PC에 설치 / EC2를 관리하기 위함)

ㆍputty와 EC2 연동

 : lsjsj92.tistory.com/549

 : mozi.tistory.com/191  

 

※ putty를 통해 EC2의 서버에 접속가능한 상태여야 함 (root계정으로)

 

 

 

1. 필요한 패키지 설치

yum -y update

yum install openssh

yum install java-1.8.0-openjdk-devel-1.8.0.282.b08-2.el8_3.x86_64

yum install httpd

service httpd start        // httpd 서비스 시작

systemctl enable httpd  // 재부팅시 자동으로 시작

yum install firewalld

systemctl unmask firewalld

systemctl enable firewalld

systemctl start firewalld

firewall-cmd --zone=public --add-port=80/tcp --permanent     //80port 개방
firewall-cmd --reload   // 방화벽 재시작

yum install wget

wget downloads.apache.org/tomcat/tomcat-8/v8.5.64/bin/apache-tomcat-8.5.64.tar.gz 

tar -zxvf apache-tomcat-8.5.64.tar.gz 

 

 

 

2. JAVA 환경변수 설정

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-devel-1.8.0.282.b08-2.el8_3.x86_64

source /etc/profile

echo $JAVA_HOME

 

 

 

3. /etc/httpd/conf/httpd.conf 파일 기본 설정 (주석제외 필수 부분)

 

ServerRoot "/etc/httpd"

Listen 80

Include conf.modules.d/*.conf

User apache

Group apache

ServerAdmin root@localhost

 

<Directory />

    Options FollowSymLinks

    AllowOverride none

    Require all granted

</Directory>

 

DocumentRoot "웹페이지가 있는 경로"

#DocumentRoot "/var/www/html"

 

<Directory "/var/www">

   AllowOverride None

   Require all granted

</Directory>

 

<Directory "웹페이지가 있는 경로">

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

</Directory>

 

<Directory "/var/www/html">

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted

</Directory>

 

<IfModule dir_module>

   DirectoryIndex index.html

</IfModule>

 

<Files ".ht">

    Require all denied

</Files>

 

ErrorLog "Logs/error_log"

LogLevel warn

 

<IfModule log_config_module><IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

AddDefaultCharset UTF-8
IncludeOptional conf.d/*.conf

    

// 이하생략... 

 

 

 

4. 오류발생시 참조할만한 글들

 

red hat enterprise linux test page 변경

: webhostinggeeks.com/howto/how-to-remove-red-hat-enterprise-linux-test-page/

 

httpd.conf 설정
: https://itragdoll.tistory.com/56

 

httpd 재시작
: http://urin79.com/blog/20654918

 

Job for httpd.service failed because the control process exited with error code.
: https://jiniweb.tistory.com/43

 

Forbidden You don’t have permission to access / on this server.
: https://mytory.net/archives/3143

 

(13) Permission denied : access to / failed because search permissions are missing on a component of the path
: https://blog.naver.com/brian2/50180434351

 

아파치 톰캣과 아파치 연동 관련 httpd
: https://memoweb.tistory.com/entry/%EC%9B%B9%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80%EC%97%90%EC%84%9C-%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC-%EB%A6%AC%EC%8A%A4%ED%8A%B8%EA%B0%80-%EB%B3%B4%EC%9D%BC%EB%95%8C-index-%EB%A5%BC-%EC%97%86%EC%95%A0%EB%A0%A4%EB%A9%B4-Robottxt-%EC%9E%91%EC%84%B1%EB%B2%95

 

아파치 웹서버 변경사항
: https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/7/html/migration_planning_guide/ch04s07s05s02

 

 

 

 

 

 

300x250
728x90