Page 1 of 1

Please help!!!, does not see the Internet virtual hosts xamp

PostPosted: 23. October 2014 16:37
by dremor
does not see the Internet virtual hosts xampp - xampp opens his folder htdocs !, but on the LAN sees these hosts!
xampp running on linux mint, dns server - win2003, proxy - zentyal. a couple of days already struggling, do not understand what I'm doing wrong? :cry:
I need to host multiple sites using xampp and the Internet to access it.

Thank you all in advance!

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 23. October 2014 21:01
by Nobbie
Sorry, but its hard to understand anything. WIll you please explain better?

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 02:54
by dremor
create a virtual host in xampp(httpd-vhosts.conf)

---httpd.conf
Include etc/extra/httpd-vhosts.conf

---content httpd-vhosts.conf
<VirtualHost 127.0.0.2:80>
ServerAdmin mail@site.ru
DocumentRoot "/opt/lampp/htdocs/site.ru/www"
ServerName www.site.ru
ServerAlias www.site.ru
ErrorLog "/opt/lampp/htdocs/www.site.ru/error.log"
CustomLog "/opt/lampp/htdocs/www.site.ru/access.log"
</VirtualHost>

<VirtualHost 127.0.0.2:80>
ServerAdmin mail@site.ru
DocumentRoot "/opt/lampp/htdocs/site2.ru/www"
ServerName www.site2.ru
ServerAlias www.site2.ru
ErrorLog "/opt/lampp/htdocs/www.site2.ru/error.log"
CustomLog "/opt/lampp/htdocs/www.site2.ru/access.log"
</VirtualHost>

---content host
127.0.0.1 localhost
127.0.0.2 www.site.ru
---

in the localhost - site opens at its address www.site.ru directory /opt/lampp/htdocs/site.ru/www
in the localhost - site opens at its address www.site2.ru directory /opt/lampp/htdocs/site2.ru/www

in the internet - site opens at its address www.site.ru directory /opt/lampp/htdocs/
in the internet - site opens at its address www.site2.ru directory /opt/lampp/htdocs/

I need to have:
in the internet - site opens at its address www.site.ru directory /opt/lampp/htdocs/site.ru/www
in the internet - site opens at its address www.site2.ru directory /opt/lampp/htdocs/site.ru/www
---
what am I doing wrong?

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 08:20
by Altrea
Don't mix IP based and namebased vhosts.
Don't match your vhosts to 127.0.0.2

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 08:44
by dremor
So it is correct? example, you can, please?
What do I need to be seen a few sites from the Internet?

---content httpd-vhosts.conf
<VirtualHost 127.0.0.1:80>
ServerAdmin mail@site.ru
DocumentRoot "/opt/lampp/htdocs/site"
ServerName site.ru
ServerAlias www.site.ru
ErrorLog "/opt/lampp/htdocs/www.site.ru/error.log"
CustomLog "/opt/lampp/htdocs/www.site.ru/access.log"
</VirtualHost>

---content host
127.0.0.1 localhost
127.0.0.1 www.site.ru

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 09:53
by Altrea
No.

dremor wrote:<VirtualHost 127.0.0.1:80>

This line only matches if the request is for IP 127.0.0.1 on port 80 (which can never be true for external requests)

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 10:21
by dremor
thank you very much! now everything is fine :D

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 10:25
by Nobbie
Additionally, you did not define a VirtualHost for localhost (i cannot see any), therefore localhost is unknown for Apache and instead the default VirtualHost (i.e. the first one) is taken.

You MAY mix ip based and namebased VirtualHosts (this is not a problem, you must use different IPs), but as already said, if you use ip based VirtualBox, you should assign the LAN IP instead 127.0.0.1 (or the external WAN IP, if your server is connected directly to the internet instead via a router).

If your server is connected via a router, you also have to activate a port forwarding in your router for port 80 to your server PC.

Finally: Xampp is NOT meant for online access, it is unsafe.

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 12:20
by dremor
properly configured xampp also not safe?
Zend Server is better?
advise anything?

Re: Please help!!!, does not see the Internet virtual hosts

PostPosted: 24. October 2014 12:37
by Altrea
dremor wrote:properly configured xampp also not safe?

define "properly configured".

dremor wrote:Zend Server is better?

way better.
But recommend is to install and configure all the single components on your own (most recommend on a Linux system)