[CentOS] Web

2014. 9. 5. 10:46OS/CentOS

#-- 시간동기화

# yum -y install ntp

# vi /etc/ntp.conf

>----------------------------<

server 3.kr.pool.ntp.org

>----------------------------<

# ntpdate 3.kr.pool.ntp.org

# chkconfig ntpd on



# yum -y install epel-release


# yum -y install cronolog

# yum -y install httpd

# chkconfig httpd on

# vi /etc/httpd/conf/httpd.conf

>---------------------------------------<

#-- 외부에서 apache 버전을 숨김

  1. Prod : 웹서버의 이름만을 알려준다.
  2. Major : 웹서버의 이름과 Major 버전번호만 알려준다.
  3. Minor : 웹서버의 이름과 Minor 버전까지 알려준다.
  4. Min : 웹서버의 이름과 Minimum 버전까지 알려준다.
  5. OS : 웹서버의 이름과 버전, 운영체제까지 알려준다. (기본 값)
  6. Full : 최대한의 정보를 모두 알려준다.(웹서버, 운영체제, 등)

ServerTokens Prod

#-- 서버 이름을 사용할지 클라이언트 요청 이름을 사용할지

UseCanonicalName Off

#-- 클라이언트 로그를 IP 로 남길지 도메인으로 남길지

HostnameLookups Off

#-- 서버정보표출

ServerSignature Off


# !파일수정

sed -i "s/ServerTokens OS/ServerTokens Prod/g" /etc/httpd/conf/httpd.conf


ServerAdmin server@localhost

#-- apache 시작시 경고 문구가 나오지 않도록

ServerName localhost:80

AllowOverride None => All

DirectoryIndex index.html index.htm index.php

KeepAlive Off

MaxKeepAliveRequests 1024

KeepAliveTimeout 10


<IfModule worker.c>

StartServers           4

MaxClients           512

MinSpareThreads       32

MaxSpareThreads       64

ThreadsPerChild       32

MaxRequestsPerChild    0

</IfModule>


SetEnvIfNoCase Request_URI "\.(jpe?g|gif|bmp|png|ico|css|js|swf)$" exceptlist

SetEnvIfNoCase Request_URI "^/(cacti|phpmyadmin)" exceptlist

CustomLog "|/usr/sbin/cronolog /var/log/httpd/access_log.%Y-%m-%d" combined env=!exceptlist

>---------------------------------------<


# service httpd graceful

# vi /etc/sysconfig/httpd

>---------------------------------------<

HTTPD=/usr/sbin/httpd.worker

>---------------------------------------<


# yum -y install php php-mysql php-gd php-mbstring php-xml php-mcrypt

# vi /etc/php.ini

>---------------------------------------<

short_open_tag = Off => On

expose_php = On => Off

post_max_size = 8M => 64M

upload_max_filesize = 2M => 64M

allow_url_fopen = On => Off

date.timezone = Asia/Seoul

>---------------------------------------<


vi /etc/fstab

>---------------------------------------<

192.168.0.31:/home/www  /usr/share/nginx/html   nfs     rw,sync,soft,intr     0 0

>---------------------------------------<


# mount -a

# setsebool -P httpd_use_nfs on

# setsebool -P httpd_can_network_connect_db on

# service httpd start


# vi /etc/sysconfig/iptables

>---------------------------------------<

tcp 80

tcp 443

>---------------------------------------<


# service iptables restart


# yum install -y cacti

# mysql -h 192.168.0.21 -u root -p

> create database cacti;

# mysql -h 192.168.0.21 -u root -p cacti < /var/www/cacti/cacti.sql

# vi /var/www/cacti/include/config.php

$database_default = "cacti";

$database_hostname = "192.168.0.21";

$database_username = "root";

$database_password = "[password...]";

# vi /etc/httpd/conf.d/cacti.conf

allow from 192.168.0.0/24

# chmod -R 0777 rra log cache

# vi /etc/cron.d/cacti

*/1 * * * *     cacti   php /var/www/cacti/poller.php &>/dev/null

# service snmpd start

web

admin/admin

Console/Configuration/Settings[Paths-RRDTool Default Font] = /usr/share/fonts/NanumGothic.ttf

Console/Configuration/Settings[Misc-Cache Directory] = /var/www/cacti/cache

# chmod 0644 Nanum*

# chcon -u system_u -t fonts_t Nanum*


# wget http://docs.cacti.net/plugins

# chmod -R -777 /var/www/cacti/plugins/realtime

# chown -R cacti:cacti /var/www/cacti/plugins/realtime

# chcon -u system_u -t httpd_sys_content_t -R /var/www/cacti/plugins/realtime

Console/Configuration/Plugin Management[Install, Enable plugin]







/usr/share/nginx/html

/var/www/html


# mount -t nfs 192.168.0.31:/home/www /var/www/html


# yum groupinstall "Development Tools"

# yum install -y ImageMagick-devel php-pear php-devel

# pecl install imagick

# vi /etc/php.d/imagick.ini

extension=imagick.so


# yum -y install epel-release

# rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm


# yum -y install httpd

# yum -y install php php-mbstring php-mysql php-gd php-xml php-pear php-devel php-mcrypt

# yum -y install mod_fastcgi php-fpm



# vi /etc/httpd/conf.d/fastcgi.conf

>---<

#FastCgiWrapper On

AddHandler php-fastcgi .php

Action php-fastcgi /cgi-bin/php-fpm

ScriptAlias /php5-fcgi/ /var/www/cgi-bin/

FastCGIExternalServer /var/www/cgi-bin/php-fpm -host 127.0.0.1:9000

>---<


# mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.bak

# yum -y install php-pecl-apc

# vi /etc/php.d/apc.ini

>---<

apc.shm_size=128M

>---<


# vi /usr/share/php-pecl-apc/apc.php

>---<

user

pass

>---<

a

# yum -y install gcc ImageMagick-devel

# pecl install imagick

# vi /etc/php.d/imagick.ini

>---<

extension=imagick.so

>---<


yum install php-bcmath

yum install -y gd gd-devel php-gd

yum install -y libjpeg libpng libtiff libexif

yum install -y libjpeg-devel libpng-devel libtiff-devel libexif-devel

yum install -y ImageMagick ImageMagick-devel

yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make


yum --enablerepo=epel install php-mcrypt

 

http://symplog.tistory.com/125
http://blog.naver.com/PostView.nhn?blogId=mirnae&logNo=100026750368

http://imdsoho.tistory.com/entry/mysql-%EC%82%AC%EC%9A%A9%EC%9E%90-%EC%B6%94%EA%B0%80-%EB%B0%8F-error-1130-%EC%B2%98%EB%A6%AC

 


-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

'OS > CentOS' 카테고리의 다른 글

[CentOS] MySQL  (0) 2014.09.30
[CentOS] vsftpd  (0) 2014.09.24
[CentOS] Samba  (0) 2014.09.03
[CentOS] NFS  (0) 2014.09.03
[CentOS] RAID  (0) 2014.08.25