[Problem]Hosting public website using XAMPP

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

[Problem]Hosting public website using XAMPP

Postby yolkie » 25. August 2010 05:49

Hello Everyone,

I have developed a website using XAMPP. The root folder is C:\Xampp\htdocs\website I already have a static IP as well as a registered domain name.

I need to know how do i point my public IP into XAMPP?
For example, my public IP (static) is 203.125.100.100

It is to be configured such that when visitors from anywhere types in http://203.125.100.100 in a browser, it will be pointed to the website hosted by the XAMPP server (NAT). The XAMPP server IP is 192.168.42.45 (Internal network)

I have already configured the rules inside my firewall: From external to Internal, doing a NAT 203.125.100.100 > 192.168.42.45, as well as unblocking port 80 and 403 (read it from somewhere you have to unblock port 403)

This is the config i edited, not sure if it is right:

#
# 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 192.168.42.45: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 192.168.42.45:80>
ServerAdmin yolkie@email.com
DocumentRoot "C:/xampp/htdocs/website"
ServerName 192.168.42.45
ErrorLog "C:/xampp/apache/logs/error1.log"
CustomLog "C:/xampp/apache/logs/access1.log" combined
</VirtualHost>

##<VirtualHost *:80>
##ServerAdmin postmaster@dummy-host2.localhost
##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"
##ServerName dummy-host2.localhost
##ServerAlias www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>

Can anyone help me out please?

Thank you in advance, sir.

Rgds,
YOlkie
yolkie
 
Posts: 4
Joined: 25. August 2010 05:36

Re: [Problem]Hosting public website using XAMPP

Postby glitzi85 » 25. August 2010 10:13

First of all: You know, that XAMPP is NOT (i repeat: NOT) designed to be used on a public Server! Unless you really know what you have to do (and I don't think you do) you should NOT use XAMPP as a public Webserver!

NameVirtualHost is only necessary, if you really have Named vHosts. That means, that you have more than one VirtualHost-Block per IP. Delete the NameVirtualHost-Line.

Port 403 is not used by XAMPP in any way. Maybe you mean Port 443, that would be HTTPS.

And the final question: What's the question here? Why didn't you just try it?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: [Problem]Hosting public website using XAMPP

Postby yolkie » 25. August 2010 13:15

Thanks glitzi for your response.

You are right, I do not know what I am doing as this hosting of website using xampp is recommended by another vendor. I am to find out solution of pointing this ip address from externally NAT to internal.

So my question is, how do I map my public ip to point to xampp hosting the website? (if there is such method)

I am really clueless about xampp. My vendor is trying to fin the solution too.

-edit-
it is not a public webserver. It is a website hosted internally, to be accessed by people externally, protected by a hardware firewall to allow public ip to do NAT, to the xampp server
yolkie
 
Posts: 4
Joined: 25. August 2010 05:36

Re: [Problem]Hosting public website using XAMPP

Postby JonB » 25. August 2010 13:59

it is not a public webserver. It is a website hosted internally, to be accessed by people externally,


I think you mean "its not on a public webhosting service" because if people off your LAN can access it, it is for sure a 'public webserver'.

And well - since we acknowlege that Gltizi is basically correct; I guess it can't hurt to say the answer:

Turn on Port Forwarding on your router/fireawll for Port 80.
Point to the internal (LAN) IP of your XAMPP server.
In order to not be really stupid, be sure your XAMPP server had a fixed local IP.

Which is what you say you have already done.

I guess you should have outside your network someone test it. You may not be able to see your own site using your exterrnal IP on your own Network, this is because not all routers support NAT loopback.

Glitzi is alo right - unless you have a good reason, ditch the Vhosts stuff - its really a mechanism for hosting multiple webserver instances on the same Apache server.

~"tada"~

Good side -should work -

Bad side - Gltizi was right about 'bad idea', so many things will need to be done to shore up security. Since you have a 'vendor' you should ask them about that, and what 'their' plan is.

I has done my part on this one
:mrgreen:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: [Problem]Hosting public website using XAMPP

Postby darclear » 10. November 2010 23:46

I recently installed the new xampp over an older version. A virus had installed base64 code virus into all php documents on the webserver and i could not find old copy of xampp.

With the new xampp, its not allowing access to my site with the domain name. only the local 127.0.0.1. My website had been running fine for years on the old version, till i opened an email with the virus.... (never open attachment that says its a shipping label for a package you are expecting) How do i accept connections from the outside world? i have .htaccess documents in all relevant folders to deny who i dont want.
darclear
 
Posts: 2
Joined: 10. November 2010 23:41

Re: [Problem]Hosting public website using XAMPP

Postby JonB » 12. November 2010 06:27

I'm lost -

Are you asking us 'What changes do I need to makes in XAMPP to allow others to see my site who are not on my local network?"

or

Are you asking us 'What changes must I make to my network to allow others to see my properly configured XAMPP server"

In any case - we need some clarification, AND you are now getting the "you need to learn how to back up" lecture - :mrgreen:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: [Problem]Hosting public website using XAMPP

Postby darclear » 20. November 2010 06:38

Are you asking us 'What changes do I need to makes in XAMPP to allow others to see my site who are not on my local network?"


Yes, thats what i meant by outside world.. Did you miss that? Runs fine on local net, but cant accept outside connections with freshly installed xampp.
darclear
 
Posts: 2
Joined: 10. November 2010 23:41

Re: [Problem]Hosting public website using XAMPP

Postby Nobbie » 20. November 2010 10:55

Simply install your own documents, they will be accessible from outside.

Only the Xampp Admintools are protected by the new security concept, and a fresh Xampp contains only these Admintools. You should not change that (unless you are certainly sure about what you are doing there), if you do so, anybody may intrude into your Xampp and destroy MySQL Databases for example.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: [Problem]Hosting public website using XAMPP

Postby JonB » 20. November 2010 16:16

@ nobbie - I think darclear is saying his documents ARE installed.

@darclear -

i could not find old copy of xampp.
All the prior versions of XAMPP are available on the SourceForge project.
http://sourceforge.net/projects/xampp/f ... 20Windows/

I didn't get it back then, because you were not clear enough. You didn't say what errors are encountered when you enter your domain in a browser on a machine that is not on your network. You did test externally, right??? What was the error? That error will likely tell what is wrong.

A freshly installed XAMPP copy installed behind a router with port-forwarding on, and an exception made in the installed firewall needs NO CHANGES - it is open by default - I think that's what Nobbie is trying to say.

For now - Check your firewall and/or security software. Also check that router port-forwarding is on. You might want to try pinging your IP/domain to see what errors are generated.

:)

pfs
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 149 guests