apache 2.4: some virtual hosts OK, others load default apache index.html - TYPOS FIXED

Marius Schamschula lists at schamschula.com
Tue Oct 24 20:35:39 UTC 2017


Murray,

The only thing that pops out immediately, is the allow, deny code. Apache 2.4.x uses

Require all granted

instead of

Order allow, deny
Allow from all

See https://httpd.apache.org/docs/2.4/upgrading.html <https://httpd.apache.org/docs/2.4/upgrading.html>

> On Oct 24, 2017, at 3:09 PM, Murray Eisenberg <murrayeisenberg at gmail.com <mailto:murrayeisenberg at gmail.com>> wrote:
> 
> Just a couple of typos in my original message fixed below.
> 
>> On 24 Oct2017, at 4:07 PM, Murray Eisenberg <murrayeisenberg at gmail.com <mailto:murrayeisenberg at gmail.com>> wrote:
>> 
>> In apache 2.4 I have several virtual hosts configured  — properly, I believe — in /opt/local/etc/apache2/extra/httpd-vhosts.conf.
>> 
>> One of the virtual hosts works just fine, but others do not.
>> 
>> ** This one works ** 
>> 
>> For example, once apache is running, in the browser I CAN load “myhomepage.local” thanks to this part of httpd-vhosts.conf:
>> 
>>  <VirtualHost *:80>
>>      ServerAdmin somebody at somewhere.com <mailto:somebody at somewhere.com>
>>      DocumentRoot "/Users/me/Sites/MyHomePage"
>>      ServerName MyHomePage.local
>>      ServerAlias www.MyHomePage.local <http://www.myhomepage.local/>
>>      ErrorLog  "var/log/apache2/me-MyHomePageerror_log"
>>      CustomLog "var/log/apache2/me-MyHomePage-access_log" common
>>      <Directory /Users/me/Sites/MyHomePage>
>>         Options Indexes FollowSymLinks
>>         Order allow,deny
>>         Allow from all
>>     </Directory>
>>  </VirtualHost>
>> 
>> ** This one does NOT work **
>> 
>> However, if I try to load me-htdocs.local in the browser, using this part of httpd-vhosts.conf …
>> 
>>  <VirtualHost *:80>
>>      ServerAdmin somebody at somewherel.com <mailto:somebody at somewherel.com>
>>      DocumentRoot "/Users/me/Sites/htdocs"
>>      ServerName me-htdocs.local
>>      ServerAlias www.me-htdocs.local <http://www.me-htdocs.local/>
>>      ErrorLog  "var/log/apache2/me-htdocs-error_log"
>>      CustomLog "var/log/apache2/me-htdocs-access_log" common
>>      <Directory /Users/me/Sites/htdocs>
>>         Options Indexes FollowSymLinks
>>         Order allow,deny
>>         Allow from all
>>     </Directory>
>>  </VirtualHost>
>> 
>> … then this DOES NOT work: I get the default apache2 “It works!” page even though the DocumentRoot /Users/me/Sites/htdocs's
>> index.html file is quite different (e.g., it begins with a head having my name in it).
>> 
>> Moreover, I get that same default apache2 “It works!” page if I try to load
>> murray-htdocs.local/index.php then I once again get the default apache “It works!” page rather than having the .php file executed [which among other things invokes phpinfo() ]
>> 
>> ** PHP seems OK **
>> 
>> It’s NOT a question of the PHP configuration, because if I put a copy of that index.php page into 
>> /opt/local/www/apache2/html, then loading localhost/index.php DOES work. 
>> So again, this seems to be an issue with the virtual hosts configuration.
>> 
>> 
>> Any ideas what could be wrong?
> 
> ---
> Murray Eisenberg			murrayeisenberg at gmail.com <mailto:murrayeisenberg at gmail.com>
> 503 King Farm Blvd #101	Home (240)-246-7240
> Rockville, MD 20850-6667	Mobile (413)-427-5334
> 
> 

Marius
--
Marius Schamschula




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20171024/e1a6a6b5/attachment.html>


More information about the macports-users mailing list