根据configuration, site.com应该默认打开html/web/index.php ,但site.com/ticket应该打开html/ticket/index.php 。 ticket和web文件夹位于html 。 server { listen 80; return 301 https://$host$request_uri; } server { add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; server_name site.com; server_tokens off; root /usr/share/nginx/html/web; location / { index index.php; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } […]
我对Apacheconfiguration(使用AWS )非常陌生 。 在/etc/httpd/conf/httpd.conf有这个指令: IncludeOptional conf.d/*.conf # Enable server-status for internal IP <Location /server-status> SetHandler server-status Require ip 127.0.0.1 </Location> 这是工作,并抛出403错误,当访问http://example.com/server-status 现在我想添加自己的IP地址,而不需要真正改变这个文件,所以我使用/etc/httpd/conf.d/customRules.conf是我的IP地址) # Enable server-status for internal IP <Location /server-status> SetHandler server-status Require ip 127.0.0.1 11.234.567.789 </Location> 但是,我仍然收到403错误,因为它不工作。 如何在conf.d/customRules.conf覆盖来自conf/httpd.conf指令?
我试图使用下面的Apache代码,以防止在.git文件夹中的任何东西。 但是我仍然可以访问example.com/.git/config文件。 <Directorymatch "^/.*/\.git/"> Order deny,allow Deny from all </Directorymatch>
我正在使用Apache 2.4和几个虚拟主机。 这是在Windows上,顺便说一句。 在每个虚拟主机中,我有以下日志文件configuration: CustomLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.ssl_request.%Y.%m.%d.log 86400" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=HTTPS ErrorLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.error.%Y.%m.%d.log 86400" TransferLog "|bin/rotatelogs.exe -l ${SRVROOT}/logs/dev.access.%Y.%m.%d.log 86400" 这将是DEV虚拟主机。 其他(testing/ ua /等)基本上是相同的,除了ServerName和日志被命名为{环境} .error等。 现在,当我启动Apache的时候,错误日志文件会被一遍又一遍地重复一遍。 该消息是: Incorrect number of arguments Usage: C:\Program Files\Apache Software Foundation\Apache24\bin\rotatelogs.exe [-v] [-l] [-L linkname] [-p prog] [-f] [-t] [-e] [-n number] <logfile> […]
我正在我的apacheconfiguration中安装.crl。 它看起来像这样: VirtualHost 默认 DocumentRoot“web”ServerName example.com SSLEngine上 SSLCertificateFile“cert.crt”SSLCertificateKeyFile“key.key”SSLCertificateChainFile“cert.ca-bundle” SSLProtocol -all + SSLv3 SSLCipherSuite SSLv3:+ HIGH:+ MEDIUM 目录 顺序拒绝,允许全部允许 SSLCACertificateFile“ClientRootCert.crt” SSLVerifyClient需要SSLVerifyDepth 3 SSLCARevocationFile“CRLList.crl” 目录 虚拟主机 当Apache启动时,我得到错误: SSLCARevocationFile不允许在这里 当我将SSLCARevocationFile放置在Directory标签上方时,Apache启动,但所有客户端证书都被拒绝,并显示以下消息: ssl_error_expired_cert_alert(撤销和活动证书) 如何解决这个问题?
我的活网站读取.htaccess罚款。 我得到了404.php和mod_rewrite在那里工作,但在我的本地…没有。 PHPmyAdmin 3.1.5 PHP 5.2.9-2 Apache 2.2 我的.htaccess是这样的: ErrorDocument 404 /404.php Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^news/([0-9]+)-(.*)\.html$ news/index.php?id=$1 [L] 读取http://localhost/phpinfo.php显示mod_rewrite已打开,但不起作用,404.php页面也不起作用。 Apache错误日志只显示在该服务器上找不到页面。 我的httpd.conf目前看起来像这样: DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" <Directory /> Options FollowSymLinks Order Allow,Deny Allow from 127.0.0.1 Deny from All </Directory> 我可以把它改成你想要的任何组合,但是它不会做任何事情。 我的头痛源头在哪里呢? 我错过了什么? 谢谢,签名,noob(在技术的东西)
从Windows的历史来看,我只是设法让我的第一台运行Apache,PHP5,Mysql,Memcached和其他一些好东西的Ubuntu计算机作为本地开发工作站。 但是,要学习基础知识,因为我对Apachesconfiguration和build议的设置知之甚less: 在Ubuntu上configuration全新安装的Apache时,常用的常识和良好的做法是什么? 我假设需要开箱即可完成某些工作,才能充分利用我的软件包的潜力? 非常感谢,
我在我的Apache2服务器上有几个虚拟主机。 我想要实现的是将其中一个主机设置为主机。 所以,每当我在浏览器中input我的IP地址,它就会把这个特定的主机连接起来。 我怎样才能做到这一点?
我试图阻止我们的网站上的图像的热链接。 我试过编辑 在/etc/httpd/conf/httpd.conf中join以下内容到文件末尾: <VirtualHost *:80> ServerName www.myserver.co.uk ServerAlias myserver.co.uk DocumentRoot /var/www/html/www.myserver.co.uk ServerPath /www.myserver.co.uk SetEnvIfNoCase Referer "myserver'.co.uk" local_ref=1 <FilesMatch "'.(gif|jpg|jpeg|png)"> Order Allow,Deny Allow from env=local_ref </FilesMatch> 但是这似乎并不妨碍热链接。 我知道我也可以防止在.htaccess文件中的热链接,但想知道为什么我通过httpd.conf文件尝试做的失败? 我也试过了: SetEnvIfNoCase Referer "^http://www\.myserver\.co\.uk/" banimages=1 SetEnvIfNoCase Referer "^http://myserver\.co\.uk/" banimages=1 SetEnvIfNoCase Referer "^$" banimages=1 <FilesMatch "\.(gif|png|jpe?g)$"> Order Allow,Deny Allow from env=banimages=1 </FilesMatch> 哪个也没用。 我做错了什么? 编辑:我还没有在httpd.conf文件的末尾尝试以下4行,而不是像虚拟主机标签中的任何标签: RewriteEngine on RewriteCond %{HTTP_REFERER} […]
我在httpd.conf文件中做了一个redirect <VirtualHost *:80> ServerName y.com *.y.com Redirect permanent / http://x.com/ </VirtualHost> 并重新启动,但redirect不起作用。 两个域的IP地址是一样的。 所有帮助赞赏 谢谢Jean