赞
踩
目录
# yum -y install httpd # systemctl start httpd # systemctl enable httpd
# systemctl stop firewalld # setenforce 0 或者加入防火墙允许 # firewall-cmd --permanent --add-service=http # firewall-cmd --reload //立即生效 # firewall-cmd --list-all //查看 # mkdir /home/http # echo "welcome to my web" > /home/http/index.html
# vi /etc/httpd/conf/httpd.conf 注:可以去除注释行再修改 mv /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak grep -v “#” /etc/httpd/conf/httpd.conf.bak > /etc/httpd/conf/httpd.conf 修改以下内容: ServerName www.lql.com:80 DocumentRoot "/home/http" <Directory "/var/www/html"> 修改成 <Directory "/home/http">
附:主配置文件比较常用参数,按需添加
ServerRoot xx 服务目录 ServerAdmin xx 管理员邮箱 User xx 运行服务的用户 Group xxx 运行服务的用户组 ServerName xx 网站服务器的域名 DocumentRoot xx 文档根目录(网站数据目录) Directory xx 网站数据目录的权限 Listen xx 监听的IP地址和端口号 DirectoryIndex xx 默认的索引页页面 ErrorLog xx 错误日志文件CustomLog
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。