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: Please review and help with my conf file(s) for Windows Serv Page 1, 2  Next
Author
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 27 Mar '15 5:00    Post subject: Please review and help with my conf file(s) for Windows Serv Reply with quote

Question I'm trying to convert an IP based configuration to a name based one on a Windows Server 2003 R2 system. I've reviewed literally everything I can find online as well as my Apache Bible and various sysadmin books. I've had no luck resolving this issue.

I've included the contents of the config file(s) below hoping that someone familiar with this can peruse it and easily determine what I'm doing wrong. So please would someone please review this and identify where's I've gone wrong?

BTW - I've included the contents of the -vhosts and -default conf files inline for everyone's view even though the includes still show. Thanks.

Code:


Listen   80
Listen   8080

########################################################################
# Enable named based virtual hosting
#
NameVirtualHost   *:80

ServerName      localhost

DocumentRoot   "D:\wwwroot\empty"

<Directory "D:\wwwroot\empty">
   Options FollowSymLinks
   AllowOverride None
   Order deny,allow
   Deny from all
</Directory>

########################################################################
# Define All Virtual Hosts
#
Include conf\extra\httpd-vhosts.conf
Include conf\extra\httpd-ssl.conf
Include conf\extra\httpd-default.conf

########################################################################
# End of httpd.conf file

# Virtual Hosts
#
# Define autism-insar.org virtual host
<VirtualHost *>
   ServerName   autism-insar.org
   ServerAlias   www.autism-insar.org
   DocumentRoot "D:\wwwroot\autism-insar.org"
   <Directory         "D:\wwwroot\autism-insar.org">
      Options         None
      AllowOverride   None
      Order         Allow,deny
      Allow from      all
   </Directory>


</VirtualHost>

########################################################################
# Define aresnet.org virtual host
<VirtualHost *>
      ServerName   aresnet.org
      ServerAlias   www.aresnet.org
      DocumentRoot "D:\wwwroot\aresnet.org\htdocs"
      <Directory      "D:\wwwroot\aresnet.org\htdocs">
         Options         None
         AllowOverride   None
         Order         Allow,deny
         Allow from      all
      </Directory>

</VirtualHost>

########################################################################
# Define americanbraincoalition.org virtual host
<VirtualHost *>
   ServerName americanbraincoalition.org
   ServerAlias www.americanbraincoalition.org
   DocumentRoot "D:\wwwroot\americanbraincoalition.org\wordpress"
   <Directory         "D:\wwwroot\americanbraincoalition.org\wordpress">
      Options         None
      AllowOverride   None
      Order         Allow,deny
      Allow from      all
   </Directory>

</VirtualHost>

########################################################################
# Define media-wiki.org virtual host
<VirtualHost *>
   ServerName local.media-wiki.org
   DocumentRoot "D:\wwwroot\media-wiki.org"
   <Directory         "D:\wwwroot\media-wiki.org">
      Options         None
      AllowOverride   None
      Order         Allow,deny
      Allow from      all
   </Directory>

</VirtualHost>

########################################################################
# Define neann.org virtual host
<VirtualHost *>
   ServerName   neann.org
   ServerAlias   www.neann.org
   Redirect / https://netforum.avectra.com/eweb/StartPage.aspx?Site=NEANN

</VirtualHost>

########################################################################
# End of xhttpd-vhosts.conf file


Mod note: removed not needed stuff from config, added bb tags
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 27 Mar '15 20:29    Post subject: Reply with quote

What version of Apache are you using? And, what problem(s) are you having?
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 27 Mar '15 21:54    Post subject: Reply with quote

The version is 2.2
I receive no error messages from the startup but all named requests are being intercepted by the default virtual server. I've also tried to relocate the default definition at the end of the virtual list with no better results.
Hopefully this is enough information to answer your inquiry. Thanks
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 27 Mar '15 22:05    Post subject: Reply with quote

Well, it all seems to be working OK from here! Except media-wiki.org, for which no DNS records seem to exist.
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 27 Mar '15 22:08    Post subject: Reply with quote

Well if you accessed the current site my name then yes, it should work because the current live config is IP based. What I am trying to do is convert the config to a named virtual server config. I have separate config files so when I test on that server I stop apache, replace the config files with the revised ones then restart apache and test. When I'm done I stop apache again, restore the live config files and restart apache.
One of the purposes of converting to name based is to allow testing of a web instance without effecting the live one as it does now.

Make sense???
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 27 Mar '15 22:14    Post subject: Reply with quote

Are you testing it via the internet, or locally, ie via 'localhost' in a browser?
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 27 Mar '15 22:22    Post subject: Reply with quote

Both ways. As its a remote server I using RDP to connect to the server and using IE locally. Also I use firefox on my own system to access via the Internet.

Right now their remote server is configured to accept all the various IP's used for the various sites. However, as a named based it shouldn't matter how it comes in.

Hope this helps.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 27 Mar '15 22:33    Post subject: Reply with quote

What site appears as the default VH?
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 27 Mar '15 23:15    Post subject: Reply with quote

