[root@bogon nginx-1.4.7]# ./configure --prefix=/usr\ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf\ --error-log-path=/var/log/nginx/error.log\ --http-log-path=/var/log/nginx/access.log\ --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock\ --user=nginx --group=nginx --with-http_flv_module\ --with-http_stub_status_module --with-http_gzip_static_module\ --http-client-body-temp-path=/var/tmp/nginx/client\ --http-proxy-temp-path=/var/tmp/nginx/proxy\ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/\ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi\ --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre\ --with-http_ssl_module\
.....
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... found
checking for PCRE JIT support ... not found
checking for OpenSSL library ... found
checking for zlib library ... found
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx path prefix: "/usr"
nginx binary file: "/usr/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/tmp/nginx/client"
nginx http proxy temporary files: "/var/tmp/nginx/proxy"
nginx http fastcgi temporary files: "/var/tmp/nginx/fcgi/"
nginx http uwsgi temporary files: "/var/tmp/nginx/uwsgi"
nginx http scgi temporary files: "/var/tmp/nginx/scgi"
#檢視nginx的幫助
[root@bogon nginx-1.4.7]# /usr/sbin/nginx -h
nginx version: nginx/1.4.7
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/)
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
-g directives : set global directives out of configuration file
#測試配置檔案的文法
[root@bogon nginx-1.4.7]# /usr/sbin/nginx -t
#顯示文法正确
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
#顯示系統上沒有nginx這個使用者
nginx: [emerg] getpwnam("nginx") failed
#配置檔案測試失敗
nginx: configuration file /etc/nginx/nginx.conf test failed
8.添加nginx這個系統使用者,然後測試配置檔案文法
#添加nginx這個系統使用者
[root@bogon nginx-1.4.7]# useradd -r nginx
#測試配置檔案文法
[root@bogon nginx-1.4.7]# /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
#顯示/var/tmp/nginx這個臨時目錄不存在
nginx: [emerg] mkdir() "/var/tmp/nginx/client" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
9.建立nginx的臨時目錄,然後測試配置檔案的文法
#建立nginx臨時目錄
[root@bogon nginx-1.4.7]# mkdir /var/tmp/nginx
[root@bogon nginx-1.4.7]# /usr/sbin/nginx -t
#顯示nginx配置檔案文法正确
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
#測試nginx配置檔案成功
nginx: configuration file /etc/nginx/nginx.conf test is successful