Author |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Fri 09 Sep '16 17:20 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
I want to have multiple websites on Apache 2.2 and have been unable to when attempting to configure Virtual Hosting. Where can I find 'simple' menu-type instructions for configuring the httpd and vhosts files? The hard drive has three partitions, C,D,E. I would prefer to have the Apache files on the D partition and the website files on the E partition.
Any advice will be appreciated as I have tried everything I've found on the Internet as well as some suggestions found here.
Thanks,
Milt Spain |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 10 Sep '16 0:39 Post subject: |
|
|
Would a working example do? |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Sat 10 Sep '16 20:53 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
I would appreciate seeing a working example! |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Sun 11 Sep '16 14:56 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Thank you!!! The instructions given by Apache should be so simple and clearly written!!! Then a novice like me wouldn't have so much trouble.
Thanks again! |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Fri 16 Sep '16 23:14 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Still having a problem as websites will not come up.
I've even changed the DocumentRoot and Directory files in HTTPD Conf to "E:/Pinnacle" without success. I'm not sure what these should be named anyway but I though I'd try it. Also tried to connect at the remote server,itself, by editing the Hosts files. Didn't work!
The V Host looks exactly as was described at http://static.port0.org:8080/ .
Somewhere something is configured incorrectly but I can't find it. I can't believe things would be this complicated on Apache 2.2 when everything worked like a champ on Apache 1.3. Wish I could get that version to run on Windows Server 2012.
Any help will be greatly appreciated. Thanks!
Milt |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Fri 16 Sep '16 23:48 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Forgot this was a different post. Here's what the V Host file looks like:
Name Virtual Host *:80
<VirtualHost *:80>
Document Root "D:/Program Files (x86)/Apache Software Foundation/Apache 2.2/htdocs"
</VirtualHost>
<VirtualHost *:80>
Document Root "E:/pinnacle/1stwebsite/htdocs"
ServerAdmin admin@1stwebsite.com
ServerName 1stwebsite.com
ServerAlias *.1stwebsite.com
ScriptAlias /cgi-bin/"E:/pinnacle/1stwebsite/cgi-bin
<Directory "E:/pinnacle/1stwebsite/htdocs">
Options Includes
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Thanks again for any assistance!!! |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Sat 17 Sep '16 1:58 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Changed Directory 'AllowOverRides File Info' to Allow
All. Still doesn't work. I get a 'forbidden' error |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 17 Sep '16 17:43 Post subject: |
|
|
how about posting the config at apaste.info, both httpd and httpd-vhosts.conf and I'll have a look at it. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Sat 17 Sep '16 17:46 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Will do! And Thanks!!!!!!!!!!!!!!! |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 18 Sep '16 2:40 Post subject: |
|
|
forgot to mention, you need to post the link to the paste here. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Mon 19 Sep '16 0:52 Post subject: |
|
|
The url for the post is:
http://apaste.info/VUY
At this point nothing seems to work! None of the VH are being recognized.
Thanks again for your assistance. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 19 Sep '16 21:53 Post subject: |
|
|
My bad since I specifically said it wasn't needed as in my experience it hasn't been, but in this case it is. I simply do not use the dafault host for anything since more than half of what lands there I do not want coming around anyway.
Go ahead and add the ServerName www.yourdomain to the first vhost, my deepest apologies. I owe you a beer or 12.
That's the only problem I have when using your config, www.yourdomain lands at the last vhost not at the default host. Being able to see the fuller picture it seems the latter is your intent.
Substituting yourdomain for mine and the port, here is your exact config copied from your paste with the servername added to the first vhost.
http://www.glsnet.net:8080 lands at the default now.
Oh Canada
http://canada.glsnet.net:8080
http://dudley.doright.of.canada.glsnet.net:8080
For the USA
http://usa.glsnet.net:8080
http://now.Im-going-to.disneyland.usa.glsnet.net:8080
Last but not lease, anything else to yourdoman goes to the third vhost with the wildcard ServerAlias there.
http://the3rdvhost.glsnet.net:8080
http://or-anything-really.glsnet.net:8080
I did note some other things. You ran into "scope" challenges so I see a few unneeded ScriptAliases in the vhosts. Your script aliases in httpd.conf are in the server or global scope and the vhosts will automatically pick them up. Not so with the <Directory> containers as you found out.
You shouldn't need AllowOverride All, you may but in most cases it's usually not needed. It's quick & simple but it's powerful. It's better to understand just what your needs are and use just that.
I think that was it. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Mon 19 Sep '16 23:45 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Thanks for the response. I think I understand most of what you have said but I want to make sure. Here's what I want to happen:
If someone or something enters the server IP address or a non-listed VHost they should be routed to the first VH, whatever it is (probably will leave it as is). If some enters a specific domain, ie. website.com or canada.wesite.com they should be directed to that domain. There are two A records at my DNS service, both pointing to the same IP address. The first is specific for "website.com". The second is a wild card, *.website.com. This has worked well with Apache 1.3 hosting 'website.com' and a bunch of sub-sites, i.e argentina.website.com for example. You can go to canada.website.com ( where website is as noted in my post) and you will get a specific page from that site.
Please elaborate a little more based upon what I've noted above. And don't worry about the beer! I should be buying you several!
Thanks again![/b] |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 20 Sep '16 1:19 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Hi Again,
I've put up another paste at http://apaste.info/cF9 which shows my current experience/continuing problems and the current VHOSTS config file.
Hopefully you will be able to figure out the source of my difficulties.
Thanks,
Milt |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Tue 20 Sep '16 3:05 Post subject: |
|
|
Easier to show and have you ask questions if needed. I did go to your domain and try it out and I noticed usa.yourdomain was not working correctly.
httpd.conf
httpd-vhosts.conf
Edit: I have not looked at your last post yet (I was working on this post) but this config works for me when I duplicate your hard drive locations and use my domain name instead of yours. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 20 Sep '16 15:14 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
My apology. I think I should have said this earlier. The current DNS settings point to my old server which is still active. If you had a problem with usa.website.com it was most likely because a DNS change was in progress after I had worked with changes at the new server and then reset the DNS. I have no current problems with usa.website.com that I can see.
I have added a website, globaljobannouncements.com, at the new server with its DNS pointing to the IP address of the new server. It will be active all the time.
Presently it does not come up with either the simple website name or with www.
Thanks for taking another look at the configs. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 20 Sep '16 17:03 Post subject: |
|
|
I commented out the default VH which pointed to the Apache HTDOCS which was the first thing to come up. Now, as expected, the first active VH, canada.website.com is recognized. But nothing else. If I enter any other site whose DNS is pointed to this server, the canada.website index is what pops up. The same problem continues, i.e. only the first VH is being recognized. Why? What configuration error could be causing this. What's so different in the Apache 2.2 configuration as opposed to 1.3 where everything works? |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 20 Sep '16 17:27 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
While I appreciate all the assistance that has been provided and I do want to totally understand the necessary configuration for Apache2.2 I have to say this has been one of life's most frustrating times. My previous server was set up by a close friend who, unfortunately, passed away several years ago and my experience with Apache was mainly adding Vhosts to what we initially had. To say I am a Newbee would be an understatement. It is important that the new server be functioning properly very soon and I and am more than willing to 'pay' an hourly fee to have you correct any configuration errors, wherever they may be or what config file to get everything working properly. Please email me at milt@diversitylink.com. |
|
Back to top |
|
MiltSpain1
Joined: 04 Sep 2016 Posts: 38 Location: USA
|
Posted: Tue 20 Sep '16 21:29 Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts |
|
|
Hi Again,
This came from Apache.org:
ServerName Directive
Description:
Hostname and port that the server uses to identify itself
Syntax:
ServerName [scheme://]fully-qualified-domain-name[:port]
Context:
server config, virtual host
Status:
Core
Module:
core
Compatibility:
In version 2.0, this directive supersedes the functionality of the Port directive from version 1.3.
The ServerName directive sets the request scheme, hostname and port that the server uses to identify itself. This is used when creating redirection URLs.
Additionally, ServerName is used (possibly in conjunction with ServerAlias) to uniquely identify a virtual host, when using name-based virtual hosts.
For example, if the name of the machine hosting the web server is simple.example.com, but the machine also has the DNS alias www.example.com and you wish the web server to be so identified, the following directive should be used:
ServerName www.example.com
If no ServerName is specified, then the server attempts to deduce the hostname by performing a reverse lookup on the IP address. If no port is specified in the ServerName, then the server will use the port from the incoming request. For optimal reliability and predictability, you should specify an explicit hostname and port using the ServerName directive.
If you are using name-based virtual hosts, the ServerName inside a <VirtualHost> section specifies what hostname must appear in the request's Host: header to match this virtual host.
---------------------------------------------------
I'm totally confused! What server name should be placed within the HTTPD Config, or does it matter when it is included within the VHosts. Do they need to be the same in both cases? What is a fully qualified domain? My host computer is designated as DS42292. Does that mean the server name should be DW42292.website.com:80? Nothing like that was required with Apache 1.3. Why doesn't Apache write the documentation in simply English with very definitive examples? Help!!!!!!!!!!!!!!!!!!! |
|
Back to top |
|