我正在pipe理一个网站tasteporto.com,这是一个简单的PHP / MySQL与WordPress的博客部分。 在主网站上,我有以下的Apache重写规则 RewriteEngine On RewriteBase / # no-www to www RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301] # http to https RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301] # if not blog, make URLs pretty RewriteCond %{REQUEST_URI} !^.*\/blog\/.*$ [NC] RewriteCond %{REQUEST_URI} ^.*\/index [NC] RewriteRule ^(.*)index\.php$ /$1 [R=301,L] # if not blog, make […]
有时,在我的服务器(Cent OS7,默认存储库)重新启动后,Apache不会自动启动。 要解决这个问题,我重新启动服务器一次,然后它的工作。 我的Apache错误日志显示如下: [Mon Jun 20 00:11:34.142198 2016] [auth_digest:error] [pid 2763] (17)File exists: AH01762: Failed to create shared memory segment on file /var/logs/authdigest_shm.2763 [Mon Jun 20 00:11:34.142282 2016] [auth_digest:error] [pid 2763] (17)File exists: AH01760: failed to initialize shm – all nonce-count checking, one-time nonces, and MD5-sess algorithm disabled [Mon Jun 20 00:11:34.142286 2016] [:emerg] […]
我无法让Apache在VirtualHost块内重新调整一个Options指令。 下面的代码片段非常简单,我可以重现错误 – 其余configuration是一个股票Deiban Apache 2.4。 <VirtualHost *:80> ServerName example DocumentRoot /home/test/ #owner www-data:www-data Options +Indexes <Location /> Require all granted </Location> </VirtualHost> 这将会失败,403 Forbidden和相应的日志中的以下行: [Sun Jun 26 15:06:30.378689 2016] [autoindex:error] [pid 15899:tid 140693629712128] [client 192.168.0.155:52850] AH01276: Cannot serve directory /home/test/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive 但是,将Options […]
我在Centos 7上运行Apache。 一些通过yum不可用的Perl模块我已经在自定义位置/ export / home / www / perl5中使用CPAN进行安装。 我已经专门使用了这个自定义的位置来防止CPAN模块干扰yum安装的任何东西,反之亦然。 然后我把这个在我的.bashrc中: export PERL_LOCAL_LIB_ROOT="$PERL_LOCAL_LIB_ROOT:/export/home/www/perl5"; export PERL_MB_OPT="–install_base /export/home/www/perl5"; export PERL_MM_OPT="INSTALL_BASE=/export/home/www/perl5"; export PERL5LIB="/export/home/www/perl5/lib/perl5:$PERL5LIB"; export PATH="/export/home/www/perl5/bin:$PATH"; 这对于运行本地构build的Apache非常有效,但是当我尝试运行yum附带的Apache2时,我得到以下结果: [Mon Jun 27 19:35:34.099272 2016] [perl:error] [pid 29077] Can't locate Apache/DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at (eval 3) line 2.\n 所以自定义path还没有被添加到这个Apache的@INC。 我认为它不是从我的shell中运行。 我如何获得Apache添加此Perlpath?
注意:这不是重复的,也不是这里的答案: Apache不解释.PHP文件 在我的本地Apachenetworking服务器上,我安装了PHP 5.6和7.0。 当我运行7.0脚本不执行(只是原始文本显示),但是当我切换到PHP 5.6一切都很好。 运行7.0时检查了我的httpd.conf ,它是正确的: LoadModule php7_module /usr/local/opt/php70/libexec/apache2/libphp7.so 在terminal中键入php –ini会产生以下内容: Configuration File (php.ini) Path: /usr/local/etc/php/7.0 Loaded Configuration File: /usr/local/etc/php/7.0/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d Additional .ini files parsed: /usr/local/etc/php/7.0/conf.d/ext-mcrypt.ini 看起来正确 inputapachectl -v会产生: Server version: Apache/2.4.18 (Unix) Server built: Feb 20 2016 20:03:19 我觉得这是我的Apacheconfiguration的问题。
我正在努力解决为什么加载.php文件时,我的.htaccess没有被考虑。 下面的文件坐在我的本地主机的webroot。 的.htaccess # Cause a HTTP 500 test file.html <html><body><h1>This should not show</h1></body></html> file.php <html><body><h1>This should not show</h1></body></html> 当我访问/index.html时,我得到预期的HTTP500当我访问/index.php时,html显示。 任何想法为什么.htaccess不会加载的PHP文件? Apache 2.4.6 VHost(/etc/httpd/vhosts.d/website.local.conf): <VirtualHost *:443> ServerName website.local ServerAlias www.website.local DocumentRoot /var/www/vhosts/website/website <Directory /var/www/vhosts/website/website> require all granted Options Indexes FollowSymLinks AllowOverride All </Directory> # Trigger PHP-FPM to run PHP execution <IfModule proxy_fcgi_module> ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/www/vhosts/website/php-fpm.sock|fcgi://website/var/www/vhosts/website/website" […]
我有一个Apache 2.4服务器,我已经创build了一个自签名证书,用于testinghttps与新的客户端站点。 我遇到的问题是,当我尝试转到在单独的vhosts.conf文件中设置的定义的虚拟主机时,始终为我的站点加载ssl.conf文件。 有人可以帮我理解为什么所需的虚拟主机永远不会加载,只有默认是? 我的ssl.conf内容 Listen 443 https SSL Global Context SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog SSLSessionCache shmcb:/run/httpd/sslcache(512000) SSLSessionCacheTimeout 300 SSLRandomSeed startup file:/dev/urandom 256 SSLRandomSeed connect builtin SSLCryptoDevice builtin <VirtualHost _default_:443> DocumentRoot "/var/www/html" ServerName localhost:443 ErrorLog logs/default_ssl_error_log TransferLog logs/default_ssl_access_log LogLevel warn SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /etc/pki/tls/private/localhost.key <Files ~ "\.(cgi|shtml|phtml|php3?)$"> SSLOptions +StdEnvVars </Files> […]
今天我注意到, mod_alias的Redirect和RedirectMatch指令在处理redirectURL方面显示出不同的行为。 像这样的陈述: Redirect 301 "/foo" "/bar%20baz" 将redirect到文字的urlbar%20baz ,而 RedirectMatch "/foo" "bar%20baz" 会redirect到bar%2520baz ,因为redirecturl的百分号已被转义。 我的redirecturl已经被转义了。 有什么办法可以告诉RedirectMatch不能再逃避它们吗?
我在WAMP上的openSSL上有这个奇怪的组合。 我的Windows命令提示符openssl version返回库版本 – > OpenSSL 1.0.2h 2016年5月3日 而我的PHPcurl调用 – echo "openssl version text: " . OPENSSL_VERSION_TEXT . "\n"; echo "openssl version text: " . OPENSSL_VERSION_TEXT . "\n"; 返回标题版本:openssl version text:OpenSSL 1.0.1t 2016年5月3日 我想知道如何更新OpenSSL头版本,因为我需要1.0.2为了APNS工作,因为我还在 HTTP / 2客户端前言string丢失或损坏。 接收字节的hex转储:504f5354202f332f6465766963652f613433646466376235 我正在使用Windows Server 2008 Windows NT OMEGA 6.1 build 7601(Windows Server 2008 R2企业版服务包1)AMD64 WAMP Apache / 2.4.17(Win64)Apache显示Apache / […]
我在AIX 6.1上运行Apache 2.4.20作为反向代理,以便访问运行在后端服务器上的Oracle商务智能11.1.1.7.150120。 反向代理修改原始HTML代码导致HREF锚点设置错误的地方。 这会导致菜单出现故障(锚点不再位于桌面结构上)。 原始HTML代码(部分): <a id="selEditDashboard" class="NQWMenuItem NQWMenuItemWIconMixin" href="javascript:void(null)" onclick="EditPage('saw.dll?EditDashboard&PortalPath=%2fusers%2fweblogic%2f_portal&Page=page%201&Done=saw.dll%3fDashboard');return false;" > <table class="MenuItemTable" cellspacing="0" cellpadding="0"> <tr> <td class="MenuItemIconCell"> <img border="0" src="res/sk_FusionFX/catalog/edit_ena.png" alt="Dashboard bearbeiten"/> </td> <td class="MenuItemTextCell" colspan="2">Dashboard bearbeiten </td> </tr> </table> </a> HTML代码来自反向代理: <a id="selEditDashboard" class="NQWMenuItem NQWMenuItemWIconMixin" href="javascript:void(null)" onclick="EditPage('saw.dll?EditDashboard&PortalPath=%2fusers%2fweblogic%2f_portal&Page=page%201&Done=saw.dll%3fDashboard');return false;" > </a> <table class="MenuItemTable" cellspacing="0" cellpadding="0"> <tr> <td class="MenuItemIconCell"> <img border="0" src="res/sk_FusionFX/catalog/edit_ena.png" […]