易陆发现互联网技术论坛

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

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

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

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

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

x
<VirtualHost *:80>
+ y* p' G2 v5 G( l4 x# m RewriteEngine on- ?: h' ]) ]$ k9 T# X% {, u. ^
RewriteCond %{SERVER_PORT} !^443$' D" v3 o7 J6 T) W) H- O1 H% m9 x
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]* O. `9 g$ h5 |$ r, @
</VirtualHost>5 P0 A+ q- I/ c; {& b

* e4 @# z+ x8 j; [, e
3 u+ q/ A& `* C" ^; \5 z0 E4 r8 D. Y8 y  i( ^
添加https服务:+ P9 v; q3 P7 ~* j1 F* W& F  I
重启httpd服务,报错:
$ O, @  n" P7 f3 u1 L( ]! Y+ ?
, y: r$ I! Y4 t. g; E+ ^. i2 _) n
- U, Z, X, W: e5 f# _0 GInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration' i& m7 X( _3 @! n0 D

7 f8 N; K7 _: z4 Q/usr/local/httpd/bin/apachectl restart
5 t) D7 C0 s6 Q+ _AH00526: Syntax error on line 248 of /usr/local/httpd/conf/httpd.conf:* U7 [) a: P, b' x/ e: z& D; z
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
4 `6 W5 l# ~( S; p$ f
3 e2 ^5 M6 m* U, C" S) Q3 d4 _. S
" U$ M! ^& S6 O7 y2 o. ~" u解决办法:. c8 E! o6 d. O6 `/ E: N0 T: g
/ I/ t, ?2 K; S# [  Z- X# C3 p
修改httpd.conf 2 ^( W# B* l; X! `! N
#LoadModule rewrite_module modules/mod_rewrite.so   & m( B# e) `% B0 V: l* S

  O3 F5 Q6 I9 h/ JLoadModule rewrite_module modules/mod_rewrite.so+ ?" i8 }* F2 T4 K
/ j! k' O% d' C4 t
4 I, A6 a8 k" @: X; \
- a5 f1 Z% N  j0 q, U; e( C
/usr/local/httpd/bin/apachectl restart
" }+ L$ [, }; Y6 y5 m2 t+ C1 rAH00558: 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
0 s( M4 T7 |( q2 ?& C$ C3 H+ Q) A* G
9 I& T5 ^* `3 A" C) b( K, R
. T# K: y9 J( ?! `) S
4 g5 B5 I' A; {! |5 e( Y5 b$ w" {; q; m( [: Z3 D! f
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 21:27 , Processed in 0.040663 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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