logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Simple Instructions To Configure Apache 2.2 Virtual Hosts Page Previous  1, 2
Author
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 21 Sep '16 6:11    Post subject: Re: Simple Instructions To Configure Apache 2.2 Virtual Host Reply with quote

MiltSpain1 wrote:
What server name should be placed within the HTTPD Config, or does it matter when it is included within the VHosts.


Any domain name that points to your IP address. The docs you posted even state you do not have to set it, that it is only used to figure out what IP address it's running on. It's at www.yourdomain, leave it there.

Since you have a wildcard dns record, literally anything .diversitylink.com. will be a FQDN.

To change the location of the default vhost, change the DocumentRoot for it in httpd-vhosts.conf. In httpd.conf change the <Directory> that has the old documentroot as well to whatever the new location is.
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Thu 22 Sep '16 3:40    Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts Reply with quote

Thanks for the feedback. I have made some changes and have been able to get some VHosts to work. Tomorrow morning I will attempt to get the main site to work. I will bring you up to date late tomorrow.

Thanks again for all your assistance.

Milt
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Thu 22 Sep '16 19:57    Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts Reply with quote

Here are two site configurations within VHosts:

<VirtualHost *:80> ## jobs40plus.com
DocumentRoot E:/pinnacle/diversitylink/htdocs/jobs40plus/
ServerAdmin adm@diversitylink.com
ServerName jobs40plus.com
ServerAlias *.jobs40plus.com
ScriptAlias /cgi-bin/ "E:/pinnacle/diversitylink/cgi-bin/"
<Directory "E:/pinnacle/diversitylink/htdocs/jobs40plus">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
#ErrorLog E:/pinnacle/diversitylink/logs/error.log
#CustomLog E:/pinnacle/diversitylink/logs/access.log combined
</VirtualHost>

<VirtualHost *:80> ## diversitylink.com
DocumentRoot E:/pinnacle/diversitylink/htdocs/diversitylink/
ServerAdmin adm@diversitylink.com
ServerName diversitylink.com
ServerAlias *.diversitylink.com
ScriptAlias /cgi-bin/ "E:/pinnacle/diversitylink/cgi-bin/"
<Directory "E:/pinnacle/diversitylink/htdocs">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
#ErrorLog E:/pinnacle/diversitylink/logs/error.log
#CustomLog E:/pinnacle/diversitylink/logs/access.log combined
</VirtualHost>

Here's the problem I am experiencing;

www.jobs40plus.com and jobs40plus.com both bring up the index for that site. Note - the dns for this site points to the IP address of the new server so this can be verified at all times.

When the dns for diversitylink.com is pointed to the new server ----
www.diversitylink.com shows "There is no website here" while diversitylink.com brings up the index for the site minus images and none of the links to files or images work. Note -- links to htm and image files are addressed www.diversitylink.com/some directory/some file.

Why is www.diversitylink.com not being recognized? Both www.diversitylink.com and diversitylink.com are recognized on the old server.

Any idea as to what I am missing?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 22 Sep '16 22:11    Post subject: Re: Simple Instructions To Configure Apache 2.2 Virtual Host Reply with quote

Take the ## comments off the line with the VirtualHost tag.

http://httpd.apache.org/docs/2.2/configuring.html#syntax
The Docs wrote:
Comments may not be included on the same line as a configuration directive.


See if that helps.
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Fri 23 Sep '16 20:52    Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts Reply with quote

Thanks for the feedback. I think it helped.

Another problem ---- (Working with www.globaljobannouncements.com which is active at my new server) when calling a cgi program I get these error messages:

At the browser (an example): Forbidden -- You don't have permission to access/cgi/Argentina_bin/Argentina_functiontoc.pl on this server. Apache/2.2.11(Win32) Server at www.globaljobannouncements.com Port80

At the Apache error log: client denied by server configuration: E:/Pinnacle/GlobalJob/cgi_bin/Argentina_bin

Note --- USERS(DS42292\USERS) has read & execute permissions on the directories and files.

Here is the VHost config:

<VirtualHost *:80>
DocumentRoot E:/pinnacle/globaljob/htdocs
ServerAdmin adm@diversitylink.com
ServerName globaljobannouncements.com
ServerAlias *.globaljobannouncements.com
ScriptAlias /cgi-bin/ "E:/pinnacle/globaljob/cgi-bin"
<Directory "E:/pinnacle/globaljob/htdocs">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>

</VirtualHost>


Note --- The User and User group listed within the HTTPD Config file is Daemon. Does this need to be changed?

Note: This problem does not exist when using the same configuration at my old server with Apache 1.3 and the same permissions.

One of these days I will get all this mess straightened out. As always your assistance will be greatly appreciated.

Milt
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 23 Sep '16 22:54    Post subject: Reply with quote

ScriptAlias /cgi-bin/ "E:/pinnacle/globaljob/cgi-bin"

Like you did earlier (in httpd.conf) you need to allow access to
E:/pinnacle/globaljob/cgi-bin

look at the one in httpd.conf, <Directory ...> right after the ScriptAlias' in it.
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Sat 24 Sep '16 0:42    Post subject: Simple Instructions To Configure Appache 2.2 Virtual Hosts Reply with quote

Here's what I've got now:

<VirtualHost *:80>
DocumentRoot E:/pinnacle/globaljob/htdocs
ServerAdmin adm@diversitylink.com
ServerName globaljobannouncements.com
ServerAlias *.globaljobannouncements.com
ScriptAlias /cgi-bin/ "E:/pinnacle/globaljob/cgi-bin/"

<Directory "E:/pinnacle/globaljob/cgi-gin/">
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>

<Directory "E:/pinnacle/globaljob/htdocs">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>


</VirtualHost>

Doesn't work. Still get the 'you don't have permission' error. What am I doing wrong?

Milt
Back to top
MiltSpain1



Joined: 04 Sep 2016
Posts: 38
Location: USA

PostPosted: Sat 24 Sep '16 21:06    Post subject: Simple Instructions To Configure Apache 2.2 Virtual Hosts Reply with quote

Show below is the configuration for a VHost that I have on a new server (Windows Server 2012) running Apache 2.2. I am currently hosting the same website on an old machine (Windows Server 2003) running Apache 1.3.

<VirtualHost *> ## GlobalJobAnnouncements.com March 15, 2009
DocumentRoot E:/pinnacle/globaljob/htdocs
ServerAdmin webmaster@aadast.com
ServerName globaljobannouncements.com
ServerAlias *.globaljobannouncements.com
ScriptAlias /cgi-bin/ "E:/pinnacle/globaljob/cgi-bin/"
<Directory "E:/pinnacle/globaljob/htdocs">
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
ErrorLog E:/pinnacle/globaljob/logs/error.log
CustomLog E:/pinnacle/globaljob/logs/access.log combined
</VirtualHost>

When calling the cgi directory on the machine using Apache 2.2 I get a message "Forbidden - You don't have permission to access-----, while on the old machine with Apache 1.3 everything works just fine with the configuration noted. The file paths and permissions are the same in both cases.

Why doesn't the config work? What is different about Apache 2.2? What am I missing?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7306
Location: Germany, Next to Hamburg

PostPosted: Tue 11 Oct '16 21:45    Post subject: Reply with quote

you can take a look in the cgi tutorial http://httpd.apache.org/docs/2.2/howto/cgi.html
Back to top


Reply to topic   Topic: Simple Instructions To Configure Apache 2.2 Virtual Hosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache Page Previous  1, 2