Virtual Hosts Support Plz

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

Virtual Hosts Support Plz

Postby mylocalhost » 12. December 2006 07:32

Hello.
i'v gown throw this entire fourm seaching on how to setup a Virtual Hosts
and no one can conect to it . i am running windows Xp Pro SP2 Latest version of Xampp . i do not whant to run a domain only a ipaddress this is only for privet use between my and my designer Friends.

I have changed the port to 8080 didint work and to 81 dont work
i am using satlight internet . and running on a 5 port network hub
My windows fire wall is turned off and i am not running any othere fire walls eathere does my Network hub or my modom have a fire wall on
can some one plz take a look at my virtual host config let me know if its corect or not ot tell me what i am doing wrong

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 67.142.130.12:81

#
# 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 67.142.130.12:81>
##    ServerAdmin webmaster@67.142.130.12
##    DocumentRoot C:/Program Files/xampp/
##    ServerName 67.142.130.12
##    ServerAlias 67.142.130.12
##    ErrorLog C:/Program Files/xampp/htdocs/xampp/error_log
##    CustomLog C:/Program Files/xampp/htdocs/xampp/access_log common
##    indexOptions +fancyIndexing NameWide=*
##    Allow Override All
##    Order Allow,deny
##    allow from all
##</VirtualHost>





Code: Select all
mylocalhost
 
Posts: 4
Joined: 12. December 2006 06:55

Postby Izzy » 12. December 2006 07:44

You need to remove the comment marks ## from infront of the lines you want to use.
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 67.142.130.12:81

#
# 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 67.142.130.12:81>
    ServerAdmin webmaster@67.142.130.12
    DocumentRoot C:/Program Files/xampp/
    ServerName 67.142.130.12
##    ServerAlias 67.142.130.12
    ErrorLog C:/Program Files/xampp/htdocs/xampp/error_log
    CustomLog C:/Program Files/xampp/htdocs/xampp/access_log common
    indexOptions +fancyIndexing NameWide=*
    Allow Override All
    Order Allow,deny
    allow from all
</VirtualHost>


Don't think you need a ServerAlias in your case.

Don't forget to save your changes then restart Apache.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Mr. Izzy

Postby mylocalhost » 12. December 2006 08:14

Mr.Izzy i have tryed that and apache doesnt whant to start with the ## tooken out
Izzy wrote:You need to remove the comment marks ## from infront of the lines you want to use.
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 67.142.130.12:81

#
# 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 67.142.130.12:81>
    ServerAdmin webmaster@67.142.130.12
    DocumentRoot C:/Program Files/xampp/
    ServerName 67.142.130.12
##    ServerAlias 67.142.130.12
    ErrorLog C:/Program Files/xampp/htdocs/xampp/error_log
    CustomLog C:/Program Files/xampp/htdocs/xampp/access_log common
    indexOptions +fancyIndexing NameWide=*
    Allow Override All
    Order Allow,deny
    allow from all
</VirtualHost>


Don't think you need a ServerAlias in your case.

Don't forget to save your changes then restart Apache.
mylocalhost
 
Posts: 4
Joined: 12. December 2006 06:55

Postby Izzy » 12. December 2006 08:32

I wasn't concentrating on your vhost file. You had some syntax errors.
Try this ammended version:

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 67.142.130.12:81

#
# 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 67.142.130.12:81>
ServerName 67.142.130.12
DocumentRoot "C:/Program Files/xampp/htdocs"
ServerAdmin webmaster@67.142.130.12
<Directory "C:/Program Files/xampp/htdocs">
Options Indexes +FollowSymLinks Includes ExecCGI
indexOptions +fancyIndexing NameWide=*
Allow Override All
Order Allow,deny
allow from all
</Directory>
ErrorLog C:/Program Files/xampp/htdocs/xampp/error.log
CustomLog C:/Program Files/xampp/htdocs/xampp/access.log common
</VirtualHost>


Save and restart Apache.

If Apache won't start then issue this command:
apache -S
(Start/Run../cmd.exe then cd to your C:\Program Files\xampp\apache\bin directory)

Paste the results here.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby mylocalhost » 12. December 2006 09:02

didint work

Izzy wrote:I wasn't concentrating on your vhost file. You had some syntax errors.
Try this ammended version:

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 67.142.130.12:81

#
# 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 67.142.130.12:81>
ServerName 67.142.130.12
DocumentRoot "C:/Program Files/xampp/htdocs"
ServerAdmin webmaster@67.142.130.12
<Directory "C:/Program Files/xampp/htdocs">
Options Indexes +FollowSymLinks Includes ExecCGI
indexOptions +fancyIndexing NameWide=*
Allow Override All
Order Allow,deny
allow from all
</Directory>
ErrorLog C:/Program Files/xampp/htdocs/xampp/error.log
CustomLog C:/Program Files/xampp/htdocs/xampp/access.log common
</VirtualHost>


