LINUX(리눅스) - 해당되는 글 65건

CentOS 6.3 X64 기준

아파치 2.2.15
실행 : /etc/init.d OR service httpd start
아파치 2.2.15
실행 : /etc/init.d OR service httpd start
설정파일 : /etc/httpd/conf, /etc/httpd/conf.d/php.conf

UserDir public_html (372)
Starting httpd: httpd: apr_sockaddr_info_get() failed for test
=> 276라인   ServerName 지정해주면 나타나지 않음

372라인  UserDir public_html
401라인  DirectoryIndex index.html index.html.var 확인
758라인  AddDefaultCharset UTF-8

* AddType application/x-httpd-php .php .htm .php3 .html
* AddType application/x-httpd-php-source .phps
 => PHP인식 위에 2가지 옵션을 적었는데 6.3 버전 RPM구성시 적지 않아도
    자동으로 PHP인식 확인(httpd.conf가 아닌 php.conf에 설정되어 있는것 같음)

홈폴더 : /var/www/html
기본 index.html


Mysql 5.1.69
실행 : /etc/init.d OR service mysqld start (설정파일 /etc/my.cnf)

DB파일위치 : /var/lib/mysql
소켓위치 : /var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
기타관련 파일 위치 : /usr/bin => mysqladmin도 여기에 위치함


[root@firewall bin]# service mysqld start
MySQL 데이타베이스를 초기화하는 중:  Installing MySQL system tables...

=>처음 데몬을 실행하면 DB을 초기한다.

