1.vim /etc/hosts
添加一行
*.*.*.* ghoiufyia.com
保存
*.*.*.* 是你的服务器地址
同时域名解析也要正确
添加子域名的话,要将子域名解析成cname,hosts添加
*.*.*.* test.ghoiufyia.com
2./etc/httpd/conf.d/添加一个配置文件ghoiufyia.conf,填充
<VirtualHost *:80>
ServerName ghoiufyia.com
DocumentRoot "/www/ghoiufyia"
SetEnv APPLICATION_ENV "development"
<Directory "/www/ghoiufyia">
DirectoryIndex index.php
AllowOverride All
Allow from All
Require local
</Directory>
</VirtualHost>
3.我将根目录建在了/wwwghoiufyia,我新建了index.php文件,添加
<?php echo “你好,世界”;
system("ls");
?>
4.浏览器访问