NameVirtualHost Problem

Joined
Apr 20, 2007
Messages
91
Reaction score
0
Points
6
Location
Temple, GA
So I've done it over and over and tried to setup the two domains I want to host on my IP address. From what I've read I've done it correctly by going to the httpd-vhosts file and adding the two virtual host, but they still won't point to the domains when I type them in the browser. They are:
Index of / &
Index of /
I have no idea why when I type these in they go to the root folder where I have to actually click them to go to the site. I've done all this over and over and read the apache documentation to do it, but I'm at a stand still. I'd greatly appreciate any help.
Thanks.

justinlbannister.com & deltacapstone.com
They are going to the index files above for some reason.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,770
Reaction score
2,108
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Show us your Apache configuration..

Regards
 
Joined
Feb 26, 2009
Messages
20
Reaction score
1
Points
3
Keep all sites in one folder:
/Username/Sites

Then edit your http-vhost and host files to all point in one location:

Example http-vhost file (/private/etc/apache2/extra/httpd-vhosts.conf) entry:
Code:
#SomeSite.com 
<VirtualHost *:80> 
    DocumentRoot "/Users/yourUserName/Sites/somesite" 
    ServerName somesite.dev 
</VirtualHost>

#AnotherSite.com 
<VirtualHost *:80> 
    DocumentRoot "/Users/yourUserName/Sites/anotheresite" 
    ServerName anothersite.dev 
</VirtualHost>

Example host file (/private/etc/hosts) entry:
Code:
127.0.0.1 somesite.dev
127.0.0.1 anothersite.dev
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top