我曾尝试在Ubuntu机器上安装php5-fpm和Nginx,但是我遇到了问题。当我在unix端口上只有一个虚拟主机时,一切都很好但是当我尝试添加另一个虚拟主机时,Nginx会进入默认网页“欢迎来到Nginx!”但是当我在tcp端口示例端口9000上运行它时,它可以与多站点一起使用。它是安装了php5-fpm的ubuntu 11.10,Nginx 1.2.3的全新安装。它还有额外的php安装,如php-apc。我只能将链接提供给虚拟主机,因为我是通过手机进行的。以下是我正在使用的两个虚拟主机的链接:http://ic0nic.co.uk/ic0nic.txt,http://ic0nic.co.uk/sourproxy.txt我也想使用unix端口,因为我觉得它的速度要快得多。
编辑:这是nginx配置
server {
server_name ic0nic.co.uk www.ic0nic.co.uk;
root /var/www/ic0nic.co.uk;
listen 8080;
index index.html index.htm index.php;
include conf.d/drop;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_buffers 8 256k;
fastcgi_buffer_size 128k;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
root /var/www/ic0nic.co.uk;
}
}
server {
server_name sourproxy.co.uk www.sourproxy.co.uk;
root /var/www/sourproxy.co.uk/;
listen 8080;
index index.html index.htm index.php;
include conf.d/drop;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_buffers 8 256k;
fastcgi_buffer_size 128k;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/sourproxy.co.uk$fastcgi_script_name;
fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
}
}