1、通过ftp感觉进入/etc/httpd/conf这个文件夹目录

2、修改httpd.conf配置文件

3、在文件最后面添加以下代码就行,
<VirtualHost *:80>这个表示指定的ip、端口
DocumentRoot “/var/www/html”这是网站放的目录,DocumentRoot后面有空格
ServerName 你的域名 这是需要绑定的域名,ServerName后面有空格
ServerAlias 绑定的别名,这个可以不写
<Directory “/var/www/html”>

Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
这一段是指的禁止目录浏览,就是不能查看具体网页错误,其实加上也不错,我就写上了。

ErrorLog “/var/log/httpd/zzxz-error.log” 错误日志
CustomLog “/var/log/httpd/zzxz.log” 日志格式
这段是指的网站运行日志,可以无视,也可以写。

</VirtualHost>
如果需要绑定多个域名,直接在后面增加就行。反正别忘了 这句。
多个网站的,就把网站目录的路径修改下。这段仅仅是针对配置域名的,也可以自行加别的,比如日志等。
完整代码:
<VirtualHost *:80>
DocumentRoot “/var/www/html”
ServerName cnnanny.com
ServerAlias cnnanny.com
<Directory “/var/www/html”>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
ErrorLog “/var/log/httpd/cnn-error.log”
CustomLog “/var/log/httpd/cnn.log”

</VirtualHost>