apache
#设置
<VirtualHost *:80> DirectoryIndex index.php index.html index.htm ServerName "域名" DocumentRoot "本地地址" ErrorLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/%Y_%m_%d.error_zhonghuaedu_log 86400 480" TransferLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/%Y_%m_%d.transfer_zhonghuaedu_log 86400 480" </VirtualHost>
nginx
server{ listen 80; #监听80端口 server_name www.idc0531.net idc0531.net; #绑定域名,多个域名的绑定,用空格分开 index index.html index.php index.htm;#默认读取的文件名 root /var/www/html; #绑定的虚拟目录 location ~ .*.php$ #这个location是把所有关于后缀为php的请求交给php-fastcgi处理 { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; }
} |