[Really need help!] Problems with VirtualHosts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[Really need help!] Problems with VirtualHosts

Postby narox » 10. March 2009 21:29

hello, i have some problems with the virtualhosts...

i have bought 2 domain names, (domain1.net and domain2.cl), well my problem is that i have tryed to put them too locating to my computer but in diferent folders. domain1 in c:\domain1 and domain 2 in c:\domain2, now i put this in my httpd-vhost.conf

Code: Select all
<VirtualHost domain2.cl:80>
   ServerAdmin myownemail@domain.com
   ServerName domain2.cl:80
   DocumentRoot "c:/domain2"
   <Directory "c:/domain2">
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>


ok.. the problem is that the 2 domains point me to the htdocs folder of xampp!

i will put my httpd-vhost.conf if someone can find a problem, correct me please.

Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host.example.com
##    DocumentRoot /www/docs/dummy-host.example.com
##    ServerName dummy-host.example.com
##    ServerAlias www.dummy-host.example.com
##    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host2.example.com
##    DocumentRoot /www/docs/dummy-host2.example.com
##    ServerName dummy-host2.example.com
##    ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

<VirtualHost domain2.cl:80>
   ServerAdmin myownemail@domain.com
   ServerName domain2.cl:80
   DocumentRoot "c:/domain2"
   <Directory "c:/domain2">
      Options Indexes FollowSymLinks
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>


well... lets see if someone can help!

bye!
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Re: [Really need help!] Problems with VirtualHosts

Postby Izzy » 12. March 2009 04:55

Which version of Windows?
Which version of XAMPP?
Both omitted.
Last edited by Izzy on 12. March 2009 07:25, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: [Really need help!] Problems with VirtualHosts

Postby make-fun » 12. March 2009 06:27

Hi there

A proper VirtualHost looks like:
Code: Select all
<VirtualHost *:80>
 ServerName www.domain2.tld
 ServerAlias www.domain2.tld *.domain2.tld

 DocumentRoot "c:/domain2/"
 ErrorLog "c:/domain2/xx_error.log"
 TransferLog "c:/domain2/xx_access.log"
   <directory 'c:/domain2/'>
       Options Indexes FollowSymLinks Includes execCGI
      AllowOverride None
      Order Allow,Deny
      Allow From All
  </directory>
</VirtualHost>


Cheers
Last edited by make-fun on 13. March 2009 00:20, edited 1 time in total.
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21

Re: [Really need help!] Problems with VirtualHosts

Postby narox » 12. March 2009 23:36

when you write domain2.tld is same that write blogux.net?
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Re: [Really need help!] Problems with VirtualHosts

Postby make-fun » 13. March 2009 00:28

I just picked up on your naming conventions…, so if you're asking "writing domain2.tld is the same as writing blogux.net?"
yes, this is correct!
(.tld is just short for TopLevelDomain…)
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21

Re: [Really need help!] Problems with VirtualHosts

Postby narox » 13. March 2009 01:07

OOOOOOOOOOOOOOOOHHHHHHHHHHHHHHHHHHHHHH NICE MAN!!!!!!!!!!! YOU ARE THE BEST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! but i have reinstalled xampp :P, YOU ARE THE BEST MAN!!!

it is so useful!!!

but i have Another question with the same subject... well the problem is that if i write http://blogux.net it sends me htdocs folder... not to c:/webs/blogux... well, but if i write http://www.blogux.net it sends me to c:/webs/blogux... how can i do it to go c:/webs/blogux writing http://blogux.net wit out the www.


thanks! you are the best ;)

i have another problem too!.. the problem is that i cannot see my forum images :/
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Re: [Really need help!] Problems with VirtualHosts

Postby Izzy » 13. March 2009 01:47

Please paste your httpd-vhosts.conf file like you did in your first posts so it can be looked at and a solution offered back.

Your current httpd.conf file is incorrect if you are using the example from the previous poster and will be giving errors which will mean that you are being sent to the default XAMPP Welcome Page, a true sign you have problems in your vhosts file.

Also a forum search in the XAMPP for Windows forum for keyword vhosts will give many working examples.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: [Really need help!] Problems with VirtualHosts

Postby make-fun » 13. March 2009 01:49

It be a good idea to post the part of your VirtualHost causing the problems for you…
Guessing — I'd say look into this part:
Code: Select all
<directory 'c:/domain2/'>
       Options Indexes FollowSymLinks Includes execCGI
      AllowOverride None
      Order Allow,Deny
      Allow From All
</directory>

and try using "Options Indexes FollowSymLinks Includes execCGI"
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21

Re: [Really need help!] Problems with VirtualHosts

Postby make-fun » 13. March 2009 01:54

Hmm, Izzy was faster… about posting your VirtualHost

@Izzy
why do you think he's gonna get errors, please?
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21

Re: [Really need help!] Problems with VirtualHosts

Postby narox » 13. March 2009 02:08

