Help setting up virtual hosts.

You can ask general questions about MAMP here.

Moderator: severin

Postby chazilla » Sun Jan 15, 2006 4:55 pm

Aha, Now I'm getting the hang of this. I'm obviously an OS X newbie. I think I'm gonna like this.

Thanks for the pointing me in the right direction.
chazilla
 
Posts: 2
Joined: Sat Jan 14, 2006 3:12 pm

Postby bugsmi0 » Wed Mar 08, 2006 3:46 pm

using NetInfo is the way to go, stay away from files if you can help it, Netinfo is easy just click on machines duplicate localhost rename it and add it to your virtual host in apache

easy 1,2,3 no wonder its called stupid simple :shock:
bugsmi0
 
Posts: 35
Joined: Wed Mar 08, 2006 2:47 pm

Postby bugsmi0 » Wed Mar 08, 2006 5:02 pm

anyway to set it up so we don't need to include test:8888 ? ?

why not just http://www.test.dev/
bugsmi0
 
Posts: 35
Joined: Wed Mar 08, 2006 2:47 pm

local hosting....

Postby Wimy » Wed Aug 16, 2006 3:55 am

--
Wimy
 
Posts: 2
Joined: Wed Aug 16, 2006 3:16 am

Postby bugsmi0 » Mon Aug 28, 2006 5:37 pm

virual host on MAMP definately is not as easy to set up like it is on mac osx, would like to see this fixed in newer releases

btw - why do people use quotes around document root "/document/root" there are usually no quotes in the mac osx http.conf
bugsmi0
 
Posts: 35
Joined: Wed Mar 08, 2006 2:47 pm

Ref: virtual host and multiple wordpress blogs in developmen

Postby patriciamartin » Sun Nov 12, 2006 7:52 pm

Hi,
After succesfully developed one blog through MAMP, I followed all the steps to set up virtual hosts in order to develop anotehr two. My doubt is that no matter whether I set my browser to point to localhost, localhost2 or localhost3 it always goes to the opening page of my old blog which is (theoretically in localhost and hotdocs)

Is it supposed to be like that and should I justo go on and re-install Wordpress in the other hotdocs2 and hotdocs3 no matter how or I am doing something wrong?

My other concern is that I can see the folder Wordpress (the first blog installation) when I point to http://localhost2:8888 and localhost3:8888. Should I erase it before re-installing Wordpress in each of them?

thanks

PAtricia
patriciamartin
 
Posts: 1
Joined: Sun Nov 12, 2006 7:38 pm

Postby nhall » Sun Mar 25, 2007 5:20 am

Holger Meyer wrote:
You can access the hosts now with:

http://localhost:8888
http://localhost2:8888
http://localhost3:8888


How would you access the separate hosts from a remote machine? Right now to access the main hosts I would type in the IP address of my machine and the port number... ie http://192.168.1.100:8888/

How would you target one of the other virtual hosts that you set up?

Thanks

Nick
nhall
 
Posts: 2
Joined: Sun Mar 25, 2007 5:16 am

Apache down, Apache down.....

Postby martincreative » Tue Aug 14, 2007 8:35 pm

I followed all the steps with the whole virtual host thing. When I changed my httpd.conf - my apache serve ceased launching. Why is this?
martincreative
 
Posts: 2
Joined: Tue Aug 14, 2007 8:30 pm

Re: Apache down, Apache down.....

Postby martincreative » Tue Aug 14, 2007 9:00 pm

martincreative wrote:I followed all the steps with the whole virtual host thing. When I changed my httpd.conf - my apache serve ceased launching. Why is this?


I solved my own issue. There is a very important space between the "VirtualHost" and the "*"
martincreative
 
Posts: 2
Joined: Tue Aug 14, 2007 8:30 pm

Re: Help setting up virtual hosts.

Postby crowden » Thu Jul 17, 2008 10:48 pm

Hi,

I'm having troubles with this.

The virtual host I'm trying to make is javascript.dev

so, in my hosts file:

Code: Select all
127.0.0.1       localhost javascript.dev


In my httpd.conf file:
Code: Select all
NameVirtualHost *

<VirtualHost *.80>
   DocumentRoot "/Applications/MAMP/htdocs"
   ServerName localhost
</VirtualHost>

<VirtualHost *80>
   DocumentRoot "/Applications/MAMP/htdocs/javascript"
   ServerName javascript.dev
</VirtualHost>


