vim /etc/httpd/conf/httpd.conf //编辑主配置文件 ServerRoot “/etc/httpd” //设置Apache的主目录 Timeout 120 //设置请求超时 Listen 80 //设置监听端口 ServerAdmin root@linuxidc.com //设置管理员邮箱 ServerName 192.168.0.3:80 //设置主机或IP DocumentRoot “/var/www/html” //设置Apache文档目录 DirectoryIndex index.html //设置主页文件 AddDefaultCharset GB2312 //设置网站编码 编辑主页文件用作测试: cd /var/www/html echo “This is web test sample.”>>index.html chmod 705 index.html 重新加载服务: service httpd restar <参考>