linux 에서 nginx + java + php 환경 설정
1. lnmp 를 통 해 기초 환경의 설 치 를 완성 합 니 다.
lnmp 를 통 해 설치 한 후 관련 소프트웨어 의 위 치 는 공식 설명 을 참고 하 시기 바 랍 니 다.설치 후 나 는 단독으로 가스 공식 설명 을 통 해 nginx 버 전 을 업그레이드 했다.
2. nginx 를 설정 하여 phop + 자바 환경 이 한 기계 에서 의 재 활용 을 만족 시 킬 수 있 도록 합 니 다.
2. 관련 설치 설명
1. tomcat 를 / usr / local / tomcat 6 2 에 설치 하고 nginx 를 / usr / local / nginx 3 에 설치 하 며 자바 프로젝트 를 tomcat 6 / webapps 에 설치 합 니 다.
4. phop 관련 항목 을 / usr / local / 아래 에 직접 설치 합 니 다.
3. 관련 설정 설명
주로 몇 개의 메 인 프로필 의 상황 을 설명 합 니 다.
1、nginx.conf
user www www;
worker_processes 1;
error_log /home/wwwlogs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
#fastcgi 。
http
{
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 256k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 512k;
fastcgi_temp_file_write_size 512k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zone crawler $binary_remote_addr 10m;
#log format
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
# , nginx/conf/vhost
include vhost/*.conf;
}
2. vhost (nginx. conf 에서 도 메 인 이름 에 대응 하 는 프로필 위 치 를 가리 키 고 있 습 니 다)
(1), php 프로젝트 설정: 파일 이름 shequ. imudges. com. conf
도 메 인 이름 에 대한 설정 을 보 여 드 리 겠 습 니 다: join. imudges. com
server
{
listen 80;
server_name join.imudges.com;
index index.html index.htm index.php;
root /usr/local/discuzx/upload;
location ~ .*\.(php|php5)?$
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/access.log access;
}
(2) 자바 프로젝트 설정: 파일 이름 www. imudges. com. conf
여기 자바 프로젝트 설정 을 지정 하 였 습 니 다. www.imudges.com
server {
listen 80;
server_name www.imudges.com;
#charset koi8-r;
access_log logs/dev/null;
root /usr/local/tomcat6/webapps/quickbook/;
# tomcat
location / {
index index.jsp index.html index.htm ;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_buffers 32 4k;
proxy_connect_timeout 3;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_pass http://127.0.0.1:8080;
}
}
소스 네트워크
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.