[root@test bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.69 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
=>초기는 root 암호없이도 접속가능하므로 암호을 설정한다.

mysqladmin -u root password '암호'   => 암호설정
mysql -u root -p => 연결
Enter password:


PHP 5.3.3
설정파일 : /etc/php.ini

693라인 register_globals = Off 기본값임

 

|

1. apache 설치(httpd)
yum install httpd*

2. mysql 설치
yum install mysql*
yum install mysql-server

3. php 설치

yum install php*

4. php-mysql 연동 설치
yum install php-mysql


홈폴더에 test.php 만들고 브라우저로 테스트~
<?php
phpinfo();
?>

==========================================================
설정관련 참고사항

아파치 2.2.15
실행 : /etc/init.d OR service httpd start
설정파일 : /etc/httpd/conf ,  /etc/httpd/conf.d/php.conf

UserDir public_html (372)
Starting httpd: httpd: apr_sockaddr_info_get() failed for test
=> 276라인   ServerName 지정해주면 나타나지 않음

372라인  UserDir public_html
401라인  DirectoryIndex index.html index.html.var 확인
758라인  AddDefaultCharset UTF-8

* AddType application/x-httpd-php .php .htm .php3 .html
* AddType application/x-httpd-php-source .phps
 => PHP인식 위에 2가지 옵션을 적었는데 6.3 버전 RPM구성시 적지 않아도
    자동으로 PHP인식 확인(httpd.conf가 아닌 php.conf에 설정되어 있는것 같음)

홈폴더 : /var/www/html
기본 index.html

 

|

Centos6.3 X 64버전 PHP 테스트서버 설치 요약 -DVD로 설치-

- Basic Storage Device 선택

- 인스톨 파일 타입 Create Custom Layout 선택

   (/boot 200, SWAP 4GB, 나머지 모든용량 / => 파일시스템은 EXT4 선택)

- 설치 유형은 Basic Server

- 팩키지는 세부모드에서 Base system 쪽과 Server쪽의 System administrator tools  선택

- 설치 완료후 네크워크카드 확인후 인터넷 확인

  (setup으로 IP 입력하고, ifcfg-eth0 파일에 ONBOOT=no을 yes로 변경후 인터넷 가능)

- vi /etc/sysconfig/selinux 사용안하기

- 설치 완료후 yum -y update 진행

 

|

1. Win7 + Centos5 멀티부팅 되겠끔 설치 하면서 알아야 할것

 * 먼저 물리적 하드1개는 2개의 파티션으로 잡는다.(C:400GB / 나머지 100GB 리눅스 설치)

 * C 400GB에는 윈도우7 먼저 설치 한다.

 * 나머지 남은 부분에 리눅스 설치한다.

   (주의점 부트로더인 GRUB를 sda  에 설치한다.)

 

* GRUB로 부팅하면 디폴트로 0번째 리눅스로 부팅하고 OS선택 메뉴가 숨겨져 있다.

 리눅스로 부팅해서 /etc/grub.conf 에서 수정한다.

   - timeout 부팅화면선택시 머무리는 시간 10초정도
  - hiddenmenu 주석처리 (OS선택 화면 보이게 함)

|

최신 배포판 CentOS 6.3 테스트 설치중 인데..5.X setup에서 Selinux 바로 설정 오프 할수 있었는데

6.3점에서는 방화벽 설정만 보이고 보이질 않아서 직접 수정하는 방법입니다.

1. cd /etc/sysconfig/

2. vi selinux

3. SELINUX=enforcing =>SELINUX=disabled

로 바꾸어 주면 됩니다.

|



MRTG을 이용해 서버의 트랙픽을 모니터링 해보자

1. yum install net-snmp*  서버에 snmp을 설치한다.

net-snmp                  i386     1:5.3.2.2-9.el5_5.1       updates     697 k
 net-snmp-devel            i386     1:5.3.2.2-9.el5_5.1       updates     1.9 M
 net-snmp-perl             i386     1:5.3.2.2-9.el5_5.1       updates     198 k
 net-snmp-utils            i386     1:5.3.2.2-9.el5_5.1       updates     186 k

2. yum install mrtg*  (var/www/mrtg)
 * mrtg을 인스톨 한다.

mrtg                 i386                 2.14.5-2                  base                 841 k

3. 그래픽 라이브러리 시스템에 설치되어 있는지 확인하고 없으면 설치한다.
 *freetype/gd/libjpeg/libpng

4, /etc/snmp/snmp.conf 수정한다. 기본 커뮤니티 값은 public으로 했다.
   사용자가 원하는 값을 줘도 무방하다.

#com2sec notConfigUser  default       public
     42 com2sec local    localhost        public
     43 com2sec network  221.16.1.X   public

#group   notConfigGroup v1           notConfigUser
     49 group   notConfigGroup v2c           notConfigUser
     50 group   rwgroup         v1      local
     51 group   rwgroup         v2c     local
     52 group   rwgroup         v1      network
     53 group   rwgroup         v2c     network

 #view    systemview    included   .1.3.6.1.2.1.1
     61 #view    systemview    included   .1.3.6.1.2.1.25.1.1
     62 view    all             included        .1      80
     63 view    systemview      included        system
     64 view    mib2            included        .iso.org.dod.internet.mgmt.mib-2 fc

 #access  notConfigGroup ""      any       noauth    exact  systemview none none
     71 access  rwgroup ""      any     noauth  exact   all     all     all
     72 access  rogroup ""      any     noauth  exact   systemview      none    none

*숫자는 라인값 이다.*


5. cfgmaker --global 'WorkDir: /home/mrtg/public_html/' --global 'Language: korean' --global 'Options[_]: bits,growright' -output /home/mrtg/public_html/mrtg.cfg public@서버IP
 * cfgmaker로 mrtg.cfg을 생성한다. workdir은 값의 저장장소로 웹표시가 가능해야 한다.

6.indexmaker --title "MRTG TEST" --output /home/mrtg/public_html/index.htm /home/mrtg/public_html/mrtg.cfg
*indenmaker로 인테스 파일을 생성한다. 인덱스파일은 위에서 설정한 웹표시가 가능한 장소이다.

7.vi /etc/cron.d/mrtg
*/5 * * * * root /usr/bin/mrtg /home/mrtg/public_html/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
 - corn에 등록해서 5분마다 실행하게 한다.

|



이미지 다운로드 : ftp://ftp.neowiz.com/pub/centos/5.4/isos/i386/CentOS-5.4-i386-netinstall.iso

시디로 구운후 부팅한다.

설치방법: http://kjhfull.tistory.com/entry/linuxnet  설치방법 참조

5.4에서는 FTP셋업은 아래와 같이 설정한다.
 FTP site name : ftp.neowiz.com
 CentOS directory : /pub/centos/5.4/os/i386

|

[test]# df -h => OS설치된 첫번째 하드 정보 일반 /dev/sda 랑 틀림
Filesystem                      Size  Used  Avail  Use%  Mounted on
/dev/cciss/c0d0p2     7.9G  2.2G   5.1G   32%     /
/dev/cciss/c0d0p5      58G  180M   52G   1%      /home
/dev/cciss/c0d0p1      200   17M   78M    18%    /boot

[root@]# fdisk /dev/cciss/c0d1
 => 두번째 하드 정보 일반알고 있는 /dev/sdb 랑 틀리네요
 (아래 두번째 하드 정보 현재 새하드 상태임)
Command (m for help): p =>두번째 하드 정보
Disk /dev/cciss/c0d1: 73.3 GB, 73372631040 bytes
255 heads, 32 sectors/track, 17562 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes
           Device Boot      Start         End      Blocks   Id  System

|
설치전 APM연동과 sendmail, dovecot 이 정상적으로 설치되어 있어야 합니다.

http://kjhfull.tistory.com/entry/YumAPM  => yum APM RPM 연동하기
http://kjhfull.tistory.com/entry/RPMAPM => RPM  APM관련 설정하기
http://kjhfull.tistory.com/entry/centosmail  => sendmail, dovecot  설정하기

SquirrelMail 설정
다람쥐 메일을 실행파일로 간단히 설정이 가능합니다.


1. yum이용해 SquirrelMail 설치한다.
  - [test]# yum install squirr*
    squirrelmail            noarch            1.4.8-5.el5.centos.7              
    php-mbstring            i386              5.1.6-23.2.el5_3

2. /usr/share/squirrelmail/config 밑에 conf.pl을 환경파일을 실행한다.

SquirrelMail Configuration : Read: config.php (1.4.0)
--------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages
D.  Set pre-defined settings for specific IMAP servers
C   Turn color off
S   Save data
Q   Quit
Command >> 2
*2번 서버셋팅으로 들어간다.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
General
-------
1.  Domain            : localhost
2.  Invert Time            : false
3.  Sendmail or SMTP             : Sendmail
A.  Update IMAP Settings  : localhost:143 (uw)
B.  Change Sendmail Config : /usr/sbin/sendmail
R   Return to Main Menu
C   Turn color off
S   Save data
Q   Quit
Command >>
1. 1번 도메인 => 서비스할 도메인을 적는다.(a.co.kr)
2.  A. Update IMAP Settings에 들어간다.
  -  4번 IMAP Server에 도메인을 넣는다.(a.co.kr)
  -  8번 Server software에 other = Not one of the above servers 선택한다.
  -  S선 선택하여 현재 설정을 저장한다.
      Command >> S
      Data saved in config.php Press enter to continue...
  - Q로 빠져나온다.
      Command >> Q
      Exiting conf.pl.
      You might want to test your configuration by browsing to
      http://your-squirrelmail-location/src/configtest.php

      Happy SquirrelMailing!

3. [test]# service httpd restart

사용자 삽입 이미지
4. http://IP/webmail 접속해서 아래 이미지가 나오면 정상이다. 아파치도 RPM으로 설치 되었다. 사용자 계정으로 로긴 한다.
로긴후 Option->Display preferences -> language에서 한글(Korean) 으로 바꾸고 Summit 한다.
이 외에도 옵션에선 다양한 설정이 가능하다.

사용자 삽입 이미지
5. 보내고 받기 테스트 결과 정상적으로 작동확인완료

|

1. sendmail 설정 (센트OS 5.3기준)
- 먼저 rpm -qa |grep sendmail 명령으로 sendmail이 설치되어 있는지 확인,
- 설치할 팩키지 -> yum install sendmail-cf-8.13.8-2.el5
- Pop3를 사용할려면 imap 팩키지가 설치되어 있어야 함(dovecot) -> 기본 imap에 비해 보안향상
- yum install dovecot-1.0.7-7.el5.i386

2. dovecot 설정
**/etc/dovecot.conf 화일 변경

20라인 protocal = pop3 pop3s imap imaps 주석제거
39라인 listen = [::] 주석제거

[test]# service dovecot start
Dovecot Imap (을)를 시작 중:                               [  OK  ]
[test]# telnet localhost 110 => 110번 pop3 접속확인
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.

3. sendmail 설정파일 위치
*smtp인증기능 추가위해 /etc/mail/sendmail.mc 52,53라인 주석제거 확인 후
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl


m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf ->바뀐것을 적용한다.

*적용한후
- /etc/mail/sendmail.cf : 센드메일의 가장 기본적인 설치파일 -> 265라인에 addr 제거
 (O DaemonPortOptions=Port=smtp, Name=MTA 수정후임)
- 89라인 Cwlocalhost => 주석처리
- /etc/mail/access : 릴레이 허용파일,기본적으로 로컬만 허용, 허용할 IP,domain추가 한다.
*엑세스 파일 교체되면 makemap hash /etc/mail/access < /etc/mail/access 실행
- /etc/mail/local-host-names : 메일을 수신할 호스트이름 결정 (a.co.kr or mail.a.co.kr)

* 인증을 위한  SASL 라이브러리가 설치되어 있어야 함
cyrus-sasl-md5-2.1.19-5.EL4
cyrus-sasl-2.1.19-5.EL4
cyrus-sasl-plain-2.1.19-5.EL4
cyrus-sasl-devel-2.1.19-5.EL4
[root@test]# service saslauthd restart 실행


4. sendmail 데몬 시작 / 확인
- service sendmail start 또는 init/sendmail start
- 마지막으로 telnet localhost 25 로 접속해서 아래와 같은 화면이 나오면 정상적으로 SMTP데몬이 돌고 있다.

* 인증확인
[test]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 test ESMTP Sendmail 8.13.8/8.13.8; Sun, 26 Jul 2009 10:03:01 +0900
ehlo localhost
250-test Hello hong [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
250-DELIVERBY
250 HELP

5. 최종 Outlook Express에서 테스트 한다. 메일계정 등록후

사용자 삽입 이미지
                      *도구-계정-메일-속성에서 서버탭에 인증필요 체크


                   *아웃룩에서 보내기 테스트


   * 받은메일 계정 Gmail 정상도착 => 답장보냄


    *답장도착 완료 =>정상적으로 작동된다.

 
|

샹콤홍쓰's Blog is powered by Daum & tistory