- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我试图让 Nginx + PHP5-FPM + Drupal 7 正常工作,但是当我访问我的域时,我得到“404”未找到。
我的配置基于:- https://github.com/perusio/drupal-with-nginx- https://github.com/perusio/php-fpm-example-config
/etc/nginx/nginx.conf
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
## Accept as many connections as possible.
multi_accept on;
}
http {
## MIME types.
include /etc/nginx/mime.types;
default_type application/octet-stream;
## FastCGI.
include /etc/nginx/fastcgi.conf;
## Default log and error files.
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
## Use sendfile() syscall to speed up I/O operations and speed up
## static file serving.
sendfile on;
## Handling of IPs in proxied and load balancing situations.
set_real_ip_from 0.0.0.0/32; # all addresses get a real IP.
real_ip_header X-Forwarded-For; # the ip is forwarded from the load balancer/proxy
## Define a zone for limiting the number of simultaneous
## connections nginx accepts. 1m means 32000 simultaneous
## sessions. We need to define for each server the limit_conn
## value refering to this or other zones.
## ** This syntax requires nginx version >=
## ** 1.1.8. Cf. http://nginx.org/en/CHANGES. If using an older
## ** version then use the limit_zone directive below
## ** instead. Comment out this
## ** one if not using nginx version >= 1.1.8.
limit_conn_zone $binary_remote_addr zone=arbeit:10m;
## Define a zone for limiting the number of simultaneous
## connections nginx accepts. 1m means 32000 simultaneous
## sessions. We need to define for each server the limit_conn
## value refering to this or other zones.
## ** Use this directive for nginx versions below 1.1.8. Uncomment the line below.
#limit_zone arbeit $binary_remote_addr 10m;
## Timeouts.
client_body_timeout 60;
client_header_timeout 60;
keepalive_timeout 10 10;
send_timeout 60;
## Reset lingering timed out connections. Deflect DDoS.
reset_timedout_connection on;
## Body size.
client_max_body_size 10m;
## TCP options.
tcp_nodelay on;
## Optimization of socket handling when using sendfile.
tcp_nopush on;
## Compression.
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_min_length 10;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon application/vnd.ms-fontobject font/opentype application/x-font-ttf;
gzip_vary on;
gzip_proxied any; # Compression for all requests.
## No need for regexps. See
## http://wiki.nginx.org/NginxHttpGzipModule#gzip_disable
gzip_disable "msie6";
## Serve already compressed files directly, bypassing on-the-fly
## compression.
##
# Usually you don't make much use of this. It's better to just
# enable gzip_static on the locations you need it.
# gzip_static on;
## Hide the Nginx version number.
server_tokens off;
## Use a SSL/TLS cache for SSL session resume. This needs to be
## here (in this context, for session resumption to work. See this
## thread on the Nginx mailing list:
## http://nginx.org/pipermail/nginx/2010-November/023736.html.
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
## Uncomment to increase map_hash_bucket_size. If start getting
## [emerg]: could not build the map_hash, you should increase
## map_hash_bucket_size: 64 in your
## logs. Cf. http://wiki.nginx.org/NginxOptimizations.
#map_hash_bucket_size 192;
## For the filefield_nginx_progress module to work. From the
## README. Reserve 1MB under the name 'uploads' to track uploads.
#upload_progress uploads 1m;
## Enable clickjacking protection in modern browsers. Available in
## IE8 also. See
## https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
## This may conflicts with pseudo streaming (at least with Nginx version 1.0.12).
## Uncomment the line below if you're not using media streaming.
## For sites *using* frames uncomment the line below.
#add_header X-Frame-Options SAMEORIGIN;
## For sites *not* using frames uncomment the line below.
#add_header X-Frame-Options DENY;
## Block MIME type sniffing on IE.
add_header X-Content-Options nosniff;
## Include the upstream servers for PHP FastCGI handling config.
## This one uses the FCGI process listening on TCP sockets.
#include upstream_phpcgi_tcp.conf;
## Include the upstream servers for PHP FastCGI handling
## configuration. This setup uses UNIX sockets for talking with the
## upstream.
include upstream_phpcgi_unix.conf;
## Include the map to block HTTP methods.
include map_block_http_methods.conf;
## If using Nginx version >= 1.1.11 then there's a $https variable
## that has the value 'on' if the used scheme is https and '' if not.
## See: http://trac.nginx.org/nginx/changeset/4380/nginx
## http://trac.nginx.org/nginx/changeset/4333/nginx and
## http://trac.nginx.org/nginx/changeset/4334/nginx. If using a
## previous version then uncomment out the line below.
#include map_https_fcgi.conf;
## Include this line, if used in a loadbalanced environment
## and comment the line which includes map_https_fcgi.conf.
## If the loadbalancer always sends the request in http protocol,
## and adds the server variable $http_x_forwarded_proto
#include map_https_forwarded_proto.conf;
## Include the upstream servers for Apache handling the PHP
## processes. In this case Nginx functions as a reverse proxy.
#include reverse_proxy.conf;
#include upstream_phpapache.conf;
## Include the php-fpm status allowed hosts configuration block.
## Uncomment to enable if you're running php-fpm.
#include php_fpm_status_allowed_hosts.conf;
## Include the Nginx stub status allowed hosts configuration block.
include nginx_status_allowed_hosts.conf;
## If you want to run cron using Drupal cron.php. i.e., you're not
## using drush then uncomment the line below. Specify in
## cron_allowed_hosts.conf which hosts can invole cron.
# include apps/drupal/cron_allowed_hosts.conf;
## Include blacklist for bad bot and referer blocking.
include blacklist.conf;
## Include the caching setup. Needed for using Drupal with an external cache.
include map_cache.conf;
## Microcache zone definition for FastCGI.
include fastcgi_microcache_zone.conf;
## If you're using Apache for handling PHP then comment the line
## above and uncomment the line below.
#include proxy_microcache_zone.conf
#BM
types_hash_max_size 2048;
types_hash_bucket_size 32;
server_names_hash_bucket_size 64;
## Include all vhosts.
include /etc/nginx/sites-enabled/*;
}
netstat --unix -l
Proto RefCnt Flags Type State I-Node Pfad
unix 2 [ ACC ] STREAM HÖRT 6190 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM HÖRT 5833 @/com/ubuntu/upstart
unix 2 [ ACC ] STREAM HÖRT 7574 /var/run/acpid.socket
unix 2 [ ACC ] STREAM HÖRT 20672 /var/run/php5-fpm.sock
unix 2 [ ACC ] STREAM HÖRT 20675 /var/run/php-fpm-zwei.sock
unix 2 [ ACC ] STREAM HÖRT 20678 /var/run/php-fpm.sock
unix 2 [ ACC ] STREAM HÖRT 20681 /var/run/php-fpm-drei.sock
php -v
PHP 5.4.9-4ubuntu2.2 (cli) (built: Jul 15 2013 18:23:35)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
虚拟主机
## HTTP server.
server {
listen 80; # IPv4
server_name myserver.com;
limit_conn arbeit 32;
## Access and error logs.
access_log /var/log/nginx/myserver.com_access.log;
error_log /var/log/nginx/myserver.com_error.log;
## See the blacklist.conf file at the parent dir: /etc/nginx.
## Deny access based on the User-Agent header.
if ($bad_bot) {
return 444;
}
## Deny access based on the Referer header.
if ($bad_referer) {
return 444;
}
## Protection against illegal HTTP methods. Out of the box only HEAD,
## GET and POST are allowed.
if ($not_allowed_method) {
return 405;
}
## Filesystem root of the site and index.
root /var/www/myserver/htdocs;
index index.php;
## If you're using a Nginx version greater or equal to 1.1.4 then
## you can use keep alive connections to the upstream be it
## FastCGI or Apache. If that's not the case comment out the line below.
fastcgi_keep_conn on; # keep alive to the FCGI upstream
## Uncomment if you're proxying to Apache for handling PHP.
#proxy_http_version 1.1; # keep alive to the Apache upstream
################################################################
### Generic configuration: for most Drupal 7 sites.
################################################################
include apps/drupal/drupal.conf;
#################################################################
### Configuration for Drupal 7 sites that use boost.
#################################################################
#include apps/drupal/drupal_boost.conf;
#################################################################
### Configuration for updating the site via update.php and running
### cron externally. If you don't use drush for running cron use
### the configuration below.
#################################################################
#include apps/drupal/drupal_cron_update.conf;
################################################################
### Installation handling. This should be commented out after
### installation if on an already installed site there's no need
### to touch it. If on a yet to be installed site. Uncomment the
### line below and comment out after installation. Note that
### there's a basic auth in front as secondary ligne of defense.
################################################################
#include apps/drupal/drupal_install.conf;
#################################################################
### Support for upload progress bar. Configurations differ for
### Drupal 6 and Drupal 7.
#################################################################
include apps/drupal/drupal_upload_progress.conf;
## Including the php-fpm status and ping pages config.
## Uncomment to enable if you're running php-fpm.
#include php_fpm_status_vhost.conf;
## Including the Nginx stub status page for having stats about
## Nginx activity: http://wiki.nginx.org/HttpStubStatusModule.
include nginx_status_vhost.conf;
} # HTTP server
/var/www/myserver/htdocs
drwxr-xr-x 9 www-data www-data 4096 Aug 25 16:00 ./
drwxr-xr-x 3 www-data www-data 4096 Aug 25 11:29 ../
-rw-r--r-- 1 www-data www-data 0 Aug 25 13:40 apple-touch-icon.png
-rw-r--r-- 1 www-data www-data 0 Aug 25 13:41 apple-touch-icon_precomposed.png
-rw-r--r-- 1 www-data www-data 6604 Aug 8 04:04 authorize.php
-rw-r--r-- 1 www-data www-data 82086 Aug 8 04:04 CHANGELOG.txt
-rw-r--r-- 1 www-data www-data 1481 Aug 8 04:04 COPYRIGHT.txt
-rw-r--r-- 1 www-data www-data 720 Aug 8 04:04 cron.php
drwxr-xr-x 4 www-data www-data 4096 Aug 25 12:00 includes/
-rw-r--r-- 1 www-data www-data 529 Aug 8 04:04 index.php
-rw-r--r-- 1 www-data www-data 1451 Aug 8 04:04 INSTALL.mysql.txt
-rw-r--r-- 1 www-data www-data 1874 Aug 8 04:04 INSTALL.pgsql.txt
-rw-r--r-- 1 www-data www-data 703 Aug 8 04:04 install.php
-rw-r--r-- 1 www-data www-data 1298 Aug 8 04:04 INSTALL.sqlite.txt
-rw-r--r-- 1 www-data www-data 17861 Aug 8 04:04 INSTALL.txt
-rw-r--r-- 1 www-data www-data 18092 Sep 17 2011 LICENSE.txt
-rw-r--r-- 1 www-data www-data 8191 Aug 8 04:04 MAINTAINERS.txt
drwxr-xr-x 4 www-data www-data 4096 Aug 25 12:00 misc/
drwxr-xr-x 42 www-data www-data 4096 Aug 25 12:00 modules/
drwxr-xr-x 5 www-data www-data 4096 Aug 25 12:00 profiles/
-rw-r--r-- 1 www-data www-data 5376 Aug 8 04:04 README.txt
-rw-r--r-- 1 www-data www-data 1561 Aug 8 04:04 robots.txt
drwxr-xr-x 2 www-data www-data 4096 Aug 25 12:00 scripts/
drwxr-xr-x 4 www-data www-data 4096 Aug 25 12:00 sites/
drwxr-xr-x 7 www-data www-data 4096 Aug 25 12:00 themes/
-rw-r--r-- 1 www-data www-data 19941 Aug 8 04:04 update.php
-rw-r--r-- 1 www-data www-data 9642 Aug 8 04:04 UPGRADE.txt
-rw-r--r-- 1 www-data www-data 2178 Aug 8 04:04 web.config
-rw-r--r-- 1 www-data www-data 417 Aug 8 04:04 xmlrpc.php
/var/log/php5-fpm.log
[25-Aug-2013 18:25:52] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[25-Aug-2013 18:25:53] NOTICE: fpm is running, pid 4546
[25-Aug-2013 18:25:53] NOTICE: ready to handle connections
最佳答案
请检查你的虚拟主机文件的根路径和文件夹的文件权限
如果文件不存在或浏览器无法访问,通常会出现文件未找到错误。
关于drupal - Nginx + php5-fpm + Drupal : 404 "File not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18431300/
是否有一个 drupal 模块可以在 drupal 站点中启用实时聊天? 最佳答案 我推荐drupalchat ,它是维护最完善、最完整的版本。它使用 node.js作为服务器。它适用于 Drupal
在 Drupal 中,;$Id$ 是什么? ? 我知道我们在 .info 文件中使用它,它告诉 Drupal 我们的模块信息。 我的问题是为什么 ;$Id$必要的? 最佳答案 $Id$ 是并发版本系统
我有一个 Drupal 模块“示例”。我已将模块的管理和客户端功能拆分为两个包含文件 example.admin.inc 和 example.pages.inc。我在 example.module 文
我的网页中有几种表单,并且我希望能够向所有提交按钮添加一个类(现在我已经将表单提交作为标准)。而且,在某些表单中,我具有使用AHAH来显示内容的按钮,但我不希望这些按钮具有新类,仅希望那些在表单上进行
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
是否有用户可以喜欢或不喜欢的 Drupal 模块,并喜欢该节点?比如 stackoverflow 的按钮? tnx。 最佳答案 Vote Up/Down module很像 StackOverflow
我没有找到如何在管理模式下的 drupal 页面列表中添加元描述以提高我的 SEO SEO metadescription pages list drupal我能做什么? 最佳答案 使用元标记模块自动
我想学习如何在 drupal- 模块中创建模块,这些模块可以与用户、数据库、分配权限、 View 交互。 是否有任何好的视频教程或简单的示例模块可以涵盖这些内容? 谢谢。 最佳答案 我的建议是获取 P
我正在 Drupal 中创建信用卡表格。我需要一个日期选择字段,用户可以在其中选择他们的信用卡到期日期,该日期仅包含月份和年份 - 没有日期。 Drupal 表单 #type 'date' 产生一个日
如何覆盖drupal主页的node.tpl文件?我尝试了各种 node--front.tpl.php page--node--front.tpl.php page--front--n
这个问题不太可能帮助任何 future 的访客;它仅与一个小地理区域、一个特定时刻或一个非常狭窄的情况相关,而这些情况通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the
是否有按类别对内容进行分组的好方法。 我希望我可以有一个 CCK 类别字段。 最佳答案 使用分类法。它与 View 有很好的集成。我们用它在我们的投资组合上按分类词对投资组合项目进行分组。 http:
我有带 CCK 的 Drupal, 我有一个名为 Article 的内容类型。 本文有 5 个节点引用。 我正在使用 CCK 中的表字段,我正在尝试将其连接到 引用文献,所以每篇文章[包含一个表格字段
一个网站已经运行了一段时间。但是最近,当我上传图片时,它总是会引发这个错误: An unrecoverable error occurred. This form was missing from t
所以 Drupal 6 的一个麻烦是很难将更改从开发服务器转移到测试服务器或登台服务器到生产服务器。 这在 Drupal 7 中变得更容易了吗?模块开发人员现在应该遵循一些编码约定吗?所以开发人员可以
我正在为我的drupal 7网站编写一个包装器类,它使我可以连接到并查询我的phpbb数据库。 当连接到外部数据源时(根据drupal文档),您已经设置了事件数据库,运行查询,然后将事件数据库设置回默
如何在drupal菜单项中将页面参数之一设置为可选页面参数? 我有 $items['activities_list/%/%']=array( 'title callback' => 'activiti
我正在运营一个网站 xyz.org在 Drupal 中。 现在我想安装一些其他模块,例如 PHPBB 论坛和铜矿 画廊。当我安装这些并尝试访问链接 xyz.org/gallery 时,它给了我 dru
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我想获取一个字段的图像路径。我在节点中,我需要图像的Url才能将其作为背景图像放入内嵌CSS中。 我找不到解决方案。你能帮助我吗? 最佳答案 要从URI中获取图像的路径: file_create_ur
我是一名优秀的程序员,十分优秀!