配置nginx的:
vi /etc/nginx/nginx.conf 配置是很容易理解(你可以了解它在这里:http://wiki.codemongers.com/NginxFullExample:http://wiki.codemongers.com/NginxFullExample2) 改变一下内容: [...] worker_processes 5; [...] keepalive_timeout 2; [...]
虚拟主机配置。让我们如下修改默认的虚拟主机 : [...] server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/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 /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/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; } } [...]
现在保存文件,重新启动nginx的: /etc/init.d/nginx restart 创建一个探针文件:info.php,看看那些模块正常运行了
vi /usr/share/nginx/html/info.php 内容如下:
《?php phpinfo(); ?》
把双引号改为英文半角输入的单引号。 然后浏览器输入:http://192.168.0.100/info.php查看运行结果:
继续往下浏览,看看MYSQL运行情况:
相关软件连接: |