1. 커널에 Quota support 옵션 추가

# genkernel --menuconfig all

--> File systems - [*]Quota support  체크

2. quota 설치
# emerge quota

3. /etc/fstab 설정
# vi /etc/fstab

--> 원하는 파티션에 usrquota or grpquota 를 추가한다

4. quota.user, quota.group 만들기
# touch /quota.user   --> fstab 에서 파티션이 / 일경우

# touch /quota.group

# chmod 600 quota.*  --> 소유권한은 루트만 읽고 쓸수있도록한다.

5. quota 파일 최신으로 업데이트하기 (사용자가 추가되면 다시 해줘야한다.)
# quotacheck -mf /  --> 파티션루트가 / 일때 ( 시간이 좀 걸린다. )

6. convertquota
# convertquota -u / --> 파티션루트가 / 일때 (이제부터 계속 / 일것이다.)

7. 마운트 다시하기
# mount -o remount /

# mount --> 해당파티션에 쿼터설정이 제대로 들어갔는지 확인

8. 유저별 quota 설정하기
  - soft 경고하는거고 hard 는 더이상 못쓰게 하는거다.
# edquota cranix

--> 용량은 block(kbyte) 단위로 쓰면된다.

--> 쿼터를 수정하고 따로 quota 를 재시작해줄필요 없이 바로 적용된다.

9. quota 확인하기
# repquota -a --> 전체 quota 설정확인하기

# quota --> 자신의 quota 설정확인하기

by cranix 2006. 12. 24. 14:43
들어오는 IP 막기

iptables -A INPUT   -s [IP] -j DROP

by cranix 2006. 12. 22. 23:48
우분투에서 루트로 작업하기!

친구놈 블로그에서 발견했다!


원본가기


ubuntu 리눅스를 처음 설치했을때 당황하게 만드는 큰 원인중에 하나가 root 계정에 패스워드가 지정 되어 있지 않아서 root로 로그인을 하지 못한다는 것이다. 보안상으로 상당히 좋은 설정일 수 있으나 서버가 아닌 PC 운영체제로 리눅스를 쓰는 사람들에게는 불편하다. 그래서 온갓 삽질(싱글로 부팅해서 패스워드 지정하기) 끝에 알아낸것이 sudo 를 이용하는 것이다.

ubuntu 설치시 입력한 user는 sudo 를 실행할 수 있는 권한을 가지고 있다.

방법은 아주 간단하다. 설치시 입력한 user로 로그인한 후 터미널을 하나 열고

$ sudo bash
  Password :
# passwd

sudo bash 를 친후 요구하는 패스워드는 현재 로그인된 user의 패스워드를 입력하면된다.
저렇게 친 후에 패스워드를 입력해주면 끝이다. 그러나 조금더 강력한 보안이 필요하다면

$ sudo bash
  Password :
#

이 상태에서 루트의 권한이 필요한 작업들을 해도 된다.


by cranix 2006. 12. 20. 17:16
-> Networking                                                           
  │       -> Networking support (NET [=y])                              
  │         -> Networking options                                               
  │           -> Network packet filtering (replaces ipchains) (NETFILTER [=y])   
  │             -> Core Netfilter Configuration               
<*> Netfilter Xtables support (required for ip_tables)                      
  │ │ <*>   "CLASSIFY" target support                          
  │ │ <*>   "MARK" target support                                  
  │ │ <*>   "NFQUEUE" target Support                                   
  │ │ <*>   "NOTRACK" target support                                   
  │ │ <*>   "comment" match support                                    
  │ │ <*>   "conntrack" connection tracking match support              
  │ │ <*>   "DCCP" protocol match support                              
  │ │ <*>   "helper" match support                                     
  │ │ <*>   "length" match support                                          
  │ │ <*>   "limit" match support                                           
  │ │ <*>   "mac" address match support                                     
  │ │ <*>   "mark" match support                                            
  │ │ <*>   "pkttype" packet type match support                             
  │ │ <*>   "realm" match support                                           
  │ │ <*>   "sctp" protocol match support                                   
  │ │ <*>   "state" match support                                           
  │ │ <*>   "string" match support                                          
  │ │ <*>   "tcpmss" match support                   

-> Networking                                                              
  │       -> Networking support (NET [=y])                                
  │         -> Networking options                                                                
          │
  │           -> Network packet filtering (replaces ipchains) (NETFILTER [=y])   
  │             -> IP: Netfilter Configuration
<*> IP tables support (required for filtering/masq/NAT)                   
  │ │ <*>   IP range match support                    
  │ │ <*>   Multiple port match support               
  │ │ <*>   TOS match support                          
  │ │ <*>   recent match support           
  │ │ <*>   ECN match support                              
  │ │ <*>   DSCP match support                             
  │ │ <*>   AH/ESP match support                           
  │ │ <*>   TTL match support                              
  │ │ <*>   Owner match support                            
  │ │ <*>   address type match support                     
  │ │ <*>   hashlimit match support                        
  │ │ <*>   Packet filtering                            
  │ │ <*>     REJECT target support                      
  │ │ <*>   LOG target support                            
  │ │ <*>   ULOG target support (OBSOLETE)                
  │ │ <*>   TCPMSS target support                          
  │ │ <*>   Full NAT                                       
  │ │ <*>     MASQUERADE target support                     
  │ │ <*>     REDIRECT target support                        
  │ │ <*>     NETMAP target support                          
  │ │ <*>     SAME target support                             
  │ │ <*>     Basic SNMP-ALG support (EXPERIMENTAL)            
  │ │ <*>   Packet mangling                                    
  │ │ <*>     TOS target support                                
  │ │ <*>     ECN target support                                
  │ │ <*>     DSCP target support                                
  │ │ <*>     TTL target support                                  
  │ │ <*>   raw table support (required for NOTRACK/TRACE)
by cranix 2006. 12. 18. 17:12
# genkernel --menuconfig all

- 원하는 옵션선택후 reboot 하면 알아서 적용됨.
by cranix 2006. 12. 18. 16:40


- 아래와같이 로컬 포트를 확인하면 mysql 이 살아있지만
# nmap localhost

- 아래와같이 외부포트를 확인하면 mysql 이 죽어있는경우
# nmap cranix.net

- mysql 의 아래 설정파일에서 변경해 주면 된다.
# /etc/mysql/my.cnf 에 bind-address=127.0.0.1 부분 주석걸면 된다.
by cranix 2006. 12. 18. 15:03

원래 jk2.properties 파일이 톰켓 conf 디렉토리에 있어야 하지만 톰켓 5.5 에서 jk2 가 deprecated  되었기때문에 없다. 개발자들의 흥미가 떨어져서 중단됬다고 한다..ㅡ.ㅡ;

그러나 걱정하지 말자 server.xml 파일에 기존의 jk 커넥터가 기본으로 설정되어 있으니 그냥 사용하면 된다. (똑같은 jk 이기때문에 호환 되는거 같다.)

그리고 아파치로 서비스 하게되면 8080 번 포트의 기본 커넥터가 필요없어지니 server.xml 파일에서 주석 걸어두는게 좋을 것이다.



이 문서는 apache2 와 tomcat5.5 가 설치되어있다고 가정한다.



1. UBUNTU 에 JK2 설치하기


$ sudo apt-get install libapache2-mod-jk2



2. jk2.conf, jk2.load 파일 apache2 conf 파일에서 Include 하기

- apache2 conf 파일을 열어보면 아래와같은 부분을 볼수있다.


Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf


- /etc/apache2/mods-enabled 디렉토리에 load 나 conf 파일을 넣어준다면 자동 Include 된다는 소리다.

- /etc/apache2/mods-available 디렉토리에 있는 jk2.conf,jk2.load 파일을 mods-enabled 로 링크 해주자.


3. jk2.conf 파일을 열어보면 아래와같이 또 인클루드 하는데 해당 파일이 없을테니 만들어주자


JkSet config.file /etc/apache2/workers2.properties



4. /etc/apache2/workers2.properties 파일


# Define the communication channel
[status:]
[uri:/jkstatus/*]
group=status:
[shm:]disabled=1
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
tomcatId=localhost:8009


# Web Applicaton
[uri:/jsp-examples/*]
info=Map the whole webapp



5. 톰켓 & apache2 재시작


6. http://localhost/jsp-examples/ 들어가봤을때 제대로 나오면 성공이다.

by cranix 2006. 12. 16. 20:17
| 1 2 3 4 |