반응형

리눅스 umount 시도시 사용중인 폴더라 umount 되지 않을시에 

강제로 umount 하는 방법입니다. 



# fuser -ck 마운트디렉토리

ex) fuser -ck /home/ince


위와 같이 실행하면 사용중인 프로세서를 강제로 kill 합니다. 


이후 다시 umount 시도하면 정상적으로 언마운트가 됩니다. 




마운트 폴더를 사용중인 프로세서를 확인 하는 방법도 같은 명령어를 사용합니다.

# fuser -cu /home/ince


위와 같이 실행하면 마운트 폴더를 사용하는 프로세서를 확인할수 있습니다. 







반응형
반응형


IPTables FTP Passive Mode 설정 - vsftp 설정

FTP 접속시에 Active mode(활성), Passive Mode(비활성) 두가지 모드가 있는데 Active 경우는 일반적인 경우 21번 포트를 사용하지만 Passive Mode 에서는 LIST 등의 명렁을 위해 하나의 포트가 더 필요합니다. 이 해당 포트를 일정 범위로 지정 후에, iptables 에서 해당 포트를 오픈해서 사용하는 것이 좋습니다.

1. vsftpd 설정

[root@mail ~]# vi /etc/vsftpd/vsftpd.conf

pasv_enable=YES
pasv_promiscuous=YES
pasv_min_port=50000
pasv_max_port=50100

[root@mail ~]# /etc/init.d/vsftpd restart

2. iptables 설정

[root@mail ~]# vi /etc/sysconfig/iptables

-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 21 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 50000:50100 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 50000:50100 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

[root@mail ~]# service iptables restart 

출처 : http://ihelpers.x2soft.co.kr/programming/tipntech.php?CMD=print&IDX=690&source=overture



주로 접속하는 기기가 사설아이피의 경우 Active mode(활성) 모드일 경우 접속이 되지 않거나

접속후에 리스트가 아무것도 표시 되지 않는 문제가 있습니다. 

이럴경우 Passive Mode 모드로 변경해주면 해결이 됩니다. 


위는 vsftp를 Passive Mode로 설정하는 방법입니다.






반응형
반응형

/etc/rc.local 에 mysql을 등록 했었는데, 


mysql이 실행되기도 전에 서버 서비스를 위한 java 데몬이 실행되면서 DB를 찾지 못하고 꺼져버리는 문제 발생.!!!


소스로 설치한 mysql은 따로 service에 등록해야 됩니다.


서비스가 먼저 실행되고 rc.local이 실행되며 정상적으로 게임 서비스가 되네요.


등록방법은 아래와 같습니다.


mysql 자동실행 설정

/usr/local/mysql/support-files/mysql.server 를  /etc/init.d 에 mysqld 로 복사. 

# chkconfig --add mysqld 
# chkconfig --level 2345 mysqld on 
# chmod 755 /etc/rc.d/init.d/mysqld
이제 ntsysv 에서 확인하시거나 top를 통해 확인해 보시면 mysqld 가 추가되어 있을겁니다.


^ㅡ^ 쉽죠?






반응형
반응형


mysql 5.5 은 yum 기본설치로는 설치할수 없습니다. 


구글링 하다가 mysql 5.5를 yum을 통해서 설치하는 법이 있어서 스크랩 차원에서 남겨둡니다.



Step 1: Installing Remi Repository

Firstly, we need to install the Remi repository on your selected Linux distributions.

For Fedora 18-12

## Install Remi Repository on Fedora 17, 16, 15
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

## Fedora 18 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-18.rpm

## Fedora 17 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-17.rpm

## Fedora 16 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-16.rpm

## Fedora 15 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm

## Fedora 14 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm

## Fedora 13 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm

## Fedora 12 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm

For RHEL/CentOS 6-5

## Install Remi Repository on RHEL/CentOS 6.7-6.0 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

## Install Remi Repository on RHEL/CentOS 5.4-5.0 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

Step 2. Checking MySQL 5.5.30 Availability

After, installing Remi repository on your system, then look for MySQL latest version using –enablerepo=remi switch option.

# yum --enablerepo=remi list mysql mysql-server

Sample Output:

Available Packages
mysql.i686		5.5.30-1.el6.remi	remi
mysql-server.i686	5.5.30-1.el6.remi       remi

Step 3: Updating or Installing MySQL 5.5.30

Once you see the latest MySQL version is available for installation, then follow below steps to update or install MySQL 5.5.30.

# yum --enablerepo=remi install mysql mysql-server

Step 4: Starting/Stopping MySQL Server

Follow the below command to start/stop of the MySQL service.

# /etc/init.d/mysqld start
# /etc/init.d/mysqld stop
# /etc/init.d/mysqld status

Step 5: Connecting to MySQL Server

Connecting to newly installed MySQL server by providing username and password. If you haven’t yet set any password for your MySQL installation the simply hit enter.

# mysql -u root -p

Sample Output:

[root@twiki ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1052
Server version: 5.5.30 MySQL Community Server (GPL) by Remi

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

That’s it, you’ve successfully installed MySQL 5.5.30 on your system. If you’re having any trouble installing feel free to use our comment section for solutions.

출처 : http://www.tecmint.com/install-mysql-on-rhel-centos-6-5-fedora-17-12/






반응형
반응형

윈도우로 치면 바로가기 되겠네요 ^^


리눅스 링크 폴더 만들기


ln -s /data/Log /home/user/Log
ln -s [대상폴더][링크이름]







반응형
반응형

리눅스 명령어중 해당 파일의 경로를 알려주는 명령어는 which 입니다. 


jdk 설치후 java의 경로를 알고 싶을때는 which 명령어를 사용하시면 됩니다.


ex) which java 

혹시 나오지 않는다면 find를 사용하시면 전체를 다 뒤져줍니다.


최상위 경로에서 

ex) find -name java

대신 시간이 좀 오래 걸립니다.


참 쉽죠?


해당 명령어는 응용이 무궁 무진합니다.


ex) which mysql


등등 으로도 쓸수 있습니다.





반응형

+ Recent posts