mac自带的Apache安装目录 /etc/apache2/

(/etc 实际是指向 /private/etc )

配置文件: /private/etc/apache2/httpd-conf

修改默认端口httpd.conf下面,找到 Listen 80

修改web根目录 httpd.conf下面 DocumentRoot “……”

 

虚拟主机

首先将httpd.conf下的 Include /private/etc/apache2/extra/httpd-vhosts.conf,这一行前面的#去掉

然后在 /private/etc/apache2/extra/httpd-vhosts.conf 文件中添加:

<VirtualHost *:80>
    DocumentRoot "/path/to/your/webroot/"
    ServerName  www.example
</VirtualHost> 

重启apache:

sudo apachectl restart

关闭apache:

sudo apachectl stop

开启apache:

sudo apachectl start

 

实际apachectl 指向的是/usr/sbin/apachectl

 

查看当前版本

 

 httpd -v

 

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2021-08-03
  • 2021-12-06
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案