关于nginx+apache环境伪静态规则是否有效的测试方法
看到有几个同学在使用nginx+apache引擎的时候需要的伪静态无法使用的问题,请同学们按照如下方式进行测试,并把测试结果回复到本帖,以供我们为你诊断:1.登录wdcp控制面板新建一个测试站点;2.在测试站点根目录写入如下index.php测试代码页面:
<code>
<?php
header("Content-type: text/html; charset=utf-8");
echo 'action:'.$_GET['action'].'<br>id:'.$_GET['id'];
?>
</code>
3.在测试站点根目录写入如下.htacccess文件:
<code>
RewriteEngine on
RewriteRule ([a-zA-Z]{1,})-([0-9]{1,}).html$ index.php?action=$1&id=$2
</code>
4.访问如下url,查看页面输出结果:
test.example.com/test-2013.html
如果页面能够输出如:
[color=#000][font=Simsun]action:test[/font][/color]
[color=#000][font=Simsun]id:2013[/font][/color]
[font=Simsun][size=3][color=#000000]则说明环境支持伪静态。[/color][/size][/font] 这是我专门下载wdos 1.0 安装的虚拟机测试的。
如下:
[attach]4028[/attach]
[attach]4027[/attach]
[attach]4029[/attach]
[attach]4031[/attach]
[attach]4030[/attach]
[attach]4032[/attach] 从以上图片来看发现阿帕奇没有起作用。
下面的图片正面阿帕奇是运行的。
[attach]4033[/attach]
[attach]4034[/attach]
[attach]4035[/attach] [b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=31769&ptid=8048]3#[/url] [i]crll[/i] [/b]
这说明你的伪静态规则确实无效,请使用最新版本的lanmp一键安装包重新安装环境试试,[url=https://github.com/wdlinux/lanmp#%E4%BD%BF%E7%94%A8%E8%BF%99%E9%87%8Cgithub%E6%8F%90%E4%BE%9B%E7%9A%84%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC]https://github.com/wdlinux/lanmp#%E4%BD%BF%E7%94%A8%E8%BF%99%E9%87%8Cgithub%E6%8F%90%E4%BE%9B%E7%9A%84%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC[/url] [code][root@AY1312181404071177cdZ ~]# wget http://dl.wdlinux.cn:5180/lanmp_laster.tar.gz
--2013-12-26 09:14:33-- http://dl.wdlinux.cn:5180/lanmp_laster.tar.gz
Resolving dl.wdlinux.cn... 222.186.43.27
Connecting to dl.wdlinux.cn|222.186.43.27|:5180... connected.
HTTP request sent, awaiting response... 200 OK
Length: 81325773 (78M) [application/x-gzip]
Saving to: `lanmp_laster.tar.gz'
100%[======================================>] 81,325,773 1.66M/s in 49s
2013-12-26 09:15:23 (1.58 MB/s) - `lanmp_laster.tar.gz' saved [81325773/81325773]
[root@AY1312181404071177cdZ ~]# tar xf lanmp_laster.tar.gz
[root@AY1312181404071177cdZ ~]# ls lanmp
debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
eaccelerator-0.9.5.3.tar.bz2
httpd-2.0.64.tar.gz
httpd-2.2.24.tar.gz
libiconv-1.14.tar.gz
mod_rpaf-0.6.tar.gz
mysql-5.1.69.tar.gz
nginx-1.2.9.tar.gz
pcre-8.10.tar.gz
PDO_MYSQL-1.0.2.tgz
php-5.2.17-fpm-0.5.14.diff.gz
php-5.2.17.tar.gz
php-5.3.27.tar.gz
phpmyadmin.tar.gz
pure-ftpd-1.0.36.tar.gz
rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
RPM-GPG-KEY.dag.txt
wdcp_v2.5.tar.gz
zend_32.tar.gz
zend_64.tar.gz
[root@AY1312181404071177cdZ ~]# curl https://raw.github.com/wdlinux/lanmp/master/utils/bootstrap|sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 728 100 728 0 0 618 0 0:00:01 0:00:01 --:--:-- 710k
Loaded plugins: fastestmirror
Determining fastest mirrors
* addons: mirrors.163.com
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/primary | 995 kB 00:01
base 2789/2789
extras | 2.1 kB 00:00
extras/primary_db | 164 kB 00:00
updates | 1.9 kB 00:00
updates/primary_db | 184 kB 00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package git available.
Nothing to do
sh: line 22: git: command not found
/bin/cp: cannot stat `./*': No such file or directory
File `httpd-2.2.24.tar.gz' already there; not retrieving.
File `nginx-1.2.9.tar.gz' already there; not retrieving.
File `mysql-5.1.69.tar.gz' already there; not retrieving.
File `php-5.3.27.tar.gz' already there; not retrieving.
File `pure-ftpd-1.0.36.tar.gz' already there; not retrieving.
if all packages downloaded,you can begin install now:
type: ./install.sh to begin install.
[root@AY1312181404071177cdZ ~]#
[root@AY1312181404071177cdZ ~]#
[root@AY1312181404071177cdZ ~]# ./install.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.163.com
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package screen.i386 0:4.0.3-4.el5 set to be updated
--> Processing Dependency: libutempter.so.0 for package: screen
--> Running transaction check
---> Package libutempter.i386 0:1.1.4-4.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
screen i386 4.0.3-4.el5 base 559 k
Installing for dependencies:
libutempter i386 1.1.4-4.el5 base 22 k
Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 580 k
Downloading Packages:
(1/2): libutempter-1.1.4-4.el5.i386.rpm | 22 kB 00:00
(2/2): screen-4.0.3-4.el5.i386.rpm | 559 kB 00:01
--------------------------------------------------------------------------------
Total 259 kB/s | 580 kB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libutempter 1/2
Installing : screen 2/2
Installed:
screen.i386 0:4.0.3-4.el5
Dependency Installed:
libutempter.i386 0:1.1.4-4.el5
Complete!
[/code] [b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=31778&ptid=8048]5#[/url] [i]crll[/i] [/b]
你的yum仓库里没有git,看看yum仓库是不是有问题呢。 应该是".htaccess"!!!不是".htacccess"。。{:2_36:}因为这个折腾了半天都不行。。晕倒 [i=s] 本帖最后由 mjl840125 于 2014-3-15 18:03 编辑 [/i]
[attach]4298[/attach]
[attach]4299[/attach]
[attach]4300[/attach]
[attach]4301[/attach] 看不懂啊。你们都是大神 那样子啊,厉害 学习一下!! 支持的!WORDPRESS 直接就支持了。 我弄WP规则弄了好久才弄好 [img]http://www.hbike.cn/wp-content/uploads/2014/06/28.jpg[/img] 测试 盗链 http://www.hbike.cn 一会成功 一会不成功 相当的郁闷 呵呵呵!:lol WP规则弄了好久才弄好 [url]http://www.wdlinux.cn/bbs/viewthread.php?tid=37688&extra=[/url] wdcp重启nginx服务后,.htaccess立马失效
[url]http://www.wdlinux.cn/bbs/viewthread.php?tid=37688&extra=[/url] 用了2种模式,一定要用2种伪静态规则吗? WP规则弄了好久才弄好!~ [b]回复 [url=http://www.wdlinux.cn/bbs/redirect.php?goto=findpost&pid=32765&ptid=8048]7#[/url] [i]SaorUicnext[/i] [/b]
:handshake:handshake:handshake:handshake
顶上去,让更多的人看到 测试一下 测试一下 测试一下 测试一下
页:
[1]