Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been trying for some time now to set up a virtual host for the new Intranet we are putting in at my organization. It is on a separate server from the one running our website. I have set up the Intranet using MAMP and Joomla on a Mac OSX 10.5.8 machine.

I have followed several tutorials and solutions including Virtual Host X but nothing seems to work.

I am able to get the virtual host to work on the local machine but nothing outside of that.

Here is an example of my hosts file.

##
# 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
127.0.0.1           staff.mysite.org
255.255.255.255 broadcasthost
::1                 localhost 
fe80::1%lo0         localhost

The end of my httpd.conf file looks like this. There are two includes. The first was my original attempt to set up a virtual host. The second created by Virtual Host X

NameVirtualHost *:80

Include /Applications/MAMP/conf/apache/vhosts.conf

Include /private/etc/apache2/extra/httpd-vhosts.conf

Here is my vhosts.conf file.

<VirtualHost *:80>
ServerName staff.mysite.org
DocumentRoot /Applications/MAMP/htdocs/joomla/
DirectoryIndex index.php index.html index.cgi
<Directory /Applications/MAMP/htdocs/joomla/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Here is the httpd-vhosts.conf file.

NameVirtualHost *:80
Listen 9000

<Directory "/Applications/MAMP/htdocs/joomla/">
Allow From All
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName "staff.mysite.org"
ServerAlias "www.staff.mysite.org"
DocumentRoot "/Applications/MAMP/htdocs/joomla"
</VirtualHost>

<VirtualHost *:9000>
DocumentRoot "/Applications/MAMP/htdocs/joomla"
</VirtualHost>

I read on the Joomla support site that you have to make a change to the $mosConfig_live_site variable in the configuration.php file, but when I make the suggested change it still does not work and I can no longer view the site on the local machine.

Is there something I am missing here?

Please help if you can. Thanks!

share|improve this question

migrated from stackoverflow.com Feb 28 '11 at 19:23

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 0 down vote accepted

your missing some DNS configuration

you need to have a dns record that will translate staff.mysite.org into the IP address of your server, if you are running internal dns then this is no problem, and it totally depends on your local dns configuration, 2 examples:

if your running a firewall like pfsense with dns forwarding, you can setup a single dns record that will send staff.mysite.org to the IP of your intranet server

if however you are running standard dns servers like Apple's or Windows DNS then you will have to locally create the zone for the whole domain and replicate the current values found on the internet and then add the staff subdomain with the local IP.

share|improve this answer
    
Thanks for the response. I am using a Mac standard DNS. From the Server Admin program I have a zone of type master called mysite.org and I created a record of type A (Address) from "staff" to the ip of the intranet server. Is there anything that I need to do in addition to this? –  NickPatt Feb 28 '11 at 16:36
    
you will need to make sure your network sets your mac server as the dns server and that it is also configured to perform recursive (forward) lookups for the lan, also make sure any other records for that zone are also included in your local setup, otherwise your main website will stop working inside the network (and emails etc) –  anthonysomerset Feb 28 '11 at 17:23
    
After looking at my DNS I now have the virtual host working properly inside my network. However, I still cant connect from outside. I have everything set up internally on my DNS machine including other working virtual hosts. Some work both internally and externally but I have noticed a couple now including staff which only work internally. What is different on the machines that are working outside the network? Any help would be greatly appreciated. –  NickPatt Feb 28 '11 at 23:01
    
then you will need to port forward from your router to the internal IP, also external dns will need to use the public IP of your internet connection rather than the internal IP –  anthonysomerset Mar 1 '11 at 8:09
    
That is where I am running into issues. I have I Sonicwall router with a built in firewall. I have followed these instructions on the Sonicwall site to make my servers public. fuzeqna.com/sonicwallkb/consumer/kbdetail.asp?kbid=7027 I went back and checked that the settings are the same as other servers that are public and working properly and they are. but when I test the intranet server it is still not reaching outside the network. I may need to contact Sonicwall, but if anyone has any ideas please let me know. Thanks! –  NickPatt Mar 1 '11 at 16:10
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.