Mac项目部署步骤

  • 在Finder按花键+shift+G,在出现的对话框中输入/private
  • 就可以打开private这个文件夹了

一 httpd.conf的设置

  • 1: httpd.conf更改根路径为我们喜欢的路径/private/apache2/httpd.conf * * * #DocumentRoot "/Library/webServer/Documents" * # * DocumentRoot "/Users/willli/Sites" *
  • 2: httpd.conf // 配置允许.htaccess
  • 全部 AllowOverride none 改成 AllowOverride all

  • 3:httpd.conf开启了虚拟端口httpd-vhosts /private/apache2/httpd.conf

    • # Include /private/etc/apache2/extra/httpd-vhosts.conf
    • #LoadModule ssl_module modules/mod_ssl.so
    • #LoadModule rewrite_module modules/mod_rewrite.so
    • LoadModule php7_module libexec/apache2/libphp7.so 或libphp5.so

    • 把 Include,#LoadModule 之前的“#”去掉(也就是解除了这一行的注释~)

    • 这样我们便开启了虚拟端口。我们刚刚设置好的这样那样
    • ServerSignature On => ServerSignature Off // 配置错误页不显示Apache版本
    • Options Indexes FollowSymLinks => Options FollowSymLinks // 配置Apache不能通过目录层级进行文件访问
    • DirectoryIndex index.html => DirectoryIndex index.html index.php // 配置Apache支持.php文件解析
      二 以后每添加一个站点执行以下操作
  • 1: hosts /private/etc/hosts * * * 127.0.0.1 www.owen.com

  • 2: httpd-vhosts.conf /private/etc/apache2/extra/httpd-vhosts.conf

    ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "/Users/owenproject/cmit kaijiangserver/public" ServerName www.owen.com ServerAlias ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error log" CustomLog "/private/var/log/apache2/dummy-host2.example.com-accesslog" common Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted

  • 3: 重启apache

  • sudo apachectl restart
  • Buy me a cup of coffee :)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值