2014년 8월 22일 금요일

[TIP] Online Education WebSite

http://www.w3schools.com/

http://opentutorials.org/course/62

http://www.phpschool.com/

2014년 8월 7일 목요일

[CentOS] CentOS 6.5 - MySQL and Apache2 and PHP Configuration

Installing MySQL 5
To install MySQL, we do this:

[root@~]# yum -y install mysql mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

chkconfig --levels 235 mysqld on
[root@~]# /etc/init.d/mysqld start

Set passwords for the MySQL root account:

mysql_secure_installation

[root@~]#  mysql_secure_installation

Installing Apache2
Apache2 is available as a CentOS package, therefore we can install it like this:

[root@~]# yum -y install httpd

Now configure your system to start Apache at boot time...

chkconfig --levels 235 httpd on

... and start Apache:

[root@~]# /etc/init.d/httpd start

Now direct your browser to http://192.168.0.100, and you should see the Apache2 placeholder page:


Apache's default document root is /var/www/html on CentOS, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.



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

cofig files input
......
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT


[root@~]# service iptables restart


 Installing PHP5
We can install PHP5 and the Apache PHP5 module as follows:

[root@~]# yum -y install php


We must restart Apache afterwards:

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

5 Testing PHP5 / Getting Details About Your PHP5 Installation
The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

[root@~]# vi /var/www/html/info.php

<?php
phpinfo();
?>

