I am having some difficulty getting web serving to work in a manner similar to what I had configured under earlier versions of MacOS X. I note that Apache2 is now the default, and so I applied the following changes, in this order.
1. The contents of the ~/Sites folder were still intact, so simply starting web sharing and pressing the link on the preferences pane for my local site (http://172.16.1.200/~krallen/ worked, and displayed my default site.
Attempting to enter the name of my previously configured test site (d2.test) failed with an appropriate error message.
2. After stopping web serving, I edited /private/etc/hosts to add the following line:
3. I edited /private/etc/apache2/httpd.conf to make the following changes:
3a. Uncommented the load module command for PHP 5
3b. Uncommented the load module command for fast CGI
3c. Edited the ServerAdmin line to define my email address.
3d. Edited the Directory block to change the last line to Allow from all
4. Started web serving again with exactly the same results: could see my home page but not the alternate page). Stopped the server once more.
5. Edited the /private/etc/apache2/httpd.conf file to uncomment the Include /private/etc/apache2/extra/httpd-vhosts.conf line.
6. Edited the /private/etc/apache2/extra/httpd-vhosts.conf file to add this section to the end:
7. Restarted the web server: now my default web site may or may not load (often it gives me the error message that the server 172.16.1.200 could not be reached/found!) and the "d2.test" site displays a page, but it is the Test Page for Apache Installation page and not the page for my alternate site: /Users/krallen/Sites/D2TestSite.
8. If I put a link on my personal web site home page to (./D2TestSite/index.php), when I press that link I get this error:
Can anyone tell me what I am missing here to permit this to work as it did before? Why does my personal web site often fail with the same error as above (but only if the include for the [nhttpd-vhosts.conf[/b] file is uncommented)? Why does the URL d2.test not display the proper page?
1. The contents of the ~/Sites folder were still intact, so simply starting web sharing and pressing the link on the preferences pane for my local site (http://172.16.1.200/~krallen/ worked, and displayed my default site.
Attempting to enter the name of my previously configured test site (d2.test) failed with an appropriate error message.
2. After stopping web serving, I edited /private/etc/hosts to add the following line:
Code:
127.0.0.1 d2.test
3. I edited /private/etc/apache2/httpd.conf to make the following changes:
3a. Uncommented the load module command for PHP 5
3b. Uncommented the load module command for fast CGI
3c. Edited the ServerAdmin line to define my email address.
3d. Edited the Directory block to change the last line to Allow from all
4. Started web serving again with exactly the same results: could see my home page but not the alternate page). Stopped the server once more.
5. Edited the /private/etc/apache2/httpd.conf file to uncomment the Include /private/etc/apache2/extra/httpd-vhosts.conf line.
6. Edited the /private/etc/apache2/extra/httpd-vhosts.conf file to add this section to the end:
Code:
<VirtualHost *:80>
ServerAdmin my_email_address
DocumentRoot /Users/krallen/Sites/D2TestSite
ServerName d2.test
ErrorLog /Users/krallen/Sites/D2TestSite.log
<Directory /Users/krallen/Sites/D2TestSite>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
7. Restarted the web server: now my default web site may or may not load (often it gives me the error message that the server 172.16.1.200 could not be reached/found!) and the "d2.test" site displays a page, but it is the Test Page for Apache Installation page and not the page for my alternate site: /Users/krallen/Sites/D2TestSite.
8. If I put a link on my personal web site home page to (./D2TestSite/index.php), when I press that link I get this error:
Code:
Safari cant connect to the server.
Safari cant open the page http://172.16.1.200/~krallen/D2TestSite/index.php because it could not connect to the server 172.16.1.200.
Can anyone tell me what I am missing here to permit this to work as it did before? Why does my personal web site often fail with the same error as above (but only if the include for the [nhttpd-vhosts.conf[/b] file is uncommented)? Why does the URL d2.test not display the proper page?