Apache
来自tomtalk
apache启动、停止、重启命令
#启动 /usr/local/apache2/bin/apachectl start #停止 /usr/local/apache2/bin/apachectl stop #重启 /usr/local/apache2/bin/apachectl restart #重启时不中断当前的连接 /usr/local/sbin/apachectl graceful
怎样配置apache虚拟主机
<VirtualHost *:80> ServerAdmin tecshuttle@gmail.com DocumentRoot "c:/wamp/www/zenho_xs/" ServerName xs.zenho.com ErrorLog "logs/zenho_xs-error.log" CustomLog "logs/zenho_xs-access.log" common </VirtualHost> <Directory "c:/wamp/www/zenho_xs/"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory>
重定向
<VirtualHost *:80> DocumentRoot /home/wwwroot/beta/G3_Lite ServerName dev.t.redidai.com RewriteEngine on RewriteRule ^/public/(.*)$ http://dev.t.redidai.com/public_2/$1 [R=301,L] </VirtualHost>
重定向不区分大小写
RewriteRule (.*)\.php$ http://b.clin003.com/$1\.jsp [R=301,L,NC]
R=301为301跳转,L为rewrite规则到此终止,NC为不区分大小写