Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CentOS 6.2 Apache 2.2.15 Virtual Host setup deosn't work.

Status
Not open for further replies.

louarnold

Programmer
Oct 13, 2010
9
CA
I've tried to set up a virtual host but without any luck. The domain is supposed to be "xdrupaldocs.com".
- Entering a URL of "xdrupaldocs.com" alone brings up the default Apache web page.
- Entering "xdrupaldocs.com/index.html" or " brings up the ISP's error page.

I'm stumped.
Here are the files content:

The hosts file does not have the xdrupaldocs.com domain in it; but having it there doesn't alter the result.
----httpd.conf file:
Code:
#NameVirtualHost 192.168.1.149:80
NameVirtualHost *:80

#<VirtualHost 192.168.1.149:80>
<VirtualHost *:80>
   DocumentRoot /var/[URL unfurl="true"]www/html[/URL]
   ServerName localhost
</VirtualHost>

#<VirtualHost 192.168.1.149:80>
<VirtualHost *:80>
	DocumentRoot /home/DrupalDocs/htdocs
	ServerName xDrupalDocs.com
	<Directory "/home/DrupalDocs/htdocs">
	   	Options Includes FollowSymLinks
		AllowOverride All
		allow from all
		Options +Indexes
	</Directory>
	ServerAlias *.xDrupalDocs.com
	ErrorLog /home/DrupalDocs/htdocs/DrupalDocsErrorLog.log
	LogLevel emerg
	UseCanonicalName off
</VirtualHost>
------
 
192.168.1.149 is a private IP so is not mapped by DNS servers, so your hosts file will to have the domain mapped to the IP so your machine knows where to find it.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Why exactly this doesn't work is not clear, but it has nothing to do with the IP addresses. There is a much simpler solution at Configure Apache Virtual Host on Fedora ( The key part are the permissions, ownership, and proper domain name - i.e. " vs "xDrupalDocs.com". Helps to put the domain name into the /etc/hosts file, but under the localhost IP address of 127.0.0.1.
 
Since the ip addresses are commented out, they are not an issue. I can see by the use of caps that you are a Windows kind of guy. Linux doen not treat "This" the same as "this". Case does matter to linux. If you use caps, anybody typing your url will have to also.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top