Showing posts with label Linux CentOS. Show all posts
Showing posts with label Linux CentOS. Show all posts

Sunday, January 19, 2014

access ssh linux in virtual box

첫번째로 virtualBox Host Network 를 Enable 해줘야 한다.
이거 하느라고 엄청나게 삽질 했음. ㅠㅠ





그런다음 사용하고 있는 가상 OS 셋팅을 해준다. 
네트워크로 가서 네트워크를 처음에 열어놓은 Virtual Box Host 로 선택한다




리눅스에서 셋팅을 dhcp 로 자동으로 할당하게 셋팅해놓았다.






그리고 윈도우에서 원갹으로 ssh 로 접속하면 정상적으로 접속 완료

ㅡㅡ V 김치

Monday, July 22, 2013

Tuesday, June 11, 2013

linux iptables

Korea Site IP tables 설정 http://blog.naver.com/PostView.nhn?blogId=dzknight&logNo=20186884051 America Site http://www.cyberciti.biz/tips/linux-iptables-examples.html

Saturday, April 27, 2013

Very Easy Setting Mod_jk

Why I write this post is I spend a lot of my time to setting up Apache and Tomcat7 width Mod_jk
There are lots of posts on website But proper to my computer setting
I Hope this guide to save your time
yum remove httpd
yum install httpd httpd-devel
after httpd installed
you have to download tomcat-connectors.
the version what i installed is tomcat-connectors-1.2.35-src
cd native
./configure --with-apxs=/usr/sbin/apxs
make
make install

you can find mod_jk.so /etc/httpd/modules
### Mod_jk : connect tomcat ####

httpd.conf add below
LoadModule jk_module modules/mod_jk.so

JkWorkerProperty worker.list=ajp13w
JkWorkerProperty worker.ajp13w.type=lb
JkWorkerProperty worker.ajp13w.balanced_workers=WAS1,WAS2
JkWorkerProperty worker.sticky_session=true

JkWorkerProperty worker.WAS1.type=ajp13
JkWorkerProperty worker.WAS1.host=localhost
JkWorkerProperty worker.WAS1.port=8009
JkWorkerProperty worker.WAS1.socket_timeout=3
JkWorkerProperty worker.WAS1.prepost_timeout=1000
JkWorkerProperty worker.WAS1.connect_timeout=1000
JkWorkerProperty worker.WAS1.lbfactor=1

JkWorkerProperty worker.WAS2.type=ajp13
JkWorkerProperty worker.WAS2.host=192.168.0.32
JkWorkerProperty worker.WAS2.port=8009
JkWorkerProperty worker.WAS2.socket_timeout=3
JkWorkerProperty worker.WAS2.prepost_timeout=1000
JkWorkerProperty worker.WAS2.connect_timeout=1000
JkWorkerProperty worker.WAS2.lbfactor=1

