16°

项目部署步骤

一 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
  • 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         

本文由【owenzhang24】发布于开源中国,原文链接:https://my.oschina.net/owenzhang24/blog/3136495

全部评论: 0

    我有话说: