nginx 설치 시작

3029 단어 nginx
[root@localhost ~]# wget http://nginx.org/download/nginx-0.7.67.tar.gz          
--2010-09-24 14:48:12--  http://nginx.org/download/nginx-0.7.67.tar.gz          
Resolving nginx.org... 81.19.68.137                                             
Connecting to nginx.org|81.19.68.137|:80... connected.                          
HTTP request sent, awaiting response... 200 OK                                  
Length: 608462 (594K) [application/octet-stream]                                
Saving to: `nginx-0.7.67.tar.gz'                                                
100%[<========================================>] 608,462     44.5K/s   in 18s     
2010-09-24 14:48:32 (32.8 KB/s) - `nginx-0.7.67.tar.gz' saved [608462/608462]   
                                                                                
[root@localhost ~]# tar -zxvf nginx-0.7.67.tar.gz    /                    
[root@localhost ~]# cd nginx-0.7.67                  /                  
[root@localhost nginx-0.7.67]# ./configure –prefix=/usr/local/nginx      /     /usr/local/nginx   ,  ./configure –help                 
[root@localhost nginx-0.7.67]#make                  /make                       
[root@localhost nginx-0.7.67]#make install          /                         
[root@localhost nginx-0.7.67]# ll /usr/local/nginx/      /              
drwxr-xr-x 2 root root 4096 Sep 24 15:12 conf                                   
drwxr-xr-x 2 root root 4096 Sep 24 15:12 html                                   
drwxr-xr-x 2 root root 4096 Sep 24 15:12 logs                                   
drwxr-xr-x 2 root root 4096 Sep 24 15:12 sbin                                   
[root@localhost nginx-0.7.67]#/usr/local/nginx/sbin/nginx –t     /  Nginx                                                                          
[root@localhost nginx-0.7.67]#/usr/local/nginx/sbin/nginx         /  Nginx   

다음 과 같은 상황 이 발생 했 을 때:
[root@web2 nginx-0.7.67]# /usr/local/nginx_test/sbin/nginx
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

nginx 의 포트 를 수정 하거나 80 포트 를 차지 하 는 응용 프로그램 을 꺼 야 합 니 다.
포트 수정 방법:
  Linux             /usr/local/nginx/conf/nginx.conf

server {
	listen       80;
	server_name  localhost;
	
	……
}

다음으로 변경:
server {
	listen       81;
	server_name  localhost;
	
	location / {
		root   html;
		index  index.html index.htm;
	}
	……
}

좋은 웹페이지 즐겨찾기