JkLogFile logs/jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
#JkMount /*.jsp ajp13w
JkMount /* ajp13w
JkMount /example/* ajp13w

JkUnMount /*.html ajp13w
JkUnMount /*.txt ajp13w
JkUnMount /*.gif ajp13w
JkUnMount /*.jpg ajp13w
#JkMount /servlet/* ajp13w
apache mpm should use worker.
basic setting is prefork
[root@node1 httpd]# apachectl -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c


/etc/sysconfig/httpd
#HTTPD=/usr/sbin/httpd.worker remove #

[root@buy-0936 sysconfig]# apachectl -l
Compiled in modules:
core.c
worker.c
http_core.c
mod_so.c

You finally success mod_jk. If you have Question Reply~!

Sunday, April 7, 2013

mod_jk Thread 설정


yum install httpd httpd-devel

해서 httpd 설치

그다음

cd tomcat-connectors-1.2.35-src
./configure --with-apxs=/usr/local/apache2/bin/apxs
make
make install
하면 mod_jk.so 파일이 httpd의 모듈 디렉토리에 들어감


### Mod_jk : connect tomcat ####

LoadModule jk_module modules/mod_jk.so

JkWorkerProperty worker.list=ajp13w
JkWorkerProperty worker.ajp13w.type=lb
JkWorkerProperty worker.ajp13w.balanced_workers=WAS1,WAS2
JkWorkerProperty worker.sticky_session=true

JkWorkerProperty worker.WAS1.type=ajp13
JkWorkerProperty worker.WAS1.host=localhost
JkWorkerProperty worker.WAS1.port=8009
JkWorkerProperty worker.WAS1.socket_timeout=3
JkWorkerProperty worker.WAS1.prepost_timeout=1000
JkWorkerProperty worker.WAS1.connect_timeout=1000
JkWorkerProperty worker.WAS1.lbfactor=1

JkWorkerProperty worker.WAS2.type=ajp13
JkWorkerProperty worker.WAS2.host=192.168.0.32
JkWorkerProperty worker.WAS2.port=8009
JkWorkerProperty worker.WAS2.socket_timeout=3
JkWorkerProperty worker.WAS2.prepost_timeout=1000
JkWorkerProperty worker.WAS2.connect_timeout=1000
JkWorkerProperty worker.WAS2.lbfactor=1

JkLogFile logs/jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
#JkMount /*.jsp ajp13w
JkMount /* ajp13w
JkMount /example/* ajp13w

JkUnMount /*.html ajp13w
JkUnMount /*.txt ajp13w
JkUnMount /*.gif ajp13w
JkUnMount /*.jpg ajp13w
#JkMount /servlet/* ajp13w



#### 아파치 MPM은 Worker 모델을 사용한다
[root@node1 httpd]# apachectl -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

[root@node1 httpd]# httpd -V
#HTTPD=/usr/sbin/httpd.worker 주석 해제

/etc/sysconfig/httpd

[root@buy-0936 sysconfig]# apachectl -l
Compiled in modules:
  core.c
  worker.c
  http_core.c
  mod_so.c


worker.c로 동작

웹서버에서의 AJP connection 개수는 AJP connector의 maxThreads 개수보다 작아야 한다.

AJP connector는 쓰레드가 하나의 connection을 서비스하는 구조이므로, 쓰레드 개수를 넘는 connection은 받아들일 수 없다.
따라서, 웹 서버의 최대 ajp connection 개수를 maxThreads 이상 설정해서는 안된다.


그렇다면 최대 ajp connection 개수는 어떻게 설정될까?
최대 ajp connection 개수 = 최대 프로세스 개수 * connection_pool_size



  최대 프로세스 개수
    Prefork 모델: MaxClients
    Worker 모델: MaxClients / ThreadsPerChild
    NT Thread 모델: 1

  connection_pool_size 기본값
    Prefork 모델: 1
    Worker 모델: ThreadsPerChild
    NT Thread 모델: ThreadsPerChild




reference http://clotho95.blog.me/140047805883

Saturday, March 16, 2013

linux ip setting


 vi /etc/sysconfig/network-script/ifcfg-eth0

 DEVICE=eth0
 BOOTPROTO=none
 HWADDR=08:00:27:02:c5:aa
 ONBOOT=yes
 NETMASK=255.255.255.0
 IPADDR=192.168.0.200
 GATEWAY=192.168.0.1
 TYPE=Ethernet

and 

service network restart

Tuesday, March 12, 2013

match against in mysql


CREATE TABLE `articles` (
  `id` int(11) NOT NULL DEFAULT '0',
  `title` varchar(65) DEFAULT NULL,
  `topic` varchar(25) NOT NULL DEFAULT '',
  `author` varchar(25) NOT NULL DEFAULT '',
  `ondate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `body` text NOT NULL,
  KEY `index_id` (`id`),
  FULLTEXT KEY `title` (`title`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8$$



select id,title FROM articles WHERE
    MATCH(title) AGAINST ('+cvs' IN BOOLEAN MODE) limit 1000;

what you have to consier is depending on DB Engine

Monday, February 18, 2013

open ssl install

http://dimdim.tistory.com/entry/openssl%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%9C-Tomcat-HTTPS-%EC%84%A4%EC%A0%95-PKCS12-%ED%8F%AC%EB%A7%B7

1.  access webSite

http://www.openssl.org/source/

2. use wget in linux and download

3. unzip gz file
  - gzip -d xxxx.tar.gz

4. tar
 tar -xvf xxxx.tar

5. ./config shared --prefix=/the folder to be installed/

6. make

7. make install



want to know if it exists

Thursday, January 10, 2013

open ssl

바로가기 경로

http://dimdim.tistory.com/entry/openssl-%EC%9D%B8%EC%A6%9D%EC%84%9C-%EC%83%9D%EC%84%B1

Friday, July 27, 2012

linux java classpath

vi /etc/profile

add below lines

#JAVA SETTING
export JAVA_HOME=/home/hadstore/java/jdk1.6.0_33
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar

souce /etc/profile : this is for reload

Wednesday, April 4, 2012


+x means a+x : all user can execute

$ chmod +x your-script-name
$ chmod 755 your-script-name





Examples:
$ bash bar
$ sh bar
$ ./bar



echo show on monitor


$ vi first
#
# My first shell script
#
clear
echo "Knowledge is Power"


$ ./first

Tuesday, March 20, 2012


when you write 'free' on linux

you will know the rest of you computer memory

[root@posu7 logs]# free

             total       used       free     shared    buffers     cached
Mem:        524288     404716     119572          0      76072      93512
-/+ buffers/cache:     235132     289156
Swap:      1081336        112    1081224

Sunday, March 11, 2012

Install Mysql

Now I let you know how to install MySQl on linux

First this will check if mysql is already installed on linux
# rpm -qa | grep mysql

Remove previouse Versin
# rpm -e  mysql-devel-5.0.77-4.el5_5.4 –-nodeps(--nodeps will ignore dependencies)

And go to web site to find the version that you want to install


# rpm -ivh Mysql-server....rpm
# rpm -ivh Mysql-share.....rpm
# rpm -ivh mysql-devel......rpm
# rpm -ivh mysql-client......rpm

A) If you are /using mysql on RedHat Linux (Fedora Core/Cent OS) then use following command:

* To start mysql server:
/etc/init.d/mysqld start
* To stop mysql server:
/etc/init.d/mysqld stop
* To restart mysql server
 /etc/init.d/mysqld restart
# service mysqld start
# service mysqld stop
# service mysqld restart
$ mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'; 

mysql> FLUSH PRIVILEGES;
and /etc/sysconfig vi iptables and add open 3306 port

Saturday, March 10, 2012

What is RPM

RPM(RedHat Package Manager)

RPM Package Manager (RPM) is a package management system.[2]The name RPM variously refers to the .rpm file format, files in this format,software packaged in such files, and the package manager itself. RPM was intended primarily for GNU/Linux distributions; the file format is the baseline package format of the Linux Standard Base.

rpm -qi :  mtools-3.9.8-2.i386.rpm print package summary
rpm -i : mtools-3.9.8-2.i386.rpm install package
rpm -ivh : mtools-3.9.8-2.i386.rpm install, monitor and verify pack
rpm -q : mtools verify if pack installed
rpm -qa :  list all installed packs
rpm -ql : mtools list all files installed for pack
rpm -qd : mtools list pack doc files only
rpm -e  : mtools erase package
rpm -Uvh :  * upgrade all packs in distribution

What is Wget

What is Wget

Definition: wget: retrieves files from the web Wget is a network utility to retrieve files from the Web using http and ftp, the two most widely used Internet protocols. It works non-interactively, so it will work in the background, after having logged off. The program supports recursive retrieval of web-authoring pages as well as ftp sites -- you can use wget to make mirrors of archives and home pages or to travel the Web like a WWW robot. Wget works particularly well with slow or unstable connections by continuing to retrieve a document until the document is fully downloaded. Re-getting files from where it left off works on servers (both http and ftp) that support it. Both http and ftp retrievals can be time stamped, so wget can see if the remote file has changed since the last retrieval and automatically retrieve the new version if it has. Wget supports proxy servers; this can lighten the network load, speed up retrieval, and provide access behind firewalls. http://www.gnu.org/software/wget/


To istall on linux

yum install wget

It is very easy

Thursday, March 8, 2012

FTP Install

First you need to download lftp


[root@localhost /]# yum install lftp

after that 

mkdir /usr/local/src/ftpd
cd /usr/local/src/ftpd


before you write below line, you should look on the http://www.proftpd.org/
and check lasted version.

lftpget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4a.tar.gz

[root@localhost ftpd]# tar -xvzf proftpd-1.3.4a.tar.gz
proftpd-1.3.4a/
proftpd-1.3.4a/doc/
proftpd-1.3.4a/doc/utils/
proftpd-1.3.4a/doc/utils/ftpcount.html
proftpd-1.3.4a/doc/utils/ftpmail.html
proftpd-1.3.4a/doc/utils/ftpasswd.html
proftpd-1.3.4a/doc/utils/ftpscrub.html
proftpd-1.3.4a/doc/utils/ftpwho.html
proftpd-1.3.4a/doc/utils/ftptop.html
proftpd-1.3.4a/doc/utils/ftpquota.html
proftpd-1.3.4a/doc/utils/ftpdctl.html
proftpd-1.3.4a/doc/utils/index.html
proftpd-1.3.4a/doc/utils/ftpshut.html
proftpd-1.3.4a/doc/contrib/
proftpd-1.3.4a/doc/contrib/mod_sql_odbc.html
proftpd-1.3.4a/doc/contrib/mod_wrap2_file.html
proftpd-1.3.4a/doc/contrib/mod_ifsession.html
proftpd-1.3.4a/doc/contrib/mod_exec.html
proftpd-1.3.4a/doc/contrib/mod_quotatab.html
proftpd-1.3.4a/doc/contrib/mod_ldap.html
proftpd-1.3.4a/doc/contrib/mod_radius.html
proftpd-1.3.4a/doc/contrib/

...............


[root@localhost proftpd-1.3.4a]# ./configure --prefix=/usr/local/server/proftpd --enable-autoshadow --enable-shadow
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
[root@localhost proftpd-1.3.4a]# 



if you find 

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH

you should install : yum install gcc
you should install : yum install make

and retry ./configure ..........


write : make

write : make install

/usr/local/server/proftpd/etc/proftpd.conf 

oepn with vi 

and line 27 nogroup -> nobody

[root@localhost sbin]# ./proftpd &
[1] 11663

why & add??
this means that we run server in background


vi iptables

# Generated by iptables-save v1.4.2 on Mon Jul 11 14:23:01 2011
*filter
:INPUT ACCEPT [1190:468478]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [763:273145]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
COMMIT

service iptables restart

and try to access from ftp tools