Tag Archives: apache

apt-get卸载Apache MySQL PHP

1、卸载Apache2都几个命令 sudo apt-get –purge remove apache2 sudo apt-get –purge remove apache2.2-common 其中remove –purge is equivalent to the purge command. (见man apt-get) 或直接使用一条命令 sudo apt-get autoremove apache2 2、卸载Mysql sudo apt-get purge mysql-server mysql-server-5.0 3、卸载Php5 sudo apt-get autoremove php5 4、批量删除组件及相关 sudo apt-get … Continue reading

Tagged , , , | Leave a comment

.htaccess设置: 禁止列出目录内文件名

Options -Indexes 以上代码直接写进 .htaccess 文件里面。 当你网站上的某个目录没有index索引时,此代码可以禁止列出目录内文件名。提高网站 安全性.

Tagged | Leave a comment

AllowOverride造成mod_rewrite无法启动的问题

项目需要使用到自定义url,所以需要启动apache的mod_rewrite模块,打开httpd.conf,将 LoadModule rewrite_module modules/mod_rewrite.so 前面的#去掉,重启动apache,但是发现自己建立的虚拟主机程序根目录下面.htaccess定义的重写规则并没有生效。 网上找了半天是AllowOverride指令设置为None造成的。 通常利用Apache的rewrite模块对 URL 进行重写的时候, rewrite规则会写在 .htaccess 文件里。但要使 apache 能够正常的读取.htaccess 文件的内容,就必须对.htaccess 所在目录进行配置。从安全性考虑,根目录的AllowOverride属性一般都配置成不允许任何Override ,即 < Directory /> AllowOverride None < /Directory> 在 AllowOverride 设置为 None 时, .htaccess 文件将被完全忽略。当此指令设置为 All 时,所有具有 “.htaccess” 作用域的指令都允许出现在 .htaccess 文件中。 而对于 URL rewrite … Continue reading

Tagged | Leave a comment

[Wed Dec 09 20:08:30 2009] [error] (OS 10038)在一个非套接字上尝试了一个操作。 : Child 7852: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.

来源 今日电脑上的APACHE启动后CPU占用率一直高居100%, PHP程序也无法执行了。 查看错误日志里面记录了很多: [error] (OS 10038)在一个非套接字上尝试了一个操作。 : Child 3356: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive. 去到网上搜索,找到下面的解决方法: 编辑httpd.conf Win32DisableAcceptEx ##加入这行 ThreadsPerChild 250 MaxRequestsPerChild … Continue reading

Tagged | Leave a comment

哪个sb插件改了我的.htaccess

上次的wordpress故障在解决的同时发现了一个惊天的秘密,俺的web根目录下的.htaccess被修改。 被修改成这样: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]   # END WordPress   RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} (Googlebot|Slurp|msnbot) RewriteRule ^ http://doormoney.us/ [R=301,L]   难怪google仅仅收录了本站4页,原来google,yahoo,msn的机器人都被301带到了一个叫doormoney.us的网站,估计是哪个sb插件修改的,要么就是被黑了?貌似是个白俄罗斯的网站。啥内容也没有。 删掉# BEGIN WordPress和# … Continue reading

Tagged , | 1 Comment

dr.com与apache冲突暂行解决方案

apahce和dr.com(学校用的v3.483(d14)) 的冲突问题让我困顿,每次开机都要禁用windows防火墙,禁用lmhost,netbios,然后再手动开启apache和mysql,我已经被dr.com打败。 方法非原创,参看这里的几篇文章:1 ,2 主要是通过修改dr.com和apache冲突了的注册表值, HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\WinSock2\Parameters\ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\ 在没有安装dr.com的情况下导出上面两个位置的键值,名为apache1.reg apache2.reg 在安装dr.com的情况下导出上面两个位置的键值,名为drcom1.reg drcom2.reg 写个bat和这些.reg文件全部复制到apache目录 ,我用的是2.2: D:\phpnow\Apache-22 批处理内容———————————————— echo import apache.reg…& restart apache regedit /s apache1.reg regedit /s apache2.reg call D:\phpnow\PnCmds\Apa_Restart.cmd call D:\phpnow\PnCmds\My_Stop.cmd call D:\phpnow\PnCmds\My_Start.cmd echo press enter to import drcom.reg pause regedit … Continue reading

Tagged | Leave a comment

Apache:setup_inherited_listeners(), WSASocket failed to open the inherited socket

几天捣腾Win平台的Apache,启动了也没有看到httpd.exe进程,服务也无法开启,查看logs目录下的error.log内容: “setup_inherited_listeners(), WSASocket failed to open the inherited socket” 解决方法: "网络连接"–>"tcp/ip属性"–> "高级"–>"wins"—>去掉"LMHOSTS查询"的勾选。

Tagged | 2 Comments