A second virtual host is deaf
Apache 2 and Tomcat 4.0 work together here on an NT as long as httpd.conf sees the Tomcat contexts denoted as a virtual host with the same name as the host : "host1".
So, I am trying now to use a second virtual host "host2" on my machine "host1".
I can still reach the contexts on host1 with http://host1/things
but should this also work? : http://host2/otherthings
must I give my system 2 (two) ip addresses in order to have a second virtual host? Seems strange.
yes and the link you posted before does actually mention this fairly important issue
Of course, you can't just make up names and place them in ServerName or ServerAlias. You must first have your DNS server properly configured to map those names to an IP address associated with your server.i suspect that is you want to test on win network if you don't want to mess about with dns you might be able to do some bejiggery in the LMHOSTS file that would have the same effect.
if you want to just test virtual hosts in general. one thing that also might work is using machine name(s) as well as the ip's
for example if the machine is called host1 and has an address of 192.168.100.10 then i think you could set up three sites.
the "real" (default) site.
192.168.100.10
127.0.0.1
virtual host 1
host1
virtual host 2
localhost
i think these would work although the last one would only work from the server itself. see virtual hosting uses the host header passed in HTTP so as long as you can have different ones that end up going to the same place you can invent some virtual hosts for testing.
Similar Messages
-
2nd virtual host, and external Internet site
The first virtual host is setup for our internal users.
The plan is to setup a second virtual host for an external internet portal for customers.
Do I need a second SSL certificate, and second wallet ?
Should this run another IP and therefore need another NIC card in the application server host?You can use Virtual Hosts in SAP systems to deliver a specific set of ICF services. In the same host:port running the WAS you can have multiple virtual hosts each delivering a set of ICF services.
Check this documentation
http://help.sap.com/saphelp_nw04/helpdata/en/85/5c543aa24b511ce10000000a11402f/frameset.htm
You use external aliases to give meaningful name for the running services. The external alias can be used to access the service.
Check this documentation
http://help.sap.com/saphelp_nw04/helpdata/en/78/9852bdc06b11d4ad310000e83539c3/content.htm
Hope this helps.
Thanks and Regards,
Prasanna Krishnamurthy -
How to configure multiple virtual hosts for the same context root /
Hi,
I am using Glassfish V1 U1 - b14 on Solaris.
I am trying to configure two applications to be mapped to the / root context, each one in its own virtual host.
Two things I have noticed:
1. I have to manually add virtual-hosts="hostId" in domain.xml/application-ref ... looks like just simply deploying the app does not do that although the application is set as default for its particular virtual host. Is this a bug?
2. Although I have set for each virtual host the default web-app correctly, and they both respond fine, I cannot map both of them to the / context. The second application (chronologically deployed) does not respond when called with the / context ....
Any ideas? Is this a bug again?
Regards,
Rares
Message was edited by:
rarespWow, that's a shame. All mighty Application Server and two different apps on two different virtual hosts are considered ambiguous to have the same context root definition.... Fair play to Tomcat and 90% of the rest of servlet containers!
In my case I have the same EAR we are planning to deploy to many (up to 30) virtual hosts. Faking different context roots for each deployment will bring unnecessary overheads...
Should I file a bug or feature request?
Thanks again for your answer, although you're basically saying it is not possible I will wait and look a while for a possible solution before bringing this topic to a conclusion. -
How to confiture virtual hosts with multiple domain names
hello,
I've read through some of the postings here on virtual hosts, but I thought I'd better solicit advice before I actually try some of the things I've read about.
In a nutshell, I've purchased multiple domain names that I'd like to alias to a new site (currently it is just a subfolder in the main site directory) on my OS 10.3.x server. There is only the one main site configured right now on the box, so I know I need to set up a second "virtual site" pointing to the files in this subfolder to make it function as its own site.
I've dabbled around with the sites settings in the GUI, but I'd probably be most comfortable setting all this up in the httpd.conf by hand if I could. But I'm weary of this because I know it might be better to use the GUI because of OS X Server's flavor of WebObjects and Apache (sigh).
So, I have two main questions:
1) How would I set up this second site using the GUI in server settings? Do I need to first move the subfolder out of the main folder before it can be designated its own site? Or can I just point to it in the GUI? Can I use one of my purchased domain names in the domain field?
2) Currently, I have URL Forwarding set with my multiple domain names, but I'm thinking there might be a better way to do this? For SEO I'd rather use some type of redirect rather than being penalized by search engines for having what looks to be multiple domains pointing to the same site.I'm thinking I should create virtual sites for each domain name I've purchased with a hard redirect back to the main site?
Any suggestions would be appreciated.
Thanks
G4 Mac OS X (10.3.9) 10.3.9 Server
G4 Mac OS X (10.3.9) 10.3.9 Serverthank you for your reply.
> You can create each site as a new Site in Server
Admin. When you do this you can choose any
directory on disk as the document root for each
site.This means you can move the sites' folders out of
/Library/WebServer/Documents if you like - you could
create /Library/WebServer/site1,
/Library/WebServer/site2, etc. (or even be outside of
/Library/WebServer if you want).
so, are you are saying that I could designate one site to be
/Library/WebServer/Documents/site1
and another to be
/Library/WebServer/Documents/site1/directory1
even though directory1 is contained within site1's structure? I'm not advancing this as a good idea, necessarily. I'm just wondering if Apache would complain.
> Each site should have the domain name set as per your
registered domains. Apache will need this to
determine the correct site to serve for each
request.
Well, after some additional research I'm thinking I'm missing a critical piece of the puzzle. That being access to the DNS host server that manages the context of my server. I have purchased domain names through an outside registrar that point to my site and I can create virtual hosts on my server, but I don't have the ability to add the new virtual host names into the DNS server that manages my box. If that makes sense. Or maybe I'm missing something?
>
I'm not sure why you're using URL forwarding at all.
Without that piece of information it's impossible to
tell you whether you should continue using them or
not - in general there's no need to use URL
forwarding if you have multiple Virtual Hosts setup,
but it sounds like you have multiple hostnames
pointing to the same content, so your needs may be
different.
I'm using forwarding for the reason I list above. I didn't purchase hosting with the registrar where I purchased my domain names, so they are parked on the registrar's name server with URL forwarding to my server. The DNS server that manages my box resides in a different location and I don't have the ability to add DNS entries pointing to virtual hosts that I want to set up. Am I stuck?
G4 Mac OS X (10.3.9) 10.3.9 Server -
Tomcat 4.0.1 & Apache 1.3.22 & mod_webapp & virtual hosts
I have succesfully been able to get tomcat 4.0.1 and apache 1.3.22 to use mod_webapp in both linux and windows.
First problem:
If I don't include a trailing slash, my webapp will not display. Just a 404. mod_dir works on the apache end. Also if I access my context thru tomcat on port 8080, without a trailing slash, it will put one in for me. Only when using mod_webapp, it doesn't seem to work.
So...
http://localhost/examples <--- doesn't work
http://localhost/examples/ <--- works
Second problem:
How can I get virtual hosts working with mod_webapp? I've successfully been using mod_jk for a while now with virtualhosts, but there are no instructions on how to do this with mod_webapp. Has anyone been able to do this? Is it even possible? Is there a way to alias a /webapp to '/' or something?
Any help/suggestions are appreciated,
TomUnfortunately, Tomcat 4.0.1 use the port number 8180 as default. Just after the installation, you need to test it by typing:
http://localhost:8180/
If the index page of Tomcat appears, then you succeed.
On linux platform the webapps directory need to be downloaded for a separate package. For downloads, please visit here:
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.1/rpms/tomcat4-webapps-4.0.1-1.noarch.rpm
Such webapps should be installed in {TOMCAT_HOME}/webapps. After all, just restart the Tomcat server (as I know) and see the results by typing:
http://localhost:8180/
Click on the link to see further examples.
Good luck! -
Should I be able to access virtual host via localhost/site path?
I finally have been able to successfully set up a virtual host on my local host.
I can access http://localhost which redirects me to the http://localhost/xampp page and I can access my local site with http://nif.local/. I thought I had read that I should still be able to access my local nif site via http://localhost/nif.local. Is that correct? If so, what should I check since I get a 404 error via the second way? I just want to make sure everything is set up correctly.
Thank you.Now sorted;-). Can disable Siri in settings for when phone is locked. Why is this not default?
-
Oracle VM 3 - only one virtual host accessible from the network (DELL R410)
Hi,
I have installed Oracle VM 3.0.3 and created the network for Virtual hosts. After installing two systems on the server only one is accessible from the network at a time. The second one is not.
Have no idea how e to enable the second host to reach a network.
Maby You have some idea?
Thanks,
JarekHello!!
I'm not an expert but /OVS/Pool should be the directory naming of OVM 2.x, replaced by /OVS/Repositories/REPOS_ID in OVM 3.x
The "wierd directory name" it's the unique ID that OVM assigns to Repository, infact if you go to VM Manager in Repository tab and edit your current repository you will see this ID: 0004fb0000030000839f2d2faa5014c3
Under "0004fb0000030000839f2d2faa5014c3" folder, as you noticed, there are the classic folders ISO, VirtualDisk, VirtualMachine, etc. where files are placed.
I've never tried to import a pre-packaged template from Oracle but I would try importing it as an assembly from http/ftp! ;)
Hope this helps.
Greets! -
AddNode cannot find Virtual Host name
Hi,all;
I want to replace a server in RAC for example RAC1. at first,I deleted node RAC1,this step is total clean out all information of RAC1 in the cluster.
then prepare new machine of RAC1 for cluster install.
When I run addNode.sh in RAC2 to re-add clusterware to RAC1. the first step of addNode is fill up the information of new node,Public node name,Private node name,Virtual host name.
It will list such info of the remain node also.
In my operation,It can find all info of new node which is rac2,rac2-priv,rac2-vip. but the remain node's Virtual host name is blank -- it shuould be rac1-vip.
In this step,I still click "Next" to proceed my operation and return not any error.
at the end of addNode.sh it will execute 3 script to end out operation of add clusterware to new node.
the third script is to run /opt/oracle/product/10.2.0/crs_1/root.sh in the new node RAC1,
the screen print "*Expecting the CRS daemons to be up within 600 seconds*."
but after waited more than *6000* seconds,it returned nothing to me,It seem idle! I cancle the script manual.the result is the CRS can not run on RAC1.
in RAC2,crs_stat -t can see ora.rac1.gsd , ora.rac1.ons , ora.rac1.vip. but they are all offline.
and run vipca in RAC2 reture
ora.rac1.gsd has placement error
ora.rac1.ons has placement error
has not more detail log file left in server.
I think all of my operation is normal and In line with the rules except it cannot export remain node's Virtual host name.
How to fix it? any ideal?
thank you.[oracle@RAC1 ~]$ cluvfy stage -pre crsinst -n rac1
Performing pre-checks for cluster services setup
Checking node reachability...
Node reachability check passed from node "RAC1".
Checking user equivalence...
User equivalence check passed for user "oracle".
Checking administrative privileges...
User existence check passed for "oracle".
Group existence check passed for "oinstall".
Membership check for user "oracle" in group "oinstall" [as Primary] passed.
Administrative privileges check passed.
Checking node connectivity...
Node connectivity check passed for subnet "192.168.1.0" with node(s) rac1.
Node connectivity check passed for subnet "10.10.10.0" with node(s) rac1.
Suitable interfaces for the private interconnect on subnet "192.168.1.0":
rac1 eth0:192.168.1.100
Suitable interfaces for the private interconnect on subnet "10.10.10.0":
rac1 eth1:10.10.10.1
ERROR:
Could not find a suitable set of interfaces for VIPs.
Node connectivity check failed.
Checking system requirements for 'crs'...
Total memory check passed.
Free disk space check passed.
Swap space check passed.
System architecture check passed.
Kernel version check passed.
Package existence check passed for "binutils-2.15.92.0.2-13".
Group existence check passed for "dba".
Group existence check passed for "oinstall".
User existence check passed for "nobody".
System requirement passed for 'crs'
Pre-check for cluster services setup was unsuccessful on all the nodes. -
Dreamweaver CS5 with PHP, not getting it to work with virtual Host
I have not got far with the book so far. I am still on the second chapter where you set the Virtual Host but after setting up the Dreamweaver site definition and doing the test. I get the error that page cannot be found.
I ask if I can mail the text file of the http.conf and the httpd-vhosts.conf to anyone to see if I screwed up somewhere . I am running on Windows 7 with the WAMP setup.Mr. Powers,
I used your included file httpd-vhosts.conf. And it did something since now I get a new set of errors.
( ! ) Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
( ! ) Fatal error: Unknown: Failed opening required 'C:/vhosts/phpcs5/lesson02/site_check.php' (include_path='.;C:\php\pear') in Unknown on line 0
But I checked the properties of the folders and unchecked the 'read only' permission but still gets checked again. I am using Windows 7 64-bit.
I checked on the web nobody says any solutions about it, they only imply that is a permissions issue.
I apologize, I found out the chapter files were encrypted... thanks -
Virtual Hosts - almost there???
Ok I have read just about every post on here about virtual hosts, and I picked up a copy of "Apache The difinative guide" I still can't figure this thing out. I added the NameVirtualHost line and following at the very end of the file.? Is that where it goes? Like this...
### The following Include directive is essential for the virtual hosts to be usable.
Include "/etc/httpd/sites/*.conf"
NameVirtualHost *
<VirtualHost www.WEB1.com>
ServerName www.WEB1.com
DocumentRoot "STUFF"
</VirtualHost>
<VirtualHost www.WEB2.com>
ServerName www.WEB2.com>
DocumentRoot "STUFF2"
</VirtualHost>
<VirtualHost mail.WEB1.com>
ServerName mail.WEB1.com
DocumentRoot /usr/share/squirrelmail
</VirtualHost>
Does that look right?
I then went into the host conf file and that now looks like this...
# 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
::1 localhost
192.168.111.6 www.WEB1.com
192.168.111.6 www.WEB2.com
192.168.111.6 mail.WEB1.com
think thats right anyway...
In server admin each site has been setup with www.WEB1.com, and www.WEB2.com respectivly under domain name and address is the Server IP and port 80. Under the settings all boxes in options are unchecked i.e. folder listing, performance cache...Under the Aliases tab each page has one listed www.WEB1.com for 1 and www.WEB2.com for the second.
Now you type in a browser www.WEB1.com and you get it. You type in www.WEB2.com and you get nothing.
What am I missing???Ok I have read just about every post on here about
virtual hosts, and I picked up a copy of "Apache The
difinative guide" I still can't figure this thing
out. I added the NameVirtualHost line and following
at the very end of the file.? Is that where it goes?
Like this...
### The following Include directive is essential for
the virtual hosts to be usable.
Include "/etc/httpd/sites/*.conf"
NameVirtualHost *
<VirtualHost www.WEB1.com>
ServerName www.WEB1.com
DocumentRoot "STUFF"
</VirtualHost>
<VirtualHost www.WEB2.com>
ServerName www.WEB2.com>
DocumentRoot "STUFF2"
</VirtualHost>
<VirtualHost mail.WEB1.com>
ServerName mail.WEB1.com
DocumentRoot /usr/share/squirrelmail
</VirtualHost>
Does that look right?
No this does not look right and I'm trying hard not to laugh.
I then went into the host conf file and that now
looks like this...
# 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
::1 localhost
192.168.111.6 www.WEB1.com
192.168.111.6 www.WEB2.com
192.168.111.6 mail.WEB1.com
think thats right anyway...
In server admin each site has been setup with
www.WEB1.com, and www.WEB2.com respectivly under
domain name and address is the Server IP and port 80.
Under the settings all boxes in options are unchecked
i.e. folder listing, performance cache...Under the
Aliases tab each page has one listed www.WEB1.com for
1 and www.WEB2.com for the second.
Now you type in a browser www.WEB1.com and you get
it. You type in www.WEB2.com and you get nothing.
What am I missing???
You can't add them manually and add them in server admin make up your mind which you want. -
Virtual Hosts in Apache HTTP Server
How to configure virtual hosts in Apache HTTP Server httpd.conf file.
If I want to access my server with some other name(alias), how can I do this ?
Suggestions in this matter would be highly helpful.
Thanks
Vidhyut AroraFollowing is a note explaining how to setup
Virtual hosts.
Hope this helps
Ranga
Note:70647.1
Subject: Apache Server Virtual Hosting
Last Revision Date: 07-JUN-2001
PURPOSE
This document discusses considerations for setting up virtual hosts on an
Apache machine, to include how to get the hostname working and how to
configure Apache.
SCOPE & APPLICATION
The information in this document is intended for those who manage multiple sites
using an Apache machine.
REFERENCES
First published in Apache Week issue 31 (6th September 1996)
Last update 20th September 1998
Using Virtual Hosts
Virtual Hosts let you run multiple independent Web sites on a single host with
a single Apache setup.
One of the most important facilities in Apache is its ability to run virtual
hosts. This is now the essential way to run multiple Web services - each with
different host names and URLs - that appear to be completely separate sites.
This is widely used by ISPs, hosting sites and content providers who need to
manage multiple sites but do not want to buy a new machine for each one.
Picking an IP address
There are two types of virtual hosts: IP-based and non-IP-based. The former is
where each virtual host has its own IP address. You must have a new IP address
for each virtual host you want to set up, either from your existing allocation
or by obtaining more from your service provider. When you have extra IP
addresses, you tell your machine to handle them. On some operating systems, you
can give a single ethernet interface multiple addresses (typically with an
fconfig alias command). On other systems, you must have a different
physical interface for each IP address (typically by buying extra ethernet
cards).
IP addresses are a resource that costs money and are increasingly difficult to
get, so modern browsers can now also use 'non-IP' virtual hosts. This
lets you use the same IP address for multiple host names. When the server
receives an incoming Web connection, it does not know the hostname that was used
in the URL. However, the new HTTP/1.1 specification adds a facility where the
browser must tell the server the hostname it is using, on the Host: header. If
an older browser connects to a non-IP virtual host, it does not send the Host:
header, so the server must respond with a list of possible virtual
hosts. Apache provides some help for configuring a site for both old and new
browsers.
Picking a Hostname and Updating the DNS
Having selected an IP address, the next stage is to update the DNS so that
browsers can convert the hostname into the right address. The DNS is the system
that every machine connected to the internet uses to find the IP address of host
names. If your hostname is not in the DNS, no one can connect to
your server (except by the unfriendly IP address).
If the virtual hostname you are going to use is under your existing domain,
you can just add the record into your own DNS server. If the virtual hostname
is in someone else's domain, you must get them to add it to their DNS
server files. In some cases, you want to use a domain not yet used on the
internet, in which case you must apply for the domain name from the
InterNIC and set up the primary and secondary DNS servers for it, before adding
the entry for your virtual host.
In any of these cases, the entry you need to add to the DNS is an address record
(an A record) pointing to the appropriate IP address. For example, say you want
the domain www.my-dom.com to access your host with IP address 10.1.2.3: you
must add the following line to the DNS zone file for my-dom.com:
www A 10.1.2.3
Now, users can enter http://www.my-dom.com/ as a URL in their browsers and get
to your Web server. However, it will return the same information as if the
machine's original hostname had been used. So, the final stage is to tell Apache
how to respond differently to the different addresses.
How Apache Handles Virtual Hosts
Configuring Apache for virtual hosts is a two-stage process. First, it needs
to be told which IP addresses (and ports) to listen to for incoming Web
connections. By default, Apache listens to port 80 on all IP addresses of the
local machine, and this is often sufficient. If you have a more complex
requirement, such as listening on various port numbers, or only to specific IP
addresses, then the BindAddress or Listen directives can be used.
Second, having accepted an incoming Web connection, the server must be
configured to handle the request differently, depending on what virtual host it
was addressed to. This usually involves configuring Apache to use a different
DocumentRoot.
Telling Apache Which Addresses to Listen To
If you are happy for Apache to listen to all local IP addresses on the port
specified by the Port directive, you can skip this section. However, there are
some cases where you want to use the directives explained here:
- If you have many IP addresses on the machine but only want to run a Web
server on some of them
- If one or more of your virtual hosts is on a different port
- If you want to run multiple copies of the Apache server serving different virtual
hosts
There are two ways of telling Apache what addresses and ports to listen to:
- Use the BindAddress directive to specify a single address or port
- Use the Listen directive to any number of specific addresses or ports
For example, if you run your main server on IP address 10.1.2.3 port 80, and a
virtual host on IP 10.1.2.4 port 8000, you would use:
Listen 10.1.2.3:80
Listen 10.1.2.4:8000
Listen and BindAddress are documented on the Apache site.
Configuring the Virtual Hosts
Having gotten Apache to listen to the appropriate IP addresses and ports, the
final stage is to configure the server to behave differently for requests on
each of the different addresses. This is done using <VirtualHost> sections in
the configuration files, normally in httpd.conf.
A typical (but minimal) virtual host configuration looks like this:
<VirtualHost 10.1.2.3>
DocumentRoot /www/vhost1
ServerName www.my-dom.com
</VirtualHost>
This should be placed in the httpd.conf file. You replace the text
10.1.2.3 with one of your virtual host IP addresses. If you want to specify a
port as well, follow the IP address with a colon and the port number
(example: 10.1.2.4:8000). If omitted, the port defaults to 80.
If no <VirtualHost> sections are given in the configuration files, Apache
treats requests from the different addresses and ports identically. In terms of
setting up virtual hosts, we call the default behavior the main server
configuration. Unless overridden by <VirtualHost> sections, the main server
behaviour is inherited by all the virtual hosts. When configuring virtual
hosts, you must decide what changes to make in each of the virtual
host configurations.
Any directives inside a <VirtualHost> section apply to just that virtual host.
The directives either override the configuration give in the main server, or
supplement it, depending on the directive. For example, the DocumentRoot
directive in a <VirtualHost> section overrides the main server's DocumentRoot,
while AddType supplements the main server's mime types.
Now, when a request arrives, Apache uses the IP address and port it arrived on
to find a matching virtual host configuration. If no virtual host matches the
address and port, it is handled by the main server configuration. If it does
match a virtual host address, Apache uses the configuration of that virtual
server to handle the request.
For the example above, the server configuration used is the same as the
main server, except that the DocumentRoot is /www/vhost1, and the
ServerName is www.my-dom.com. Directives commonly set in <VirtualHost>
sections are DocumentRoot, ServerName, ErrorLog and TransferLog. Directives
that deal with handling requests and resources are valid inside <VirtualHost>
sections. However, some directives are not valid inside <VirtualHost> sections,
including BindAddress, StartSevers, Listen, Group and User.
You can have as many <VirtualHost> sections as you want. You can
leave one or more of your virtual hosts being handled by the main server, or
have a <VirtualHost> for every available address and port, and leave the main
server with no requests to handle.
VirtualHost sections for non-IP Virtual Hosts
Non-IP virtual hosts are configured in a very similar way. The IP address that
the requests arrive on is given in the <VirtualHost> directive, and the
host name is put in the ServerName directive. The difference is that there
(usually) is more than one <VirtualHost> section handling the same IP address.
For Apache to know whether a request arriving on a particular IP
address is supposed to be a name-based requests, the NameVirtualHost directive
addresses for name-based requests. A virtual host can handle more than one
non-IP hostname by using the ServerAlias directive, in addition to the
ServerName.
null -
Hello,
I have a enabled http access to my G4 and also FTP. I now would like to host my other sites.
How can I enable virtual hosting?
I have looked at documentation relating to this but have come unstuck as I have tried to look for the areas in the httpd.conf file that controls this. I think I found it but I'm not at all unix or command-line savvy so I don't wish to stuff it up. I have also looked through Apaches' on line documentation but I cant find any straight forward "this is what to change and this is how to change it" document. There seems to be much to do through terminal in order to allow virtual hosts, and there is also security which I believe is contained in other apache files. The mac is standalone and I think I need to allow it to be inetd? Is that right?
Is there alternative software apart from apple server, that a novice like me can learn from or allow me to set these up through a gui?
Thanks for your helpHi--
sorry for the delay in responding have been away for
xmas, will ask for advice on the apache boards,
You can also ask for advice here. Unless the Apache boards have an area specifically for Apache on OS X, you could get confusing advice. Apple's Apache uses a different file layout than Linux, for example. Also, the Apache on OS X is still version 1.3, so you can get confusing advice there, too.
but I
will give nedit a go to see what it does.
If you find nedit too daunting to install (it requires X Windows, for example, so you'd need that), you should look at Bare Bones' TextWrangler (if you're not already using BBedit, that is). You can use it to open the Apache configuration files. There's even an Apache Configuration Language module that works with TextWrangler. To install it into TextWrangler, just substitute "TextWrangler" in the path given on the Daring Fireball page. It works like a champ with either BBEdit or TextWrangler.
Do you think it would be worth
investing in apple server?
If all you want to do is to set up virtual hosts on your computer, I don't think it's worth it. I haven't used the GUI tools for setting up so I don't know how good they are, though.
But it's pretty simple to set up a virtual host on regular OS X. Basically, you open up the Apache configuration file. If you're using TextWrangler, and you installed the command line tool, it's as easy as typing this in the Terminal application:
<pre class="command">edit /etc/httpd/httpd.conf</pre>TextWrangler will take care of the proper authentication when it comes time to make changes or save your file.
The first thing to look for in your httpd.conf file is the NameVirtualHost directive. By default, it's commented out (has a "#" in front of the line):
<pre class="command">#NameVirtualHost *:80</pre>Just remove the "#" from the front of the line.
Then, a little further down, there's an example host but it's commented out:
<pre class="command">#<VirtualHost *:80>
# ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost></pre>I always leave that alone, but start my virtual hosts just below that. It can be as simple as this:
<pre class="command"><VirtualHost *>
DocumentRoot "/Library/WebServer/sitedirectory"
ServerName www.domain.com
</VirtualHost></pre>You can, however, get fancy and add all kinds of directives into that block, customizing your virtual host as much as you want. My suggestion would be to try setting up a virtual host and see where you get stuck, then post back with questions.
As for messing up the httpd.conf file, don't worry about it too much. There's a "default" copy of the file in the /etc/httpd directory that you can always go back to. Or, do what I do before I'm about to try something that could turn ugly: make a copy of the current configuration file:
<pre class="command">sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf.cmbak.1</pre>Where I just incremement the "1" on the end. Or I put the date on there: httpd.conf.cmbak.20061229. That way, I always have the current file to fall back on...
And don't forget: any time you make a change to the httpd.conf file, you have to stop and restart the web server! That's so easy to forget. Also, if you're changing the configuration, these two Terminal commands will be your friends:
<pre class="command">/usr/sbin/apachectl configtest
/http -S</pre>
The first one tells you if you have any syntax errors in your configuration file, the second will tell you about your virtual host setup.
charlie -
Move just wikis to new Lion server (redirect one virtual host)
I have a bunch of services on my Mac Pro with Snow Leopard Server, including file sharing, VPN, subversion, wikis, several websites, a few webapps, etc. I don't want to upgrade that server right now, but I'd like to try upgrading the wikis to Lion Server and Wiki Server 3.
How could I move the wiki's to Lion Server on another machine? They are all accessed through a seperate virtual host.
We only have one public IP right now (I maybe could get a second public IP but don't want to just for this.) Everything hits my router (dd-wrt device, so quite configurable) which sends port 80 (and most other ports) to my snow leopard server.
One idea would be to have the router redirect another port (8080 or something) to the new lion server, and then put a redirect page on the original wiki address (port 80) to redirect over to 8080, which would then go to the other server. But that's not really ideal because then the users of my wiki would see it on a new port and a lot of times ports other than 80 are blocked by firewalls (not my firewall, but firewalls closer to my users.)
So does anyone have an other ideas on how to redirect the traffic of one virtual host to another internal machine behind NAT?
Separate question: any experience migrating a wiki from Wiki Server 2 to Wiki Server 3? Did it work well?
JohnThe best way to do this is to take the contents of /Library/Collaboration and put it in a location accessible from your newly set up Lion install. In Server.app, enable Wiki, and run:
sudo wikiadmin migrate -r /Path/To/Library/Collaboration
After that, start the wiki and you should be good to go. You should bind your Lion server to the same Directory as the Snow Leopard server, to ensure permissions and users carry across successfully.
A. -
Using different DocumentRoot directive within virtual hosts
We have installed Oracle iAS 9i with default settings and created two VirtualHosts in Apache httpd.conf file with two different document root directories.
We figured out that static http content served by Apache itself appears correctly, but JSP requests go to the wrong document root.
For example after you restart Apache server the request for the first virtual host goes correctly, but the request for the second one does not; it uses previous document root.
We really need information if there is a solution somewhere or it's a bug.Let me try again the program eat some of the content:
nameVirtualHost 10.1.1.1
# Remove the \ on the next line
\<VirtualHost 10.1.1.1\>
ServerName devserver
DocumentRoot "c:\Dev"
# Remove the \ on the next line
\</VirtualHost\>
# Remove the \ on the next line
\<VirtualHost 10.1.1.1\>
ServerName testserver
DocumentRoot "c:\Test"
# Remove the \ on the next line
\</VirtualHost\>
null -
How to properly setup virtual hosts on leopard server
I am not just new to leopard server but new to “server” as a whole. I have bought a 10-client leopard server and installed it on my old macbook couple of days ago because of the gui and seemingly ease-of-setup of a leopard server. I have watched and followed a tutorial on Lynda.com to install my server. Unfortunately, that tutorial focuses mainly on running a single web server. My main purpose of setting up the leopard server is to run multiple virtual hosts. Now my server (which has its own public ip address and I shall refer to it as just IP) is up and running but I seem not to be able to get virtual hostings to work properly. Below is a summary of what I have setup and I hope somebody from the community can take a look and point out what I have done wrong (thanks in advance):
- server setup as advanced
- dns settings:
o I am not sure whether a different zones should be setup for each domain, so I have opted to define 1 primary zone only and then define the other domain as a machine. For simplicity sake, I have only used two domains in the example below. I actually need to setup at least half a dozen.
o primary zone
• my1stdomain.com. is the primary zone name
• ns.my1stdomain.com. is the only nameserver
• mail.my1stdomain.com. is the only mail exchanger
• www.my1stdomain.com. as machine and IP as value
• www.my2nddomain.com. as machine and IP as value
• mail.my1stdomain.com. as machine and IP as value
• server.my1stdomain.com. as machine and IP as value
• ns.my1stdomain.com. as machine and IP as value
o reverse zone
• ip reverse mapping ns.my1stdomain.com.
- web settings:
o sites:
• I have defined the following 2 sites and point each of them to a different folder:
• my1stdomain.com
• my2nddomain.com
- I have setup dns at my domain registrar to reference ns.my1stdomain.com for both my1stdomain.com and my2nddomain.com,
I have no problem accessing www.my1stdomain.com but I couldn’t reach www.my2nddomain.com. and I have a hunch it has to do with my dns settings.It sounds like there are two compounding errors here.
• www.my1stdomain.com. as machine and IP as value
• www.my2nddomain.com. as machine and IP as value
By definition, www.my2nddomain.com cannot be a record in my1stdomain.com's zone.
You MUST have one zone for my1stdomain.com (that contains my1stdomain.com's NS, MX, mail, www etc. records) and a SECOND, separate zone for my2nddomain.com that contain's its records.
Now the records in my2nddomain.com's zone may contain the same data (e.g. the same A record), or even reference my1stdomain.com (e.g. 'www.my2nddomain.com is a CNAME to www.my1stdomain.com), but they are separate zones.
Secondly.
I have defined the following 2 sites and point each of them to a different folder:
• my1stdomain.com
• my2nddomain.com
If you want to access the site via 'www.my1stdomain.com' (or 'www.my2nddomain.com') then your site needs to be setup for www.my1stdomain.com, not my1stdomain.com
As far as the web server is concerned, 'my1stdomain.com' is a completely different address (and therefore a different site) from 'www.my1stdomain.com. While most poeple set them to the same it is entirely appropriate and valid for them to be two different sites as far as the web server is concerned.
Therefore you need to change your sites' configuration to reference the 'www' version of its hostname.
If you want to run both 'my1stdomain.com' and 'www.my1stdomain.com' as the same site then add the other hostname under Aliases (this tells Apache what hostnames should map to this virtual host).
Try fixing those two elements and try again.
Finally, it's often far easier for others to debug this kind of problem when you talk in real names, not dummy ones. Telling us what the domains in question are, for example, would allow others to query DNS to see what values you're actually publishing, and would go a long way to answering the question for sure, as opposed to just speculation.
Maybe you are looking for
-
Oracle VM Server 2.2 Install Problems (Management Info Screen Skipped)?
Hi, I am new to Oracle VM Server and I basically following the install guide to install the server on a spare machine we have in the office (a relatively new Dell with an i7 processor and 8gb memory) so we can evaluate it and play with it a bit. When
-
Mail app crashes when opening on original iPhone
My teenage son's mail app keeps crashing when he tries to open it on his original iPhone. It has been happening since 2.0, with neither of the latest updates fixing the problem. He has been a jailbreaker with his phone in the past. I have never jailb
-
How to set same domain name for Azure Storage and Hosted Service
I have a web application running on azure and using azure storage with blob. My application allows to edit html files that are in the azure storage to save with another name and publish them later. I am using javascript to edit the html content that
-
Mac OS 10.7.5 After download pdf only get 1page when save or print-help please
I have Mac OS 10.7.5. After I download I can read the whole pdf. When I save or print I get only one page. When I receive a pdf via email, I can open, save, and print it. Please help.
-
How to make a smart album of "Today's images?"
So despite my near-constant complaining, I am still using Aperture for one jpg-only project (I won't let it anywhere near my raw files.) This project gets a few hundred frames daily, and will continue to accumulate indefinitely. I want to organize it