我正在加载带有 500 内部服务器错误的页面,因为我相信 Apache 尚未配置为允许的指令。
我将 AllowOverride 设置为 all,以及一个 .htaccess 文件,包括:
<FilesMatch "\.(eot|ico|pdf|flv|jpg|jpeg|png|gif|svg|swf|ttf|woff)$">
Header set Cache-Control "max-age=31536000, public"
Header set Expires "Wed, 23 Apr 2014 17:00:01 UTC"
</FilesMatch>
Run Code Online (Sandbox Code Playgroud)
/var/log/apache2/error.log 有:
[Sat Jul 20 15:12:36 2013] [alert] [client 24.15.83.241] /home/jonathan/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
Run Code Online (Sandbox Code Playgroud)
我需要指定什么才能让 Apache2 正确处理“Header”指令?
我正在开发一个(Debian)Dreamhost VPS,它似乎只想要基于密码的身份验证:添加我的 RSA 和 DSA 公钥~/.ssh/authorized_keys并没有改变需要密码登录的行为。
如何设置服务器才能接受~/.ssh/authorized_keys?
我有几个站点使用 StartSSL 免费证书(CJSHayward.com、JobhuntTracker.com)运行,Firefox 拒绝 StartSSL 并显示一个错误页面,说我的服务器没有正确配置 (IIRC) 由于证书链。我寻求帮助并确认我的 VirtualHost(应要求提供)用于证书链,并且我正确安装了中间证书。这些网站在 Chrome、Safari、Edge 或 Opera 中显示时没有我所知道的错误。
经过一番搜索,让我们加密吧!看起来像一个有吸引力的产品,不久我就拥有了(AFAICT)/etc/apache2/sites-enabled 下每个域的私钥和证书,当然减去任何不再是我的域。我想我会做一次试运行,并与现在仅在 HTTP 下可用的站点建立 HTTPS 连接:JSH.name。我移动了“让我们加密吧!” 证书和私钥到我的 SSL 目录并添加:
<VirtualHost *:443>
ServerAdmin cjshayward@pobox.com
DocumentRoot /home/jonathan/stornge
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/0000_csr-letsencrypt.pem
SSLCertificateKeyFile /etc/apache2/ssl/0000_key-letsencrypt.pem
ServerName jsh.name
ServerAlias www.jsh.name
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog /home/jonathan/logs/stornge.com combined
<Directory /home/jonathan/stornge/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>Run Code Online (Sandbox Code Playgroud)
Then I rebooted to …
我试图让 Apache 2.4.10 执行.htaccess文件中指定的基本身份验证(在 HTTPS 下)。我将一个目录的设置更改为AllowOverride all,它开始只提供普通的 500 页。将该目录恢复到AllowOverride none似乎没有固定的东西。
我在日志中发现的错误似乎都将请求的相对 URL 解释为授权用户名,并发出嘶嘶声:
[Wed Jun 22 20:34:00.565683 2016] [core:crit] [pid 24994] [client ____:51295] AH00025:配置错误:无法检查用户:/writing/icons/rublev_trinity_icon.gif,引用:____
AH00025是什么意思?我发现了一些像https://httpd.apache.org/docs/trunk/upgrading.html这样的页面,但没有明确定义错误代码。
我想要什么 /etc/apache2/mods-enabled/auth* 文件?
我正在一个网站上工作,实现为 shtml,当我尝试从 IE8加载主页 ( http://simplyclassicremodeling.com ) 时,它说它无法打开文件,因为它作为内容类型传输“文本.html”。该页面从 Chrome 加载正常,并在 Firefox 中加载(有一些与此处无关的 CSS 问题)。
httpd.conf 有:
Options Includes Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .cgi .pl
AddType text/html .shtml
AddHandler server-parsed .shtml
Run Code Online (Sandbox Code Playgroud)
再往下:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/javascript
Run Code Online (Sandbox Code Playgroud)
来自 Telnet 会话的 HTTP 标头是:
GET http://simplyclassicremodeling.com/ HTTP/1.0
HTTP/1.1 200 OK
Date: Fri, 27 Jan 2012 21:57:54 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.9-dev DAV/2 PHP/5.2.6
Accept-Ranges: bytes
Cache-Control: max-age=2592000, public
Expires: Sun, 26 Feb 2012 21:57:54 …Run Code Online (Sandbox Code Playgroud) 我正在努力让 Apache 为 Django 项目提供静态文件。我的 VirtualHost 有:
Alias /static/ /home/jonathan/pragmatometer/static/
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
Run Code Online (Sandbox Code Playgroud)
但是对 /static/css/style.css 的请求是由 Django 进程提供的,而不是对 /home/jonathan/pragmatometer/static/css/style.css 的静态拉取。
我该怎么做才能让 Alias 胜过代理?我可以尝试为 /load/、/save/、/admin/ 拼凑几个 ProxyPass / ProxyPassReverse 定义,但这肯定是错误的方式。
那么正确的方法是什么?
对于某些图像,我正在处理的 Wordpress 安装出现错误,“GD 库错误:imagecreatetruecolor 不存在 - 请联系您的网络主机并要求他们安装 GD 库”。
如何在 Ubuntu 服务器上安装和/或连接 GD 库,以便 Wordpress 看到显示这些图像所需的内容?
谢谢,
apache-2.2 ×3
apache-2.4 ×2
debian ×2
.htaccess ×1
django ×1
http-headers ×1
installation ×1
lets-encrypt ×1
proxy ×1
ssh ×1
ssh-keys ×1
ssl ×1
ubuntu ×1
wordpress ×1