Articles of apache 2.2

nginx重写为PHP restful api apache htaccess

我有一个使用Restful API教程的apache htaccess文件 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^(.*)$ api.php?rquest=$1 [QSA,NC,L] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ api.php [QSA,NC,L] RewriteCond %{REQUEST_FILENAME} -s RewriteRule ^(.*)$ api.php [QSA,NC,L] </IfModule> 我的nginxconfiguration目前是: server { listen 80; server_name example.org; access_log /var/log/nginx/access.log main; location / { index index.php index.html index.htm; } error_page 404 /404.html; location = […]

哈德森与活动目录错误

第一个问题在这里超级用户(我沉迷于stackoverflow)。 所以,我试图在Hudson(3.0.1-b2)上configuration活动目录插件(1.31-h1版本),但没有成功。 在安全屏幕configuration有select我selectActive Directory然后我点击高级button,并把我的域控制器mydomain.com.br这工作顺利,但是当我select选项Matrix security并尝试从我的用户添加域它显示我一个链接ERROR当我点击它,它显示我一个403 HTTP错误(禁止)。 所以,试图找出错误是什么我去了tomcat日志,并有一个错误,说它无法findmyuser信息 Jun 4, 2014 7:20:36 AM hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider retrieveUser WARNING: Failed to retrieve user information for myuser javax.naming.NamingException: [LDAP: error code 1 – 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece]; remaining name 'DC=mydomain,DC=com,DC=br' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown […]

Railo-Apacheconfiguration问题:“example.com”指向/ var / www,“example.com:8888”指向Railo

按照我的标题,我能够在我的VPS上成功安装和运行Railo和Apache。 它运行Ubuntu 14.04。 我的dillema是我无法获取example.com指向我的Railo根目录。 现在, example.com指向/ var / www 而 example.com:8888指向我的Railo根目录。 如何让example.com指向Railo根? 我很感激任何人都可以指出我正确的方向。 谢谢! 这是我追加到/opt/railo/tomcat/conf/server.xml <Host name="example.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="/opt/railo/tomcat/webapps/ROOT/gph" /> <Alias>www.example.com</Alias> inheritance人我的默认configuration <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # […]

cgit + redmine + git(提前整合)

我已经成功设法configuration我的Redmine与先进的git集成。 不过,我非常感兴趣的是将cgit与当前的configuration结合起来,但我不知道如何。 所以,基本上我想通过结合这两个configuration来使用Redmine的authenticationcgit。 这里是我的工作configuration(只有当我禁用其中一个)将工作: cgitconfiguration : <VirtualHost *:80> ServerName git.domain DocumentRoot "/var/www/htdocs/cgit/" DirectoryIndex cgit.cgi SetEnv CGIT_CONFIG /etc/cgitrc <Directory "/var/www/htdocs/cgit"> Options FollowSymlinks ExecCGI Allow from all AllowOverride all Order allow,deny <Files cgit.cgi> SetHandler cgi-script </Files> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.* /cgit.cgi/$0 [L,PT] </Directory> <Directory "/opt/git"> Allow from all </Directory> </VirtualHost> 通过Redmine进行Git身份validation […]

Apache stapling_renew_response:响应者错误

我的Apache错误日志显示了很多“stapling_renew_response:responder”错误。 希望能添加一个浏览器截图,但我是一个新手,因此没有授权。 这是浏览器显示的内容: "Secure Connection Failed An error occurred during a connection to www.mysite.co.uk. The OCSP server suggests trying again later. (Error code: sec_error_ocsp_try_server_later) 这是一个间歇性故障,但是当我重新启动Apache时,问题暂时消失。 当Apache尝试parsingOCSP响应者的地址时,看起来问题就出现了。 [Mon Jun 30 16:00:52.666880 2014] [ssl:error] [pid 20449] (EAI 3)Temporary failure in name resolution: [client 12.34.56.78.9:54254] AH01972: could not resolve address of OCSP responder EVSSL-ocsp.geotrust.com [Mon Jun 30 16:00:52.666954 […]

什么会导致Apache返回畸形的HTTP响应?

我有一个Go服务器,反向代理请求到Apache / PHP服务器。 我很less观察到Apache / PHP服务器偶尔会导致Go产生以下错误消息: malformed HTTP response "false"错误的malformed HTTP response "false" 。 这些请求是相同的,我可以在浏览器中按照请求path坐下来刷新一个页面,并且可能有一百次错误发生。 至于什么时候会发生,我还没有观察到任何的模式。 在任何访问日志,错误日志或系统日志中都没有任何相关的东西。 我已经能够让Go用下面的代码产生错误消息,所以看起来Apache必须发送无效响应,直接将string“false”写入到TCP连接。 任何线索,这将不胜感激。 请求: package main import ( "fmt" "net/http" "net/http/httputil" ) func main() { req, _ := http.NewRequest("GET", "http://127.0.0.1:36302", nil) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } respDump, _ := httputil.DumpResponse(resp, true) fmt.Println(string(respDump)) } […]