Save and restart Apache.

If Apache won't start then issue this command:
apache -S
(Start/Run../cmd.exe then cd to your C:\Program Files\xampp\apache\bin directory)

Paste the results here.
mylocalhost
 
Posts: 4
Joined: 12. December 2006 06:55

Postby Izzy » 12. December 2006 09:16

mylocalhost wrote:didint work

What didn't work?
Where is the pasted result of apache -S

I can't help you unless you follow what I ask you to do. It is pointless. You have to be my eyes as I can't see on your PC what you see from here.

Also you don't need a virtual host file to do what you want to do. The defaults in the httpd.conf file will do it.

If you can't access http:/67.142.130.12:81 on port 80 then change it in the httpd.conf file by changing
Listen 80
to
Listen 67.142.130.12:81 or what ever port you want to use.
Then use the new port in your address for example http://67.142.130.12:81

Also you will have to re-comment ## out your httpd-vhosts.conf file to it's back to the default state.

If non of that works then you have either a firewall or router issue.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Mr.Izzy

Postby mylocalhost » 12. December 2006 09:49

Apache -s
Code: Select all
C:\Program Files\xampp\apache\bin>apache -S
VirtualHost configuration:
67.142.130.12:8080     is a NameVirtualHost
         default server 67.142.130.12 (C:/Program Files/xampp/apache/conf/extra/
httpd-vhosts.conf:28)
         port 8080 namevhost 67.142.130.12 (C:/Program Files/xampp/apache/conf/e
xtra/httpd-vhosts.conf:28)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          localhost (C:/Program Files/xampp/apache/conf/extra/httpd
-ssl.conf:74)
Syntax OK


When i try to conect at first it started then stoped so i changed the port from 81 to 8080 and it still whont let me conect what do i have to do know Mr.izzy

I dont have a Router . im running for a network hub no firwars turned on all shut down

Know i cant even access it throw http://localhost
mylocalhost
 
Posts: 4
Joined: 12. December 2006 06:55

Postby Izzy » 12. December 2006 10:13

Create a directory in xampp\htdocs\ called myhost so it looks like this:
xampp\htdocs\myhost\
Now put an index.html file in there with some content in the file so it will be seen when you type the address.

Now change these 2 directory lines in your httpd-vhosts.conf file to:

DocumentRoot "C:/Program Files/xampp/htdocs/myhost"
and
<Directory "C:/Program Files/xampp/htdocs/myhost">

Save the file and try and restart Apache.
If it won't start paste the apache -S command again.
Now try your http://67.142.130.12:8080 if apache starts.

Also you can paste here the results of the command apache -t so I can check the syntax of the httpd.conf file.
Did you make any changes in the httpd.conf file?


Edit:
Try this:
Code: Select all
<VirtualHost 127.0.0.1:80>
ServerName localhost
DocumentRoot "C:/Program Files/xampp/htdocs"
</VirtualHost>

NameVirtualHost 67.142.130.12:80

<VirtualHost 67.142.130.12:80>
ServerName 67.142.130.12
DocumentRoot "C:/Program Files/xampp/htdocs/myhost"
ServerAdmin webmaster@67.142.130.12
<Directory "C:/Program Files/xampp/htdocs/myhost">
Options Indexes +FollowSymLinks Includes ExecCGI
indexOptions +fancyIndexing NameWide=*
Allow Override All
Order Allow,deny
allow from all
</Directory>
ErrorLog C:/Program Files/xampp/htdocs/xampp/error.log
CustomLog C:/Program Files/xampp/htdocs/xampp/access.log common
</VirtualHost>

So localhost goes to your default XAMPP directory.
Your 67.142.130.12 host goes to the myhost directory.
We can change this later as this is just for testing.

You will now have http://localhost and http://67.142.130.12 working.

Just make sure you have an index.html or index.php in the myhost directory.

Your IP 67.142.130.12 resolves to nlv-webproxy02.direcpc.com which is now Hughesnet.
This from their [url=http://legal.hns.com/HUGHES/Rooms/DisplayPages/layoutInitial?Container=com.webridge.entity.Entity[OID[495C47F0021DB84DAFCE2C8F9C99D2D9]Acceptable Use Policy[/url]:

2.2 OTHER PROHIBITED CONDUCT.

You agree not to use the Service as follows:
...(r) to use your HughesNet account for the purpose of operating a server of any type;...


So the chances of your ISP restricting your use of server ports is high.

You have to make sure that your ISP is not blocking ports to prevent you from running a server.

Some ISP block Ports 80 81 8080 and others like 25 443 etc are all fair game to be blocked or restricted.

If you continue to get problems even though we know your conf files are OK then you must try an obscure port like 11893 or some other port you like to use that is unusual. This may be the only way to work around this issue bearing in mind that if you run a server even if it is for friends, then you may be violating the AUP.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 58 guests