欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 昨天在FreeBSD下玩了nginx+php,今天到ubuntu下来玩玩了,首先要感谢“过够了”的文章以下是按他的文章修改而来。在ubuntu下搭建比freebsd下速度要快得多,因为在freebsd我是用ports方式安装,需要编
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
昨天在FreeBSD下玩了nginx+php,今天到ubuntu下来玩玩了,首先要感谢“过够了”的文章以下是按他的文章修改而来。在ubuntu下搭建比freebsd下速度要快得多,因为在freebsd我是用ports方式安装,需要编译,ubuntu下直接apt-get install 的方式安装,速度很快,下面就来开始安装吧!
1,安装nginx,执行以下命令,很快完成,不过目前apg-get方式安装默认是0.5.33的版本
sudo apt-get install nginx
配置文件默认安装位置:
conf: /etc/nginx/nginx.conf bin:/usr/sbin/nginx vhost: /etc/nginx/sites-enable/default cgi-params: /etc/nginx/fastcgi-params |
例:建一个虚拟Server
server { listen 80; server_name www.23day.com; access_log /var/log/nginx/home.ucenter.access.log; location / { root /var/www/23day.com; index index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/23day.com$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } |
2,安装php-cgi模块
执行sudo apt-get install php5-cgi
配置文件默认安装位置:
php-cgi: /usr/bin/php-cgi php5-cgi: /usr/bin/php5-cgi cgi config: /usr/bin/cgi/php.ini |
修改php.ini文件的cgi.fix_pathinfo数据为1,默认为0 cgi.fix_pathinfo=1; 这样php-cgi方能正常使用SCRIPT_FILENAME这个变量
[1] [2]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
