项目部署步骤

编程

一 httpd.conf的设置

  • 1: httpd.conf更改根路径为我们喜欢的路径/private/apache2/httpd.conf

        • #DocumentRoot "/Library/webServer/Documents"
        • #<Directory “/Library/webServer/Documents">
        • DocumentRoot "/Users/willli/Sites"
        • <Directory "/Users/willli/Sites">
  • 2:httpd.conf开启了虚拟端口httpd-vhosts /private/apache2/httpd.conf

        • # Virtual hosts
        • # Include /private/etc/apache2/extra/httpd-vhosts.conf
        • 把 Include 之前的“#”去掉(也就是解除了这一行的注释~)
        • 这样我们便开启了虚拟端口。我们刚刚设置好的这样那样

二 以后每添加一个站点执行以下操作   

  • 1: hosts   /private/etc/hosts

        • 127.0.0.1 www.owen.com
  • 2: httpd-vhosts.conf   /private/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.example.com

    DocumentRoot "/Users/owenzhang/owenproject/owen"

    ServerName www.owen.com

    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"

    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common

    <Directory "/Users/owenzhang/owenproject/owen">

            Options Indexes FollowSymLinks MultiViews

            AllowOverride All

            Require all granted

    </Directory>

</VirtualHost>

 

  • 3: 重启apache   sudo apachectl restart         

以上是 项目部署步骤 的全部内容, 来源链接: utcz.com/z/511399.html

回到顶部