Where is "hosts" file for apache https?

Ryan Schmidt ryandesign at macports.org
Wed Feb 27 17:41:45 PST 2013


On Feb 27, 2013, at 19:25, Murray Eisenberg wrote:

> Do I correctly understand how to get virtual hosts to work with apache2 from macports?
> 
>  (1) In httpd.conf, uncomment "#Include conf/extra/httpd-vhosts.conf".
> 
>  (2) Edit file /opt/local/apache2/conf/extra/httpd-vhosts.conf so as to set the name and DocumentRoot for each VirualHost (and create the corresponding folder target for each DocumentRoot). 
> 
>  (3) Edit file /etc/hosts to include each virtual host. Specifically, if all the virtual hosts are going to be strictly for local use, add to /etc/hosts entries of the form:
> 
> 
>      127.0.0.1    virtual-hot-name

Sure, sounds fine.


> I ask this because docs I've come across for configuring macport's apache2 port, e.g.,
> 
>  http://muddledramblings.com/rumblings-from-the-secret-labs/lamp-server-from-scratch-with-macports/
> 
> don't mention setp (3).

That's a very long article so I just skimmed it (but it seems to be quite good, and better written and more up-to-date than the MAMP tutorial in our wiki) but I suspect the reason why they didn't mention step 3 is because they assume you're setting up a production server, one where the hostnames you're using are already in a public or private DNS server; adding hostnames to /etc/hosts is only needed if you don't have the names in DNS, such as when you're just testing something, or when setting up a local development server that only you will use.



More information about the macports-users mailing list