linux下Apache配置多域名

  1. /etc/httpd/conf/httpd.conf

  2. 修改 :
    ServerName 23.145.27.50:80
    NameVirtualHost 23.145.27.50

底部添加:


ServerAdmin root@localhost
DocumentRoot /var/www/html
ServerName 23.145.27.50



ServerAdmin root@localhost
DocumentRoot /var/www/html/aaa
ServerName aaa.youku.com



ServerAdmin root@localhost
DocumentRoot /var/www/html/bbb
ServerName bbb.youku.com

3.重启httpd service httpd restart

你可能感兴趣的:(linux,Apache)