I've set up MAMP to run off port 80 and disabled Web Sharing in my Mac preferences. When I enter javascript.dev in the address bar, I'm taken to the Mac OS X Personal Web Sharing page (the one with the big blue X with "Your Website Here" right underneath it.

When I type in localhost, I'm taken to a file directory page that has no files. (as when you don't put an index.html file in a web directory) But this is in Safari. In Firefox, it takes me to a default Apache page that says:

Seeing this instead of the website you expected?

This page is here because the site administrator has changed the configuration of this web server. Please contact the person responsible for maintaining this server with questions. The Apache Software Foundation, which wrote the web server software this site administrator is using, has nothing to do with maintaining this site and cannot help resolve configuration issues.


Sorry, I'm a noob at this server stuff. Could someone please help me out?

Thanks!
crowden
 
Posts: 4
Joined: Thu Jul 17, 2008 10:35 pm

Re: Help setting up virtual hosts.

Postby crowden » Thu Jul 17, 2008 10:51 pm

Ah, saw that dot in the localhost config...took it out and now localhost and javascript.dev go to the same place - The Mac OS X Personal Web Sharing page.
:?
crowden
 
Posts: 4
Joined: Thu Jul 17, 2008 10:35 pm

Re: Help setting up virtual hosts.

Postby leemarquis » Wed Jan 21, 2009 9:37 pm

Can someone help me with my settings? I cant get virtual hosts to work properly.

In MAMP I have:

APACHE PORT: 80
MYSQL PORT: 3306

and Document Root is:
/Users/Lee/Sites

My hosts file is:
Code: Select all
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost beautybytara.local
255.255.255.255   broadcasthost
::1             localhost



My httpd.conf file ends with:

Code: Select all
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#

NameVirtualHost *

<VirtualHost *>
   DocumentRoot /Users/Lee/Sites
   ServerName localhost
</VirtualHost>

<VirtualHost *>
   DocumentRoot /Users/Lee/Sites/beautybytara
   ServerName beautybytara.local
</VirtualHost>
   


In my Sites folder I have a folder named beautybytara in which all the site files exist.

After restarting MAMP and pointing my browser to : http://beautybytara.local
I just get the Test page for apache Installation page - even though there is an index file in the folder. If I type http://beautybytara.local/index.html I still get the same page.

If I go to http://localhost then I get a test index page load up that I placed in the Sites directory.

What am I doing wrong? I want each folder in the Sites directory to act as its own document root.

Thanks
leemarquis
 
Posts: 1
Joined: Wed Jan 21, 2009 9:27 pm

Re: Help setting up virtual hosts.

Postby crowden » Wed Jan 28, 2009 5:50 pm

Nothing?

I'm back at it trying to get these named virtual hosts to work.

Here's my hosts file:

Code: Select all
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255   broadcasthost
127.0.0.1   test.dev


The end of my http.conf file:
NameVirtualHost *

Code: Select all
<VirtualHost *80>
   DocumentRoot /Applications/MAMP/htdocs
   ServerName localhost
</VirtualHost>

<VirtualHost *80>
   DocumentRoot /Users/clintonia/Sites/test
   ServerName test.dev
</VirtualHost>


I have my ports set to the default Apache and MySQL ports, since I'm not running OSX's web service. (80, 3306).

I've placed a php script in the test folder called test.php.

When I try to access http://test.dev/test.php, it says the page cannot be found. However, if I go to http://test.dev/test/test.php, I see the script working.

Could someone please help make sense of this? Thanks
crowden
 
Posts: 4
Joined: Thu Jul 17, 2008 10:35 pm

Re: Help setting up virtual hosts.

Postby crowden » Wed Jan 28, 2009 5:58 pm

fixed...
Changed the code in httpd.conf so that the name is in the VirtualHost tag.

Code: Select all
<VirtualHost test.dev>
   ServerName test.dev
   DocumentRoot "/Users/clintonia/Sites/test"
</VirtualHost>
crowden
 
Posts: 4
Joined: Thu Jul 17, 2008 10:35 pm

Re:

Postby wasabi » Thu Mar 12, 2009 9:24 pm

Followed all the instructions, but the attempts at accessing the virtual hosts simply times out.

http://localhost:8888
The virtual host was set up successfully.
If you can see this page, your new virtual host was set up successfully. Now, web contents can be added and this placeholder page1 should be replaced or deleted.


http://localhost2:8888
http://localhost3:8888 "The server at localhost2 is taking too long to respond."

MAMP Pro 1.7.2 "There is a tab HOST"
MAC OS 10.5.6
wasabi
 
Posts: 2
Joined: Wed Mar 04, 2009 11:42 pm

Previous

Return to General questions

Who is online

Users browsing this forum: No registered users and 7 guests