使用Apache可以编辑虚拟主机从日志到ErrorLog文件中排除某个绝对path (如/var/www/html/blog/wp-content/plugins/my_plugin/ )? 我需要阻止它像这样的日志警告: PHP Warning: Illegal offset type in isset or empty in /var/www/html/blog/wp-content/plugins/my_plugin/tool.php 然而,我需要看到其他的警告,这只是关于一个文件,这就是为什么我想保持我的php.ini不变。
我在win10机器上使用Apache 2.4.27。 我遵循这里find的所有步骤。 我添加了一个用户(“dennis”),可以访问一个文件夹用户名/密码。 它工作得很好,而且我第一次尝试访问这个文件夹,它问我一个用户名/密码,从来没有问过我。 然后我试图添加另一个用户到相同的文件夹,以用户名/密码访问它。 我创build了一个名为“GroupName”(没有扩展名)的文件,内部是: GroupName: dennis ninja 我去了我的CMD,并添加了忍者用C:\Apache24\bin>htpasswd C:\Apache24\psw\passwords ninja 然后我去了httpd.conf,并在底部添加 <Directory "c:/Apache24/htdocs/safe"> AuthType Basic AuthName "By Invitation Only" #(Following line optional) AuthBasicProvider file AuthUserFile "c:/Apache24/psw/passwords" AuthGroupFile "c:/Apache24/psw/GroupName" Require group GroupName </Directory> 我重新启动Apache,我没有得到任何错误。 但是,当我去http://localhost/safe/safe.html我仍然可以看到页面。 为什么它不再问我一个密码,因为我添加了另一个用户? 有没有办法“登出” dennis ,所以它可以问我的密码,我可以给忍者的密码? 还是我犯了一个错误? 谢谢
我喜欢我的网站可以通过example.org或https://example.org而不是www.example.org 。 所以我希望http://www.example.orgredirect到http://example.org和http://www.example.org到https://example.org 。 但有趣的事情发生: https://www.example.orgredirect到https://example.org 而不是http://www.example.org到http://example.org 我的main.conf: <VirtualHost *:80> ServerName example.org ServerAdmin webmaster@localhost DocumentRoot "/var/www/html" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <VirtualHost *:443> ServerName example.org ServerAdmin webmaster@localhost DocumentRoot "/var/www/html" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLCertificateFile /pathtocert.pem SSLCertificateKeyFile /pathtokey.pem </VirtualHost> <Directory "/var/www/html"> Options FollowSymlinks ExecCGI AllowOverride None Require all granted </Directory> 我的www.conf: <VirtualHost *:80> ServerName […]
我试图在我的Linux机器上本地启用SSL。 为此,我按照本教程创build了一个证书颁发机构,一个中间证书颁发机构和最后一个localhost及其密钥的证书。 我validation了每一步,所有的文件似乎都很好。 我使用了这里描述的带有alternate_names的conf文件。 # OpenSSL intermediate CA configuration file. # Copy to `/root/ca/intermediate/openssl.cnf`. [ ca ] # `man ca` default_ca = CA_default [ CA_default ] # Directory and file locations. dir = /home/cquiros/data/projects2017/climmob/software/climmob/ssl/ca/intermediate certs = $dir/certs crl_dir = $dir/crl new_certs_dir = $dir/newcerts database = $dir/index.txt serial = $dir/serial RANDFILE = $dir/private/.rand # The root […]
我正在尝试更新FreeBSD机器上的PHP安装。 我跑了 portsnap fetch update cd /usr/ports/lang/php56 make reinstall cd /usr/ports/lang/php56-extensions make reinstall service apache24 restart 然后重新加载页面,我有phpinfo()显示输出,它仍然显示5.6.24但如果我在shell提示符运行php –version ,我得到 PHP 5.6.31 (cli) (built: Aug 30 2017 13:40:53) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies 显然我在这里忘了一步,但是我这样做已经有一段时间了,我的记忆有点模糊。 编辑 正如箭头所指出的,我还有两个步骤可以运行: cd […]
我需要帮助记住我所做的,以允许Plesk使用.htaccess 。 我最近改变了域上的PHP上传文件大小,突然我的.htaccess指令停止工作。 这意味着我“固定”了一些东西,可能在httpd.conf ,并且愚蠢地没有将修复传播到Plesk文件中不被自动覆盖的东西。 (哟,白痴….) 我的.htaccess文件有一系列的条目,如下所示。 这就是它的全部内容。 目的是让我有example.com/command执行一个文件command ,就好像它是command.php 。 我已经这么做了几十年了。 如果你原谅我,如果你的答案是“不要那样做”的话,请不要这样做。 谢谢。 的.htaccess <Files support> SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000 </Files> 我已经尝试将每个Plesk的说明张贴到Apache的“其他指令”字段(创buildvhosts.conf文件,我重新configuration,所以它被正确包括),无济于事。 在http.conf #ATTENTION! # #DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, #SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED. #IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, […]
我有nodejs服务器和一些静态内容来服务。 我使用apache 2.4来达到这个目的,因为我需要在同一台机器上configuration多个主机。 我在我的apache 2.4中configuration了我的虚拟主机 <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] ServerName mydomain.co.in ServerAlias mydomain.co.in ProxyPass /api http://127.0.0.1:3001/api ProxyPassReverse /api http://127.0.0.1:3001/api DocumentRoot /root/VEFA-test-admin/vefa-admin/platforms/browser/www <Directory /root/VEFA-test-admin/vefa-admin/platforms/browser/www> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLCertificateFile /etc/encrypt/live/mydomain.co.in/fullchain.pem SSLCertificateKeyFile /etc/encrypt/live/mydomain.co.in/privkey.pem </VirtualHost> </IfModule> 而我的nodejs服务器在同一台机器上的portt 3001上运行。 问题是用户将访问我的网站使用mydomain.co.in得到看到的页面。 但在一种情况下,我将用户redirect到支付网关,支付网关在付款后将用户redirect到我的网站。 支付网关将用户redirect到我的网站时,会发生此问题。 Apache的错误日志说: [Thu Sep 07 […]
平台 :Centos 7 scheme :我有一个驱动器“ / mnt / ELEMENTERY-1TB ”与fstab挂载 UUID=a6339f33-1c61-4c2c-a490-04c83ccfb4d6 /mnt/ELEMENTERY-1TB/ ext4 defaults,errors=remount-ro,context="system_u:object_r:samba_share_t:s0" 0 1 – 我想通过简单的Apache目录列表在本地networking上共享。 创build符号链接ln -sd /mnt/ELEMENTERY-1TB/ /var/www/html/ 。 我可以通过没有符号链接的目录列表访问其他文件夹, [root@271 html]# ls -al total 8 drwxr-xr-x. 4 apache apache 68 Sep 12 12:14 . drwxr-xr-x. 4 root root 33 Sep 10 15:14 .. drwxr-xr-x. 7 root root 4096 Sep 2 […]
我正在访问一些地址为http:// xxxx:25055 / CaseStatus.svc / json / 21480的 api url。我可以直接从我的浏览器访问这个URL,但是当我通过PHP curl从我的活网站(托pipe服务器A),我得到连接拒绝错误。 我一直在这个问题上工作了一整天:这里有更多的细节… api服务是使用自己的服务器机器上的IIS(Windows Server 2012)托pipe的c#wcf编写的。 我已经上传相同的PHP代码到另一个网站(托pipe服务器B),它正在工作,并返回JSON数据。 ( http://www.dailywebsolutions.com/services.php )。 它与Chrome应用邮差工作正常。 这导致我假设托pipe服务器A存在一些configuration问题,但我可以通过curl从服务器A访问其他第三方API,没有任何问题。 托pipe服务器A和托pipe服务器B之间的唯一区别是,A有SSL证书安装,但我不认为这应该是一个问题,因为我使用http访问API服务。 任何想法应该是可能的原因? – 我不认为我的代码有任何问题,而似乎在我的服务器configuration问题; 这就是为什么我在这里发布我的问题,而不是stackoverflow。
我试图使用下面的Apache代码,以防止在.git文件夹中的任何东西。 但是我仍然可以访问example.com/.git/config文件。 <Directorymatch "^/.*/\.git/"> Order deny,allow Deny from all </Directorymatch>