Quote from the documentation:

Code:
Argument to <VirtualHost> directive

Note that the argument to the <VirtualHost> directive must exactly match the argument to the NameVirtualHost directive.

NameVirtualHost 1.2.3.4:80
<VirtualHost 1.2.3.4:80>
# ...
</VirtualHost>


Relevant?
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 27 Mar '15 23:55    Post subject: Reply with quote

I believe I have that. All the virtual servers user *:80 as does the namevirtualhost directive.

Unfortunately I cannot RDP to the remote server tonight due to a change in the firewall. I'll have to wait until its updated. I will post which particular site is responding to my requests. I "think" its the default site.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sat 28 Mar '15 10:48    Post subject: Reply with quote

According to the config files you posted, you have:

NameVirtualHost *:80, but

<VirtualHost *> everywhere else.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sat 28 Mar '15 10:59    Post subject: Reply with quote

Since the config files posted here have been edited, it's quite hard to tell what's going on. However, you don't appear to have explicitly defined a default VH, so it appears implicitly to be autism-insar.org (since that appears first in the list of VHs).
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sun 29 Mar '15 21:57    Post subject: Reply with quote

There seem to me to be a number of issues with your httpd.conf and vhost.conf files (based on the edited versions posted). Whether it'll solve your problem, I can't say, but I think you should address them. I'll deal with each in a separate 'reply'.

(1) Your proposed setup in insecure, because you have not acted on this documentation:

Code:
... add the following block to your server's configuration:

<Directory />
Order Deny,Allow
Deny from all
</Directory>

This will forbid default access to filesystem locations. Add appropriate Directory blocks to allow access only in those areas you wish ...


Instead, you seem to have denied access to one of the document roots (wwwroot\empty) while leaving the others unprotected (since they are not under wwwroot\empty, but under wwwroot).


Last edited by AdrianK_IT on Sun 29 Mar '15 22:23; edited 1 time in total
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sun 29 Mar '15 22:04    Post subject: Reply with quote

(2) However, you have also ignored this documentation:

Code:
Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive.


Your use of case is inconsistent; who knows how the server is interpreting it. (If the server starts, it's syntactically OK; it could still be semantic nonsense.)

Eg (quoted from separate places in your config):

Code:
Order deny,allow

Order Allow,deny


You need to follow the case given in the directive documentation; if you are inconsistent here, you may also be elsewhere, with who knows what undesiirable side effects.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sun 29 Mar '15 22:10    Post subject: Reply with quote

(3) I'm puzzled that in a configuration intended for a production, internet- facing server, you use 'localhost' as the server name. It should be one of the domains hosted on the server.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Sun 29 Mar '15 22:22    Post subject: Reply with quote

(4) You have also ignored this part of the documentation:

Code:
Main host goes away

If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.


If you don't want any one of the 'real' virtual hosts to be the default one ie which shows up eg if a request is made by any of the IP addresses (rather than by name) then create a dummy virtual host (and echo this in your main server config). This could eg simply display a message explaining that the server is now configured to serve requests by name rather than IP address, and clients need to alter any bookmarks based on IP addresses to ones based on the names of the sites sought.
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 03 Apr '15 20:51    Post subject: Reply with quote

Hello again Adrian_KIT,
Well, its been a week since I was able to gain access but today I did. When the new config is enabled and Apache started there are no errors. However, a link to the autism-insar.org drupal site yields the panel words "page index.html" and that's it.

I've reposted the config files exactly as they exist today in test mode. Please review for anything obvious and advise?

Thank you.

Admin note:

Config files removed, see forum rules.


Thank you for viewing/helping.
Back to top
AdrianK_IT



Joined: 30 May 2013
Posts: 34
Location: Scottish Borders, UK

PostPosted: Fri 03 Apr '15 21:30    Post subject: Reply with quote

In between my seeing your post and config files, and my logging in, I see that admins have removed them in accordance with the 'rules'. Not very helpful; it should have been quite obvious from the context that I was up for assisting! There were obvious problems, relevant to the vhosts issue, which I was quite happy to help with! Now I can't, because I can't quote relevant sections back to you. Can you post them to an external site for me to view?
Back to top
BobMCT



Joined: 09 Aug 2014
Posts: 12
Location: USA

PostPosted: Fri 03 Apr '15 21:44    Post subject: Reply with quote

Sure Adrian. If you send you email to bobmct1@gmail.com I can open you to my google drive for the files.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 679

PostPosted: Fri 03 Apr '15 22:11    Post subject: Reply with quote

From the forum rules:

- Do not paste whole configuration files (php.ini, httpd.conf etc.) and dumps, and compiler output. Paste only the relevant parts or use a pastbin, for example http://apaste.info/ (recommended) or http://pastebin.com/


Last edited by admin on Sat 04 Apr '15 10:56; edited 1 time in total
Back to top


Reply to topic   Topic: Please review and help with my conf file(s) for Windows Serv View previous topic :: View next topic
Post new topic   Forum Index -> Apache Page 1, 2  Next