1.安装:yum -y install httpd
查找:whereis httpd
2.启动:service httpd start
在windows地址栏输入ip地址,端口默认80
3.cd /var/www/html
echo "hello apache" > index html
ll
mv index html demo html
4.cd /etc/httpd
pwd
ll
httpd]:ll conf
httpd]:ll conf.d
httpd]:vi /conf/httpd.conf
配置文件:listen :端口:80
document root:站点目录
servername:主机名,域名
directory:配置站点目录参数
directory index:配置站点目录,默认首页
errorlog:错误日志
customlog:访问日志
virtual host:虚拟主机配置节
5.创建目录:mkdir /var/www/baseip1
....................../baseip2
....................../port 81
....................../port 82
......................./school
......................./person
6.conf.d]:vi virtual
base :id
base:port
base:domain
时间: 2024-11-12 14:09:08