그놈의 안드로이드

Tengin 2.2.3 본문

리눅스/웹 서버

Tengin 2.2.3

Sandai.Developer 2018. 12. 30. 23:00

$ apt-get install gcc libpcre3 libpcre3-dev zlib1g-dev

$ apt-get install libssl-dev

$ wget http://tengine.taobao.org/download/tengine-2.2.3.tar.gz

$ tar -zxvf tengine-2.2.3.tar.gz

$ cd tengine-2.2.3

./configure
--pid-path=/var/run/tengine.pid
--error-log-path=/var/log/nginx/error.log
--user=www-data
--group=www-data
--with-poll_module
--with-syslog
--with-http_stub_status_module
--with-http_ssl_module
--with-http_gzip_static_module
--with-http_stub_status_module
--with-http_sub_module
--with-http_concat_module
--with-http_realip_module
--with-http_sysguard_module

$ make

$ make install

$ /usr/local/nginx/sbin/nginx



//-----------------------------

$ apt install python-software-properties

$ add-apt-repository ppa:ondrej/php

$ apt update

$ apt install php7.2 php7.2-fpm


$ apt install vim

$ vim /etc/nginx/conf.d/default.conf
server {
    listen   80 default_server;
    server_name  localhost;
    root   /usr/share/nginx/html;
 
    location / {
        index  index.php index.html;
    }
 
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }
 
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

$ sudo nano /etc/nginx/fastcgi_params

fastcgi_param   QUERY_STRING            $query_string;
fastcgi_param   REQUEST_METHOD          $request_method;
fastcgi_param   CONTENT_TYPE            $content_type;
fastcgi_param   CONTENT_LENGTH          $content_length;
 
fastcgi_param   SCRIPT_FILENAME         $document_root$fastcgi_script_name;
fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
fastcgi_param   PATH_INFO               $fastcgi_path_info;
fastcgi_param   PATH_TRANSLATED         $document_root$fastcgi_path_info;
fastcgi_param   REQUEST_URI             $request_uri;
fastcgi_param   DOCUMENT_URI            $document_uri;
fastcgi_param   DOCUMENT_ROOT           $document_root;
fastcgi_param   SERVER_PROTOCOL         $server_protocol;
 
fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;
 
fastcgi_param   REMOTE_ADDR             $remote_addr;
fastcgi_param   REMOTE_PORT             $remote_port;
fastcgi_param   SERVER_ADDR             $server_addr;
fastcgi_param   SERVER_PORT             $server_port;
fastcgi_param   SERVER_NAME             $server_name;
 
fastcgi_param   HTTPS                   $https;
 
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param   REDIRECT_STATUS         200;


Conf/nginx.conf

user www-data;
worker_processes auto;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log "pipe:rollback logs/error_log interval=1d baknum=7 maxsize=2G";

#pid logs/nginx.pid;


events {
worker_connections 1024;
}

# load modules compiled as Dynamic Shared Object (DSO)
#
#dso {
# load ngx_http_fastcgi_module.so;
# load ngx_http_rewrite_module.so;
#}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;
#access_log "pipe:rollback logs/access_log interval=1d baknum=7 maxsize=2G" main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;
#access_log "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G" main;

location / {
root html;
index index.html index.htm info.php;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index info.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}


# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}


'리눅스 > 웹 서버' 카테고리의 다른 글

H2o 설치  (0) 2018.12.30
Lighttpd  (0) 2018.12.30
OpenLiteSpeed  (0) 2018.12.30
Nginx 1.10.3  (0) 2018.12.30
Apache 2.4.18 + PHP-FPM 7.2 + MySQL 5.7(APM)  (0) 2018.12.30
Comments