我基本上是试图实现Apache MultiViews行为,以便我的URL不需要.php扩展名。 就我从其他问题上看到的服务器故障回答,我应该有这个问题sorting,但是在我的nginxconfiguration中显然是错误的。 行为几乎是正确的; 我可以浏览到/path/to/app/和index.php文件被正确parsing 我可以浏览到/path/to/app/function.php文件被正确parsing 我可以浏览到/path/to/app/media/some.jpg并将其作为静态内容提供 如果我浏览到/path/that/doesnt/exist我得到一个404预期 但是,如果我浏览到/path/to/function try_files指令正确地匹配它到function.php但下载它作为一个静态文件。 这里是configuration文件: server { listen 80; server_name app; root /path/to/app; index index.php index.html index.htm; access_log /var/log/nginx/access.log; location / { allow all; try_files $uri $uri/ $uri.php =404; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; } location ~ /\.ht { deny all; } }
我们有一个子网站domain.com/path/ad,我想直接将所有的stream量直接传递给框架处理程序。 domain.com/path/index.cfm 到目前为止,我有 RewriteRule ^$ index.cfm [QSA,NS] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.cfm [R=permanent,L] 如果文件夹存在,它会正确地将/ path / ad / otherredirect到/path/ad/index.cfm。 我需要什么使它适用于不存在的文件夹? 我还需要跟踪请求的原始文件/path。 /path/ad/example1 => /path/ad/index.cfm?ad=example1
我面临一个问题,我有一个没有域名的静态IP。 我有两台服务器运行本地IP为192.168.1.101,192.168.1.102。 在第一台服务器的索引页上有一个链接,该链接redirect到第二台服务器。 当我打到当地工作正常。 但是当我尝试从外部即通过互联网打击它降落在第一台服务器,然后将主静态IP转换为192.168.1.102在浏览器中,我不想使用另一个端口,也不想使用任何域名现在…请帮助我…
我正在试验Apache和Option Indexes。 我mv index.html到no_filename。 当我去www.dunno.com时,我得到了一个被禁止的网页,而不是我期待的目录列表。 为什么是这样? 我在httpd.conf中安装并启用了mod_autoindex: <VirtualHost *:80> Servername www.dunno.com DocumentRoot /var/www/web1 <Directory "/var/www/web1"> Options Indexes Order allow,deny Allow from all </Directory> </VirtualHost>
尝试将configuration从Linux迁移到Windows Apache 2.2(通过WAMP) 我们试图设置ENV Apachevariables作为DocumentRoot和其余的指令,因此我们可以在服务器和本地工作副本上使用同一组conf。 在Debian Linux Apache中,我们有一个加载了“EXPORT”指令的envvars文件。 这不适用于Windows,但是 Setenv ROOT_TO_FILES "C:/wamp/www/test" 似乎像phpinfo()所显示的那样工作 但是当我们在一个虚拟主机的DocumentRoot指令中使用它时: DocumentRoot ${ROOT_TO_FILES} Apache在它自己的根目录下查找文本文本。 这是我们在Linux中使用它的方式,但我们也尝试了env = ROOT_TO_FILES的语法 Apache的文档似乎很清楚如何“定义”,但不是如何使用。 另外我看到Apache 2.4包含了一个新的“Define”指令,这个指令似乎正是这样做的,这使得我认为它在以前的版本中可能是不可能的。 任何在Windows下使用Apache样本将不胜感激。
我在Windows 2008 R2 x64下运行VPS服务器作为Web服务器。 我正在使用标准的php5_module运行Apache 2.2 x86 / Php 5.3.1句柄我使用FastCgGI x64作为处理程序,昨天晚上升级到Apache 2.4.4 x64 / Php 5.3.24。 一切都很好,今天上午,当我(或其他用户)尝试访问我托pipe的某个网站时,我经历了相当长的延迟。 当我能够访问其中的一个时,我点击每个菜单,有时这个页面很快,有时又很慢。 目前,我做了一个回滚Apache的win32。 在发布之前我做了同样的研究,但到目前为止还没有太多的线索。 它看起来喜欢没有足够的过程来同时接受每个人,因为今天早上有更多的用户连接到我的服务器,而不是晚上。 任何人都有线索来指导我? 谢谢
我在同一台机器上安装了Ubuntu 12.04和Windows 7。 <VirtualHost *:80> ServerAdmin [email protected] #ServerName example.org #ServerAlias www.example.org DocumentRoot /var/www/ ErrorLog /var/www/logs/error.log CustomLog /var/www/logs/access.log combined </VirtualHost> 这是我的/ var / www wenbert@wenbert-ubuntu:/var/www$ cd /var/www/ wenbert@wenbert-ubuntu:/var/www$ ls -la total 28 drwxr-xr-x 5 root root 4096 May 5 14:51 . drwxr-xr-x 14 root root 4096 May 5 12:05 .. drwxr-xr-x 2 root root 4096 May […]
在一个有多个网站的CentOS服务器上,一个特定的站点需要很长时间才能响应来自某些地理区域的请求,而不是来自其他地理区域。 同一台服务器上的其他站点不受影响。 例如,如果我尝试在没有代理的情况下访问网站,则该网站需要很长时间才能连接10秒以上(通过wget -p确认)。 一旦build立连接,页面和图像下载得非常快。 如果我将浏览器configuration为通过Amazon使用代理,则网站加载非常快(无连接延迟)。 我在错误日志中没有看到任何可能提供的线索。 请注意,此服务器上的每个站点都有不同的IP地址。 但是,我没有看到这个网站的IP地址,启用网站的文件的configuration,或其他任何可能提供问题根源的线索。
我试图build立一个mod_rewrite规则,以便当网页www.mysite.com/blog被请求从博客服务Tumblr的页面被加载。 我已经build立了我的Tumblr网站,以便blog.mysite.com返回域名。 目前, www.mysite.com/blog blog.mysite.comredirect到blog.mysite.com 。 我想要的是www.mysite.com/blog显示blog.mysite.com和用户不知道blog.mysite.com 。 我尝试了几种不同的方法来实现这一点。 首先,我尝试使用重写规则: RewriteEngine On # Turn on the rewriting engine RewriteRule /blog/ http://blog.mysite.com/ [NC,P,L] 然后一个“ProxyPass”(尝试1) ProxyPass /blog/ http://blog.mysite.com/ 并尝试2: <Location /blog/> ProxyPass http://blog.mysite.com/ </Location> 然后,我看到另一个更复杂的mod_rewrite规则,我也试过: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^mysite.com/blog$ RewriteCond %{REQUEST_URI} !/standard RewriteRule ^(.*)$ http://blog.mysite.com$1 [R] </IfModule> 我将不胜感激任何build议如何最好地做到这一点。
突然之间,我的一个RHEL 6服务器[VM] (服务Apache的服务器也closures了),当我重新启动它时,在下降之前,我看到了几个最新的/var/log/messages : May 4 08:16:37 localhost xinetd[1928]: START: nrpe pid=19307 from=10.xx.xx.xx May 4 08:16:37 localhost xinetd[1928]: EXIT: nrpe status=0 pid=19307 duration=0(sec) May 4 08:17:08 localhost xinetd[1928]: START: nrpe pid=19363 from=10.xx.xx.xx May 4 08:17:08 localhost xinetd[1928]: EXIT: nrpe status=0 pid=19363 duration=0(sec) May 4 08:18:38 localhost xinetd[1928]: START: nrpe pid=19417 from=10.xx.xx.xx May 4 08:18:38 localhost […]