Now we call that file in a browser (e.g. http://192.168.0.100/info.php):


As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5 yet.



6 Getting MySQL Support In PHP5
To get MySQL support in PHP, we can install the php-mysql package. It's a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:

[root@~]# yum search php

Pick the ones you need and install them like this:

[root@~]# yum -y install php-mysql

In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla and Drupal:

[root@~]# yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy curl curl-devel

APC is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and Xcache. It is strongly recommended to have one of these installed to speed up your PHP page.

APC can be installed as follows:

[root@~]# yum -y install php-pecl-apc

Now restart Apache2:

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

Now reload http://localhost/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the APC module:


phpMyAdmin
phpMyAdmin is a web interface through which you can manage your MySQL databases.

First we enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS 6.5 repositories:

Import the RPMforge GPG key:

[root@~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

On x86_64 systems:

[root@~]# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

On i386 systems:

[root@~]# yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

phpMyAdmin can now be installed as follows:

[root@~]# yum -y install phpmyadmin

Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory "/usr/share/phpmyadmin"> stanza):

[root@~]# vi /etc/httpd/conf.d/phpmyadmin.conf

#
#  Web application to manage MySQL
#

#<Directory "/usr/share/phpmyadmin">
#  Order Deny,Allow
#  Deny from all
#  Allow from 127.0.0.1
#</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
Next we change the authentication in phpMyAdmin from cookie to http:

[root@~]# vi /usr/share/phpmyadmin/config.inc.php

[...]

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

or

$cfg['Servers'][$i]['auth_type'] = 'cookie';

[...]
Restart Apache:

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

Afterwards, you can access phpMyAdmin under http://localhost/phpmyadmin/:





[CentOS] SSH Config - PermitRootLogin


## CentOS 6.5 64Bit Version


OpenSSH Configuration Files
[root@dev]# vi /etc/ssh/sshd_config
[root@dev]# /etc/rc.d/init.d/sshd restart

# LoginGraceTime 2m
설정한 시간내에 로그인 하지 않으면 자동으로 접속을 끊도록 설정 한다. 값을 0으로 하면 무제한 이다.

# PermitRootLogin no
기본값은 주석처리 되어 있어 기본으로 값은 'yes' 이다. 공격자가 임의의 주소에 root 계정으로 접속이 가능한지 여부를 알아 낼 수 있다. 따라서 위와 같이 root 계정의 접근을 막고 일반 유저로 접속한 다음 root 계정으로 전환 하는 것이 일반적이다.

# MaxAuthTries 6
접속당 최대 인증 시도 횟수. 기본값 6, 3회이상 인증 실패시 로그가 기록

2014년 8월 6일 수요일

[ITS 일반] Mail Server Error Return Message Type

■ 원인

 - 받는 메일 서비스에 장애가 생겼을 때
 - 받는 사람의 메일 주소가 정확하지 않았을때
 - 수신자의 메일함 용량이 초돠되어 더 이상 메일을 받을 수 없을 때
 - 받는 사람이 수신거부를 설정하였을때

CONNECTION ERROR:

421 4.4.1 IP ADDRESS: Network is busy.

한메일 수신 서버가 응답을 못하는 상황입니다. 잠시 후 다시 접속을 시도해 주시기 바랍니다.

421 4.4.5 IP ADDRESS: Connection refused. Server is busy.

한메일 수신서버에 동시접속 가능한 수를 초과하였습니다. (white IP기준 100개)
접속 수를 줄여 재발송을 시도해 주시기 바랍니다.

554 5.7.1 IP ADDRESS: Connection refused. Your IP address is blocked.

Daum 스팸센터에서 해당IP를 스팸IP로 판단하여 접속을 차단하였습니다.
자세한 사항은 스팸센터로 문의 하시기 바랍니다.

COMMAND ERROR:

421 4.4.0 IP ADDRESS: Closing connection by timeout

시간초과로 한메일 수신 서버 접속이 끊겼습니다. 다시 접속해 주시기 바랍니다.

421 4.7.0 IP ADDRESS: Too many bad commands

사용 불가능한 명령어의 제한 수를 초과하였습니다. 명령어를 확인 후 다시 입력하시기 바랍니다.

421 4.7.0 IP ADDRESS: Too many transactions

한 번 접속 후 접속을 끊지 않고 계속해서 메일을 발송할 경우, 일정양의 메일 수신후 한메일 서버에서 더 이상의 메일수신을 거부합니다. 메일 발송 시, 기존 접속을 끊고 새로운 접속을 맺으셔야 합니다.

500 5.5.0 IP ADDRESS: Command line too long

명령어가 제한길이인 8,192 바이트를 초과하였습니다. 명령어를 확인 후 다시 입력하시기 바랍니다.

500 5.5.2 IP ADDRESS: Command not recognized: UNRECOGNIZED COMMAND

한메일 수신 서버가 이해할 수 없는 명령어 입니다. SMTP 규약에 맞게 수정 후 다시 입력해 주시기 바랍니다.

501 5.5.2 IP ADDRESS: Syntax error in command line: COMMAND LINE

명령어 구문에 오류가 있습니다. SMTP 규약에 맞게 수정 후 다시 입력해 주시기 바랍니다.

501 5.5.4 IP ADDRESS: EHLO requires domain name

EHLO 명령어에 도메인 명이 포함되어 있지 않아 반송되었습니다. 도메인 명을 포함한 명령어를 다시 입력해 주시기 바랍니다.

501 5.5.4 IP ADDRESS: Command argument required

명령어에 필요한 인자값이 없습니다. SMTP 규약에 맞게 수정 후 다시 입력해 주시기 바랍니다.

501 5.5.4 IP ADDRESS: Invalid command argument: ARGUMENT

명령어 중 인자의 포맷이 올바르지 않습니다. SMTP 규약에 수정 다시 입력해 주시기 바랍니다.

502 5.5.1 IP ADDRESS: Command not implemented: UNIMPLEMENTED COMMAND

이 메시지로는 정확한 에러 사항을 파악할 수 없습니다.
telnet으로 한메일 수신 서버에 접속하여 발송하기까지의 로그를 복사하여 보내주시면 문제를 확인해 드리겠습니다.
한메일 수신 서버 아이피 : 222.231.35.29



MAIL COMMAND ERROR:

450 4.7.1 IP ADDRESS: Message refused. Your IP address has sent too many mails(MAIL COUNT).

한메일로 전송 가능한 메일 통수를 초과하였습니다. 자세한 사항은 스팸센터로 문의해 주시기 바랍니다.

451 4.4.1 IP ADDRESS: Network is busy(TYPE)

보낸이의 메일주소가 유효한 Daum 사용자인지 확인하던 중, 일시적인 오류가 발생하였습니다. 잠시 후 재전송을 시도해 주십시오.

503 5.5.1 IP ADDRESS: Sender already specified

보낸이의 메일 주소가 이미 정의되어 있습니다. SMTP 규약에 따라 보낸이의 메일주소는 중복해서 정의될 수 없습니다.
명령어를 확인하신 후 다시 발송시도 해주시기 바랍니다.

550 5.1.8 IP ADDRESS: No such user: SENDER ADDRESS

보낸이의 메일 주소가 Daum에 가입되지 않은 아이디입니다. 보낸이 주소를 확인 후, 재 발송해 주시기 바랍니다.

553 5.1.7 IP ADDRESS: Invalid mail address: SENDER ADDRESS

보낸이의 메일 주소가 한메일 수신 서버에서 확인되지 않는 주소입니다. 보낸이 주소를 확인 후, 재발송 해주시기 바랍니다.



RCPT COMMAND ERROR:

450 4.5.3 IP ADDRESS: Too many recipients

한메일 수신서버가 한번에 받을수 있는 받는이 수 제한을 초과했습니다. 받는이를 나눠서 메일을 재발송해주십시오.

451 4.2.0 IP ADDRESS: Temporary home error: RECIPIENT ADDRESS

받는이의 한메일 홈서버에 일시적인 장애가 있어서 메일을 수신할 수가 없습니다. 잠시 후 다시 시도해 주시기 바랍니다.

451 4.4.1 IP ADDRESS: Network is busy

받는이의 메일주소가 유효한 Daum 사용자인지 확인하던 중, 일시적인 오류가 발생하였습니다. 잠시 후 재전송을 시도해 주십시오.

503 5.5.1 IP ADDRESS: MAIL command required

받는이의 메일주소를 정의하기 전에 반드시 보낸이의 메일주소를 정의하여야 합니다.
SMTP 규약에 맞게 명령어를 다시 입력해주시기 바랍니다.

550 5.1.1 IP ADDRESS: No such user: RECIPIENT ADDRESS

받는이의 메일주소가 Daum에 가입되지 않은 아이디입니다. 받는이 주소를 확인 후 다시 발송해 주시기 바랍니다.

550 5.2.0 IP ADDRESS: Message refused by the recipient: RECIPIENT ADDRESS

받는이가 보낸이 주소를 ‘수신거부’ 혹은 ‘바로삭제’로 설정하여 메일이 전달될 수 없습니다.

550 5.2.1 IP ADDRESS: Mailbox is inactive: RECIPIENT ADDRESS

받는이가 Daum에 로그인한지 3개월 이상 지나 휴면계정으로 전환된 사용자입니다.
Daum 휴면 사용자는 메일을 수신할 수 없습니다.

552 5.2.2 IP ADDRESS: Mailbox is full: RECIPIENT ADDRESS

받는이의 편지함이 가득 차서 더 이상 메일을 수신할 수 없습니다.
받는이에게 다른 방법으로 연락이 가능하시다면 한메일의 편지함 정리를 요청해주시기 바랍니다.

553 5.1.2 IP ADDRESS: Relaying denied: RECIPIENT ADDRESS

@hanmail.net 또는 @daum.net이 아닌 주소로 메일을 발송하였습니다. 받는이 메일 주소를 확인 후, 다시 발송해 주시기 바랍니다.

553 5.1.3 IP ADDRESS: Invalid mail address: RECIPIENT ADDRESS

받는이의 메일 주소가 정확하지 않습니다. 확인후 재발송 해주시기 바랍니다.



DATA COMMAND ERROR:

451 4.4.1 IP ADDRESS: MESSAGE ID Network is busy

한메일 수신서버 네트워크의 일시적인 오류로 인하여 메일이 전달되지 않거나, 저장이 되지 않았습니다.
잠시 후, 발송을 다시 시도해 주시기 바랍니다.

503 5.5.1 IP ADDRESS: MAIL command required

보낸이의 메일주소가 정의되지 않았습니다. 확인 후 다시 명령어를 입력해 주시기 바랍니다.

503 5.5.1 IP ADDRESS: RCPT command required(recipient)

받는이의 메일주소가 정의되지 않았습니다. 1명 이상의 받는이 주소를 포함시켜 다시 발송해 주시기 바랍니다.

552 5.2.3 IP ADDRESS: Message size exceeds the limit(LIMIT)

메일이 수신 제한 용량을 초과하였습니다. (일반 회원:20M, 프리미엄 회원:50M)
사이즈를 줄여 다시 발송해 주시기 바랍니다.

554 5.4.6 IP ADDRESS: Routing loop detected

한메일 수신 서버가 이미 해당 메일을 수신하였습니다. 발송 서버의 루핑이 예상되오니, 확인을 부탁드립니다.

554 5.6.0 IP ADDRESS: Message requires 'From' header

헤더에 보낸이 정보가 없는 경우 수신을 거부합니다. 정확한 보낸이 주소를 포함하여 다시 발송해주시기 바랍니다.

554 5.6.0 IP ADDRESS: Invalid 'From' header: FROM

헤더의 보낸이 정보가 ‘RFC2822 인터넷 메시지 규정’에 맞지 않는 경우 수신을 거부합니다.
RFC 규정을 참고 후, 다시 발송해주시기 바랍니다.

554 5.7.1 IP ADDRESS: Message refused. Your host name(HOST NAME) dosen't match with your IP address.

메일발송 IP 정보와 Hostname 정보가 일치하지 않아 해당 메일 수신을 거부합니다.
발송 서버에 ‘MX레코드’와 ‘리버스 도메인’이 등록되어 있는지 확인해주시기 바랍니다. 2개 모두 정확히 등록되어 있어야 합니다.
도메인 설정이 정확한지 네트워크 담당자에게 문의해주세요.

554 5.7.1 IP ADDRESS: Message refused. Your domain(DOMAIN) has sent too many mails.

해당 도메인에서 너무 많은 메일이 발송되어, 한메일 수신이 원활하지 않습니다. 잠시 후 다시 발송해 주시기 바랍니다.

554 5.7.7 IP ADDRESS: Message not terminated by end with "." on a line by itself

DATA 명령어가 끝나기 전에 클라이언트가 닫혔기 때문에 해당 메일을 전달할수 없습니다.
SMTP 규약에 따라 “.” 명령어를 포함하여 다시 입력해 주시기 바랍니다.

언제 부터 였던가 생각해보니 아르바이트 겸 외부 컨설팅을 의뢰 받고 맥북 프로를 처음 써봤을 때 부터 였던 것 같다. 지금은 거의 대부분의 작업을 맥으로 작업을 하다 보니 윈도우에서만 실행되는 일부 프로그램들 때문과 회사 내부 ERP프로그램이 윈도우 ...