易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 2|回复: 0
收起左侧

httpd 服务启动时报错:Invalid command 'RewriteEngine', perhaps misspelled or defined by

[复制链接]
发表于 2024-1-3 10:00:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
<VirtualHost *:80>
8 @. K# c* c6 D$ v RewriteEngine on3 R2 i% h; W2 S5 c
RewriteCond %{SERVER_PORT} !^443$( `& R; y. o3 W* U$ i
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]5 g8 g; I1 _' `& W9 z. |3 g% g
</VirtualHost>
4 P  t) y: Z. C2 R% N$ x
& i! G0 N+ m% g: b, i4 M& v# U
5 n) o' q5 y6 I; N4 V7 j
/ a" `3 I. g+ U9 _8 g! \7 w- |添加https服务:/ T% x: W- R3 b
重启httpd服务,报错:
3 J  Y* F1 J/ X
6 w  q4 n; s+ f4 Q4 }; {# D6 L! E% t, _
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
3 E4 }1 v, J+ w; `5 E' n, ~
* i) a' L& F3 p. j* q  r& S3 L/usr/local/httpd/bin/apachectl restart/ }0 S- R; a. h5 n8 U: L
AH00526: Syntax error on line 248 of /usr/local/httpd/conf/httpd.conf:3 Y4 x) Z+ g9 ?& r  g% `6 Y
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration  @4 T6 m' H: C! q9 H* D3 t$ q

- E1 ?' H! \  \/ |
) ~0 i1 s& {9 r+ P0 N解决办法:
$ q* p& {8 h5 v) u: j- d( r4 w# W7 P( C2 \# ?  d& E
修改httpd.conf
$ j  F, n* o+ u# z' D#LoadModule rewrite_module modules/mod_rewrite.so   
, p7 ^7 j% F! I, V
  ]& G# _2 j+ s( }; K/ a4 n: ]LoadModule rewrite_module modules/mod_rewrite.so
5 e# v6 s/ [* S! x$ Y
* `4 H( {* L- Z# v, ]- `0 T  o+ }) C

% \8 [4 q, r# E8 y; I4 z /usr/local/httpd/bin/apachectl restart
) ^* g- z4 C0 ~/ pAH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:feaa:acc1%ens160. Set the 'ServerName' directive globally to suppress this message) p+ e& p% B6 c: d
2 {% [5 }# a1 p+ b
1 n, P' d0 C) D; X1 e& n1 h0 ?

! R* O: R* C0 l& b1 E/ H, D5 l) d
0 b  z& ?; V% A  Q. o. R4 z+ ^
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:30 , Processed in 0.047042 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表