Install Nginx From Source -------------------------------------------------------------------------------------------------------------...
Install Nginx From Source
---------------------------------------------------------------------------------------------------------------------------------
1'st Download package
--------------------------------------------------------------------------------------------------------------------------------
2'nd install package
--------------------------------------------------------------------------------------------------------------------------------
3'rd Configure nginx for php-fpm
---------------------------------------------------------------------------------------------------------------------------------
4'rd Configure nginx for download media
---------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------
1'st Download package
--------------------------------------------------------------------------------------------------------------------------------
# wget -c http://nginx.org/download/nginx-1.4.0.tar.gz---------------------------------------------------------------------------------------------------------------------------------
2'nd install package
--------------------------------------------------------------------------------------------------------------------------------
# ./configure --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --without-http_rewrite_module---------------------------------------------------------------------------------------------------------------------------------
# make && make install
3'rd Configure nginx for php-fpm
---------------------------------------------------------------------------------------------------------------------------------
location ~ \.php$ {---------------------------------------------------------------------------------------------------------------------------------
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
4'rd Configure nginx for download media
---------------------------------------------------------------------------------------------------------------------------------
location /vid/ {
if ($request_filename ~* ^.*?/([^/]*?)$)
{
set $filename $1;
add_header Content-Disposition "attachment; filename=$filename";
}
alias /media/storage/data/result/;
autoindex on;
}
COMMENTS