Search Results

'apache'에 해당하는 글들

  1. 2017.12.08  CentOS 6.x 에서 LEMP 설치 1
  2. 2009.07.31  Linux Web Server(apache 1.3)

CentOS 6.x 에서 LEMP 설치

반응형

웹서버 Apache의 개선판이라고 할 수 있는 NGINX 설치 과정을 정리해봅니다.


(꼭 지*켓 같다...;;)



*설치환경 : VirtualBox 구성, minimal 설치


네트워크는 eth0은 NAT, eth1은 내부 네트워크(192.168.x.1)로 잡아주고 

동일 네트워크에 동작 확인을 위한 Windows 호스트(192.168.x.2)로 설치



1. 패키지 설치


# yum install epel-release


# yum update






2. nginx 설치 & 실행

# yum install nginx


# /etc/init.d/nginx start






3. IE 등 웹브라우저에서 확인

http://server_domain_or_ip_address   // 접속이 안되는 경우 iptables, 기타 F/W 확인







4. 마리아DB 설치 외

# vi /etc/repos.d/MariaDB       // yum으로 설치하기 위한 repos.d 파일을 생성

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/5.5/centos6-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1



# yum install MariaDB-server MariaDB-client



# /etc/init.d/mysql start       // mysql 서비스 시작


# mysqladmin -u root password 'P@ssw0rd'    // root 패스워드 지정

  또는 mysql_secure_installation




5. PHP 설치 및 설정

# yum install php php-mysql php-fpm


# vi /etc/php.ini

cgi.fix_pathinfo=0     //  1을 0으로 수정


# cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.origin

# vi /etc/php-fpm.d/www.conf

listen= /var/run/php-fpm/php-fpm.sock


listen.owner = nobody   // 주석제거

listen.group = nobody


user = nginx        // apache를 nginx로 수정

group = nginx



# /etc/init.d/php-fpm restart





6. PHP 연동 설정

# cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.origin

# vi /etc/nginx/conf.d/default.conf   //   수정 필요





server {

    listen       80;

    server_name  server_domain_name_or_IP;


    root   /usr/share/nginx/html;

    index index.php index.html index.htm;


    location / {

        try_files $uri $uri/ =404;

    }


    error_page 404 /404.html;

    location = /40x.html {

}


    error_page 500 502 503 504 /50x.html;

    location = /50x.html {

    }


    location ~ \.php$ {

        try_files $uri =404;

        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        include fastcgi_params;

    }

}





7. info.php 생성 및 확인

# vi /usr/share/nginx/html/info.php

<?php phpinfo(); ?>


# /etc/init.d/nginx restart



>> IE에서 확인  - http://192.168.30.1/info.php




반응형

'로그 저장소 :) > 리눅스.Linux' 카테고리의 다른 글

php.ini 설명  (1) 2017.12.11
톰캣(tomcat) 설치  (1) 2017.12.11
vpn 설치  (0) 2012.05.31
CentOS에서 APM 및 제로보드(zbxe) 설치  (0) 2010.11.01
KVM 스크린샷  (0) 2010.10.11

Linux Web Server(apache 1.3)

반응형



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

#ServerName  ->  주석풀고 주소

DocumentRoot "/var/www/html"  ->  경로확인

DirectoryIndex  ->  우선순위 html > htm > php순

#cd /var/www/html
#vi index.html 생성
#service httpd start


- Apache ver1.3 : 정적, 동적모듈 사용
- Apache ver2.0 & 2.2 : 동적모듈 사용

정적모듈 : 속도 빠르지만 프로세스 크기가 크다(RAM 많이 차지)
동적모듈 : 속도는 조금 느리지만 RAM효율적으로 사용(쓰레드기법 사용)


※Apache 1.3, PHP(정적), MySQL 연동설치
★MySQL -> PHP -> Apache1.3 순으로 설치

㈎다운로드(/usr/local/src)
   mysql-5.1.36.tar.gz
   php-5.3.0.tar.bz2
   apache_1.3.41.tar.gz

㈏기존 버전 제거
   #rpm -e httpd --nodeps
   #rpm -e php --nodeps


㈐MySQL 설치 - 이미 했으므로 패스;

㈑PHP설치
①압축풀기
  #tar zxvf apache1.3.41.tar.gz
  #tar jxvf php-5.3.0.tar.bz2

②아파치 환경설정
  #cd apache1.3.41
  #./configure --prefix=/usr/local/apache

 ③php 환경설정
  #cd /usr/local/src/php-5.3.0
  #./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.41

 ④컴파일
  #make

 ⑤설치
  #make install

 ⑥환경설정 파일 복사
  #cp php.ini-production /usr/local/lib/php.ini

 ⑦설치확인
  #ls /usr/local/src/apache_1.3.41/src/modules
   -php5 디렉토리 존재해야 함


㈒아파치 설치
 ①디렉토리 이동
  #cd /usr/local/src/apache_1.3.41

 ②환경설정
  #./configure --prefix=/usr/local/apache --activate-module=src/modules \
  /php5/libphp5.a

 ③컴파일
  #make

 ④설치
  #make install

 ⑤환경설정 파일 수정
  #vi /usr/local/apache/conf/httpd.conf
    -Line276 SeverName 203.247.50.171
    -Line283 DocumentRoot "/usr/local/apache/htdocs"
    -Line363 DirectoryIndex index.html index.htm index.php


 ⑥서비스시작
  #/usr/local/apache/bin/apachectl start


 ㈓환경설정(httpd.conf 2줄 추가)
  AddType application/x-httpd-php .php .html .htm .inc .php5
  AddType application/x-httpd-php-source .phps

*추가 : php.ini에서 short_open_tag=On으로 변경해줄 것





반응형

'로그 저장소 :) > 리눅스.Linux' 카테고리의 다른 글

Linux Web Server(apache 2.0)  (0) 2009.08.05
Apache 1.3에서 새로운 Port 사용하기  (0) 2009.08.04
Linux Backup  (0) 2009.07.30
Linux 도움말  (0) 2009.07.30
가상메모리(Swap)  (0) 2009.07.28