typing the ip adress goes to xampp index!

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

typing the ip adress goes to xampp index!

Postby utan » 03. June 2009 00:25

Ok so i have xampp runing and its wonderful , i have setup the vhost directive, this is how it looks like:

<VirtualHost *:80>
ServerAdmin localhost@localhost.com
DocumentRoot /opt/lampp/htdocs
ServerName localhost
ServerAlias localhost
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin website@website.com
DocumentRoot /opt/lampp/htdocs/website1.com
ServerName http://website1.com
ServerAlias website1.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin website2@website2.com
DocumentRoot /opt/lampp/htdocs/website2
ServerName http://website2.com
ServerAlias http://www.website2.com
</VirtualHost>

now the issue is that if you type the IP adress it goes to xampp directory, it wont work cuz the security placed in xampp is good, but then if you type http://www.website2.com it goes to xampp index. i have setup the dns adress fine,
I have yahoo dns servive and this is how it looks like:
A Record *.website2.com ip Edit | Delete
A Record website2.com ip ip Edit | Delete
A Record www.website2.com ip

what i am missing that www.website2.com or http://www.website2.com goes to xampp ,
should i make another <virtualhost>
with server name www.website2.com
</virtualhost>
or whats wrong, also i have the virtual host becouse if i dont do so, i cant access the xamp server at my private IP...

thanks for the help hope you know what i am talking about..
You are invited to visit my site ...http://radioscatrachas.info

thanks a lot..
utan
 
Posts: 14
Joined: 02. June 2009 19:44

Re: typing the ip adress goes to xampp index!

Postby utan » 03. June 2009 18:37

So i fixed the problem when you typed the www. or the http://www it would go to the xampp directory intead of website2.com...
the problem was in the directive "ServerAlias", to get the site to work as www or http://www you must use the ServerAlias *.website2.com.

<VirtualHost *:80>
ServerAdmin website2@website2.com
DocumentRoot /opt/lampp/htdocs/website2
ServerName website2.com
ServerAlias *.website2.com
</VirtualHost>

that fixed the problem above, bu i couldnt fix that typing my ip it would bring you to the xampp page, i will try to fine a way to fix that myself, when i have it i'll post here.... thanks, for the record the virtual host configuration its at /opt/lampp/etc/extra/
thanks will return later with my finds
You are invited to visit my site ...http://radioscatrachas.info

thanks a lot..
utan
 
Posts: 14
Joined: 02. June 2009 19:44

Re: typing the ip adress goes to xampp index!

Postby Sharley » 03. June 2009 22:45

You are missing a NameVirtualHost *:80 Directive entry before your first localhost container which makes your vhost configuration an IP-based vhost that is missing an IP for each vhost - so you are being served the default vhost which is the XAMPP index.php at localhost.
http://httpd.apache.org/docs/2.2/vhosts/

Also you don't need a ServerAlias for ServerName localhost:
ServerName localhost
ServerAlias localhost
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: typing the ip adress goes to xampp index!

Postby utan » 04. June 2009 19:58

Hi thanks for your reply...

indeed i have setup NameVirtualHost *:80 before my <virtualhost>
so i dont really know what your talking about, still typing my ip goes to my xampp folder....
thanks again.
You are invited to visit my site ...http://radioscatrachas.info

thanks a lot..
utan
 
Posts: 14
Joined: 02. June 2009 19:44

Re: typing the ip adress goes to xampp index!

Postby utan » 06. June 2009 18:10

So i have manage to hide the website, when someone type my IP addres, I have deleted the Index.php that redirect you to the xampp folder, so when someone type the ip it will just get white space, its a good workaround, I cant access the xampp index by private Ip in network and tweak from there... thanks for the help people... :D
You are invited to visit my site ...http://radioscatrachas.info

thanks a lot..
utan
 
Posts: 14
Joined: 02. June 2009 19:44


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests