Ubuntu Server APM 기본 패키지 설치 명령어들
Category : Ubuntu & Linux/Unix Comments : 댓글쓰기 Posted by 장창학 at 1:28 PM
Bookmark and Share

Ubuntu Server Edition에서 기본적인 패키지들을 설치할때 많이들 궁금해 하는 부분이 기본 패키지들의 APT설치방법 및 설치경로, 실행파일경로 등이 아닐까 싶습니다. 간단하게 정리해 보았습니다.

Apache 2
설치 : sudo apt-get install apache2 libapache2-mod-auth-mysql build-essential apache2-threaded-dev
Apache2 설정파일 : /etc/apache2/apache2.conf
Apache2 가상호스트 설정 : /etc/apache2/sites-available/default
Apche2 구동파일 : /etc/init.d/ -> sudo ./apache2 start|stop|restart|reload


MySQL 5
설치 : sudo apt-get install mysql-server mysql-client
MySQL 설정파일 : /etc/mysql/
my.cnf 경로 : /etc/myql/my.cnf
MySQL 구동파일 : /etc/init.d -> sudo ./mysql start|stop|restart


PHP 5
설치 : sudo apt-get install php5-common php5 libapache2-mod-php5 php5-mysql php5-gd php5-mcrypt
PHP 설정파일 : /etc/php5
php.ini 파일경로 : /etc/php5/apache2/php.ini


SunJDK 6
설치 : sudo apt-get install sun-java6-jdk
설치경로 : /usr/lib/jvm/java-6-sun
JRE경로 : Bash Profile에서 지정가능(일반적으로 /usr/lib/jvm/java-6-sun/java-6-sun/jre/)

그리고, 기본적인 방화벽의 옵션을 지정하는 방법은 다음과 같습니다.

UFW
UFW 활성화 : sudo ufw enable
UFW 로그기록 : sudo ufw logging on|off
UFW 상태보기 : sudo ufw status
UFW 아이피기준 허용 :
- 외부아이피 123.123.123.111 에 대하여 22번 SSH를 허용할때 : sudo ufw allow from 123.123.123.111 to any port 22
- 외부아이피에 대하여 80번 WEB를 허용할때 : sudo ufw allow to any port 80
UFW 룰 삭제 : 기본적으로 허용한 룰의 명령줄에 delete만 추가하면 된다. 예를 들어 123.123.123.111에 대하여 22번포트 접속허용을 삭제하고자 할때는 sudo ufw delete allow from 123.123.123.111 to any port 22와 같이 구문의 앞에 delete만 추가.

부가적으로 보안을 위한 다음의 모듈도 설치하시길 바랍니다.

Mod-Evassive
설치 : sudo apt-get install libapache2-mod-evasive
         sudo mkdir /var/log/apache2/mod_evasive
         sudo chown www-data:www-data /var/log/apache2/mod_evasive

apache 가상호스트파일에 다음의 코드추가 :
        <ifmodule mod_evasive20.c>
            DOSHashTableSize 3097
            DOSPageCount 2
            DOSSiteCount 50
            DOSPageInterval 1
            DOSSiteInterval 1
            DOSBlockingPeriod 10
            DOSLogDir /var/log/apache2/mod_evasive
            DOSEmailNotify root@localhost
            DOSWhitelist 127.0.0.1
        </ifmodule>

Fail2Ban
설치 : sudo apt-get install fail2ban
설치경로 : /etc/fail2ban
설정파일 : /etc/fail2ban/jail.conf

Comments


Write your comment



(it will not be displayed - 실제로 댓글 목록에서는 출력되지 않습니다)



Leave this field empty:




About me

Categories

Monthly Archives

Links

Recent Posts

Recent Comments