[peace]Stop Fighting!! :P[/peace]
Thanks For Reply so fast!, well i will post my httpd-vhost.conf so if you find a problem with my second error (when i write httpd://blogux.net it sends me to xampp page (like localhost), and when i write http://www.blogux.net it sends me to the page that i want (c:/webs/blogux)...

now vhosts.conf...
Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host.example.com
##    DocumentRoot /www/docs/dummy-host.example.com
##    ServerName dummy-host.example.com
##    ServerAlias www.dummy-host.example.com
##    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host2.example.com
##    DocumentRoot /www/docs/dummy-host2.example.com
##    ServerName dummy-host2.example.com
##    ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>


# Localhost
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost:80
</VirtualHost>

# Envitrina
<VirtualHost *:80>
ServerName www.envitrina.cl
ServerAlias www.envitrina.cl *.envitrina.cl
DocumentRoot "c:/webs/envitrina"
ErrorLog "c:/webs/envitrina/xx_error.log"
TransferLog "c:/webs/envitrina/xx_access.log"
   <directory 'c:/webs/envitrina'>
       Options Indexes FollowSymLinks Includes execCGI
      AllowOverride None
      Order Allow,Deny
      Allow From All
  </directory>
</VirtualHost>

# Blogux
<VirtualHost *:80>
ServerName www.blogux.net
ServerAlias www.blogux.net *.blogux.net
DocumentRoot "c:/webs/blogux"
ErrorLog "c:/webs/blogux/xx_error.log"
TransferLog "c:/webs/blogux/xx_access.log"
   <directory 'c:/webs/blogux'>
       Options Indexes FollowSymLinks Includes execCGI
      AllowOverride None
      Order Allow,Deny
      Allow From All
  </directory>
</VirtualHost>


well bye and thanks you izzi and make-fun
;)
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Re: [Really need help!] Problems with VirtualHosts

Postby make-fun » 13. March 2009 02:17

No fighting here -- don't worry -- just expressing my interest…

Think your close… this has probably to do with your host file, missing an entry for http://blogux.net
Pls post host file…
make-fun
 
Posts: 31
Joined: 11. March 2009 04:21

Re: [Really need help!] Problems with VirtualHosts

Postby Izzy » 13. March 2009 02:31

Here is a complete httpd-vhosts file using the information you have already supplied.

Also make sure that your apache\conf\httpd.conf file is set as the defaults that were in place when you installed XAMPP - for example no changes.
Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host.example.com
##    DocumentRoot /www/docs/dummy-host.example.com
##    ServerName dummy-host.example.com
##    ServerAlias www.dummy-host.example.com
##    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host2.example.com
##    DocumentRoot /www/docs/dummy-host2.example.com
##    ServerName dummy-host2.example.com
##    ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
##    CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>

NameVirtualHost *:80

# Localhost
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost:80
</VirtualHost>

# Envitrina
<VirtualHost *:80>
ServerName envitrina.cl
ServerAlias www.envitrina.cl
DocumentRoot "C:/webs/envitrina"
<Directory "C:/webs/envitrina">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
CustomLog "C:/webs/envitrina/xx_access.log" combined
ErrorLog "C:/webs/envitrina/xx_error.log"
LogLevel error
</VirtualHost>

# Blogux
<VirtualHost *:80>
ServerName blogux.net
ServerAlias www.blogux.net
DocumentRoot "C:/webs/blogux"
<Directory "C:/webs/blogux">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow From All
</Directory>
CustomLog "C:/webs/blogux/xx_access.log" combined
ErrorLog "C:/webs/blogux/xx_error.log"
LogLevel error
</VirtualHost>
Try this by copy and paste over your existing file and see how it goes.

Note - use double quotes " " only not single quote ' '
You also had a double entry for your ServerName and your ServerAlias.
Lower case e execCGI to uppercase E ExecCGI.
Lower case <directory> to upper case <Directory>
AllowOverride None to AllowOverride All


Edit by dragging into your open text editor C:\Windows\system32\drivers\etc\Hosts file and making sure that the first lines look like this after the commented section.
Code: Select all
127.0.0.1 localhost
127.0.0.1 blogux.net
127.0.0.1 envitrina.cl


Let me know back if the above works and I can check from the Internet from here if all is working.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: [Really need help!] Problems with VirtualHosts

Postby narox » 13. March 2009 22:40

well... thanks!

all its ok... i can see the images.. i can see all and that's all ok...

well really i don't know what to say.. hmmm well.. izzi and make-fun... a last question.. can i add karma to your users or give points or something else that i can do for you two??

well really thanks... im so happy :)

well.. bye ;)
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Re: [Really need help!] Problems with VirtualHosts

Postby Izzy » 14. March 2009 04:28

Your welcome and thanks for posting back that all is now working - I checked your sites from here and both display well.

No karma or points needed and not available anyway on this forum.

Good luck and now enjoy your XAMPP experience.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: [Really need help!] Problems with VirtualHosts

Postby narox » 14. March 2009 22:17

well, bye.. thanks you all!! :)
narox
 
Posts: 6
Joined: 09. March 2009 02:06

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 234 guests