直接在下/etc/httpd/conf.d/myhosts.conf输入指令
例如:
vi /etc/httpd/conf.d/myhosts.conf
<VirtualHost *:80>
ServerName yangtzeu.simpleoj.cn
ServerAlias yangtzeu.simpleoj.cn www.yangtzeu.simpleoj.cn
DocumentRoot /var/www/html/yangtzeu
DirectoryIndex index.html index.php
</VirtualHost>
<VirtualHost *:80>
ServerName simpleoj.cn
ServerAlias simpleoj.cn www.simpleoj.cn
DocumentRoot /var/www/html
DirectoryIndex index.html index.php
</VirtualHost>