- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
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+ ^ |
|