|
|
<VirtualHost *:80>, R7 V2 f) D$ V. M9 P1 [
RewriteEngine on. T4 O2 h. |$ e( q E
RewriteCond %{SERVER_PORT} !^443$
/ l! W1 }" x+ U+ g$ `% R RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]! _4 L1 p! p+ {$ i+ R0 g! p
</VirtualHost>/ P* m$ R, }$ W8 F4 c- R
0 P" y: b$ ]! s+ z# I- Y0 \0 r
' [; W |$ Q/ j# [/ @0 E: i) i1 R% {( w% Z
* i, Z2 y/ k W2 @1 }添加https服务:
. x9 @1 m E2 ~2 O7 Y& d重启httpd服务,报错:' |8 D5 s( t, x* E/ P, d& r1 Q1 P
# D6 Y8 h: Q, ^& l% f! c
$ g+ y( k0 ]: r' K/ k( n' ?# A/ KInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
: {5 C9 \6 A% G8 ]+ `6 b( s
; k- f! P0 v( p4 g/usr/local/httpd/bin/apachectl restart/ y1 R- S$ c* k' Q2 ]
AH00526: Syntax error on line 248 of /usr/local/httpd/conf/httpd.conf:( [6 B$ O! o* t8 y7 J% l
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
+ B" W- H4 l/ ^- g$ L" \4 q3 m0 T, }" {/ u! K$ w6 A- M
" ?5 g4 x2 t, C! C0 d* D3 n
解决办法:3 U* V) W' a, }' [! i+ d5 p
, @2 C# S$ L% S# U6 Y4 R; K/ v) A修改httpd.conf
) l% T6 v2 f2 w#LoadModule rewrite_module modules/mod_rewrite.so
1 f5 A6 l4 V$ R$ K" B0 R$ ~) p; K! R; u: o% @& {
LoadModule rewrite_module modules/mod_rewrite.so8 _3 @1 ]) ^* |, t# \
- t5 c1 u2 \- T' B6 v; t O$ f% _, W, I# s; y
& R' u3 g1 f \) H% a0 l /usr/local/httpd/bin/apachectl restart
& U6 m+ Z) p# QAH00558: 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 message4 _# ?5 o: w3 R) ~! w
" _% ], C, `) w1 O7 B
# F1 W' `- _$ Q, t t* {
5 {& n, j( h0 X% p* N
5 }) k- D4 Q) a( D9 R |
|