WAMP - Windows 2008 R2 Server - Domain Name not working
Posted by: smussani (---.125.194.66.t00827-01.above.net)
Date: March 11, 2011 09:40PM

Hi,
I have installed WAMP 2.1 on my virtual Windows 2008 R2 machine hosted by myhosting.com. I have a web site installed on this server that works fine when I visit using my server's IP address. E.g.
[168.2.2...]

I am trying to add my purchased domain name to Apache and for some reason I cannot make it work.
I added the following lines to my Apache - httpd.conf file:

Listen *:80

ServerName www.mydomainame.com:80

# Tells Apache to identify which site by name
NameVirtualHost *:8080
# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
<VirtualHost *.8080>
# The name to respond to
ServerName mydomainame.com
ServerAlias *.mydomainname.com
# Folder where the files live
DocumentRoot "C:/wamp/www"
# A few helpful settings...
<Directory "C:/wamp/www">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.php index.html
</VirtualHost>

I have made sure the Name Servers of my domain are pointing to myhosting.com's name servers

After making the changes and restarting Apache, I can view my site using the IP but not by using my domain name.

I can ping my IP and it works fine. But when I ping my domain name, it comes back with host not found.

Please help..

Thanks
Sajjad

Options: ReplyQuote
Re: WAMP - Windows 2008 R2 Server - Domain Name not working
Posted by: yfastud (Moderator)
Date: March 11, 2011 10:49PM

No matter within or outside LAN access, you need to setup Access, DNS, and VH; Access for permission to connect to your Wamp PC, DNS to tie Domain(s) to your Wamp PC, and VH to host multiple Domains/Websites/IP's and even you have only 1 Domain/IP, you should use VH to set it up w/ the site you want to show up first on top and localhost on bottom and others in middle if having more than 1 site; w/ VH, other PC's, no matter w/i or outside LAN, can access/see websites/contents on your wamp PC. If dont have real Domain, just skip DNS guide

To setup Access, follow this
[blog.jlbn.net]

To setup VH, follow this
[blog.jlbn.net]

To setup DNS, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: WAMP - Windows 2008 R2 Server - Domain Name not working
Posted by: VcDeveloper (---.dsl.skt2ca.sbcglobal.net)
Date: March 12, 2011 09:28PM

I'm running Window 2008 R2 Datacenter w/Hyper-V Management, w/A Windows 2008 R2 Web Server. My Setting look like this and I hope it helps you out:

httpd.conf - these are the only changes I made to the default: I left Listen 80 as is!
1) ServerName 127.0.0.1:80
2) <Directory "c:/wamp/www/">
Allow from 127.0.0.1, 192.168.1
3) Added
# Sorry, no svn peeking
<DirectoryMatch ".svn">
# Currently pointing back to drupal
# High traffic sites might want custom
# error pages, no need to load drupal
ErrorDocument 403 /index.php
Order allow,deny
Deny from all
Satisfy All
</DirectoryMatch>

# Allow the .htaccess files to be used in the sites folder where /files are stored
<Directory "C:/some-folder/some-folder/some-folder/6/sites">
AllowOverride
</Directory>

<Directory "C:/some-folder/some-folder/some-folder/7/drupal-7.0/sites">
AllowOverride
</Directory>

# Block off access to admin and devel - just in case you're using on production
# this is very strict because it's limited based on IP addresses
# adjust as needed
<LocationMatch "/(admin|devel)">
Order deny,allow
Include "C:/wamp/bin/apache/Apache2.2.17/conf/httpd-ip.conf"
Deny from all
</LocationMatch>

# Define your own file limitations on drupal files
<FilesMatch "(install.php|cron.php|phpinfo.php|update.php|.txt)$">
Order deny,allow
Include "C:/wamp/bin/apache/Apache2.2.17/conf/httpd-ip.conf"
Deny from all
</FilesMatch>

4) # Virtual hosts
Include conf/extra/httpd-vhosts.conf


httpd-vhosts.conf - these are the additions of my setup: NameVirtualHost *:80 as is
<VirtualHost *:80>
ServerAdmin support@domain-name.com
ServerName domain-name.com
ServerAlias www.domain-name.com

DocumentRoot "C:/some-folder/some-folder/some-folder/6"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "C:/some-folder/some-folder/some-folder/6">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

<FilesMatch "robots.txt">
Allow from all
</FilesMatch>

# Read in Drupal default .htaccess file asif conf - easier CVS management
Include "C:/some-folder/some-folder/some-folder/6/.htaccess"

</Directory>

ErrorLog "C:/wamp/bin/apache/Apache2.2.17/logs/error-domain-name.log"

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog "C:/wamp/bin/apache/Apache2.2.17/logs/access-domain-name.log" combined

</VirtualHost>



Edited 2 time(s). Last edit at 03/13/2011 12:04AM by VcDeveloper.

Options: ReplyQuote


Sorry, only registered users may post in this forum.