Apache 500内部服务器使用空的用户名字段进行authz_svn_module身份validation时出错

我的环境 Apache 2.2 Windows Server 2008 R2(我也有与Windows 7相同的问题) 乌龟SVN 1.8.7 Subversion 1.8.9 我有这个SVN服务器使用Apache使用authz_svn_module及其依赖项(mod_dav_svn.so等)与Active Directory进行身份validation。 身份validation部分正常工作正常,但如果我将字段用户名留空,则会生成500内部服务器错误。 如果我尝试从Web浏览器login或者尝试执行svn结帐 ,问题就会发生。 它不会在Apache logs / error.log文件中生成条目,但会在logs / access.log文件中留下条目: xxxx – “”[12 / Aug / 2014:11:00:10 -0300]“GET / svn / HTTP / 1.1”500 550 而不是当我input无效的用户名/密码时: xxxx – invalidu1 [12 / Aug / 2014:10:11:03 -0300]“GET / svn / HTTP / 1.1”401 401 […]

Apache2 HTMLURLMap使用AJAX请求混淆

我需要代理从oldname.my.net Web应用程序newname.my.net为此,我使用代理模块的Apache这样的Apache # PROXY TO INTERNAL SERVER ProxyPreserveHost On RequestHeader set Host "oldname.my.net" RequestHeader set Authorization "Basic asj2dhI2dBASE64asdjlk=" ProxyPass / http://server.local/ ProxyPassReverse / http://server.local/ ProxyPassReverseCookieDomain oldname.my.net newname.my.net <Location /> SetOutputFilter proxy-html ProxyHTMLURLMap http://oldname.my.net/ / RequestHeader unset Accept-Encoding </Location> 代理工作到目前为止,我可以login和浏览,点击链接等,但一些内容通过AJAX请求加载,他们似乎并没有工作。 我没有在web开发经验,所以我不完全知道他们是如何工作或他们做什么,但他们似乎是dynamic加载内容,我认为ProxyHTMLURLMap选项是搞乱他们。 有没有人有经验的Apache代理和网站,使用硬编码链接(ProxyHTMLURLMap是必须的网站工作)和AJAX请求?

Apache重置LDAP请求并挂起

我在CentOS 6.5下运行Apache 2.2.15。 正在使用mod_authnz_ldap模块对Microsoft AD服务器进行身份validation。 这里是Apache中的LDAPconfiguration: AuthType Basic AuthBasicProvider ldap AuthzLDAPAuthoritative on AuthLDAPURL ldap://[ad server ip address]/[basedn]?mail AuthLDAPBindDN [binddn] AuthLDAPBindPassword [bindpass] AuthName "LDAP: myhost.example.com" Require ldap-group cn=[foo],ou=Permissions,ou=Groups,ou=[bar],dc=[baz],dc=com 大多数情况下,浏览器对这个Apache主机的请求工作正常。 它对AD服务器进行正确的身份validation,页面正常加载。 然而,平均每隔几分钟,请求就会从浏览器端挂起。 tcpdump显示Apache正在发送一个TCP RST数据包,显然是响应来自AD主机的PSH ACK数据包。 交换看起来像这样: 53 600.408744 Apache AD TCP 74 42804 > ldap [SYN] Seq=0 Win=14600 Len=0 MSS=1460 SACK_PERM=1 TSval=2665219285 TSecr=0 WS=128 55 600.469478 AD […]

Apache – 使用脚本(bash,perl,php等)设置标题,将http标题添加到请求中

我试图找出一个项目的可行性,我希望能够在每个请求上运行一个脚本(最好通过MIMEtypes进行过滤),并运行一个脚本来设置响应头。 基本上我想要的文本/ HTML和应用程序/ JSON文件的HTTP头由系统生成的任意数据(实际头添加将是GIT分支和提交哈希信息)。 这是为本地和分期的networking服务器,所以性能影响不是高度关注。 我已经用bash脚本调查了mod_ext_filter,并且我可以成功地将string注入到输出中,但是我无法访问标题(我假设它们已经被发送了?) 还有其他的select,我可以调查? 我到目前为止的尝试(在虚拟主机中): ExtFilterDefine githeaders mode=output \ cmd="/bin/bash /path/to/script/git_headers.sh" preservescontentlength <Location /> SetOutputFilter githeaders </Location> 基本的bash脚本testing回声 #!/bin/bash echo "hello" cat 上面的工作正常,向响应中注入hello,但我不能解决如何更改标题。 任何帮助/build议表示赞赏。