Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: IP access to website
PostPosted: Tue Jan 15, 2013 7:14 am 
Offline
Newbie

Joined: Tue Jan 15, 2013 7:03 am
Posts: 3
Hello

Im running a Linode512 with a LAMP stack and two domains.

Im doing a project where i need to get some JSON data from a PHP script to an Arduino micro-controller. The Arduino does not support DNS so i have to access the php via the IP address of my linode. But when i try to access the ip the only thing i get is a "Restricted Area" popup in my browser.

Is there some way of pointing that IP to the root of the Linode or some other workaround?

Im new and currently learning, so please bare with me ;)

All help is much appreciated!


Each domain is set up like this:

/etc/apache2/sites-available/domain.one

<VirtualHost *:80>
ServerAdmin email@domainone.com
ServerName domainone.com
ServerAlias www.domainone.com
DocumentRoot /srv/www/domainone.com/public_html/
ErrorLog /srv/www/domainone.com/logs/error.log
CustomLog /srv/www/domainone.com/logs/access.log combined
</VirtualHost>


/etc/apache2/sites-available/domaintwo.com

<VirtualHost *:80>
ServerAdmin email@domaintwo.com
ServerName domaintwo.com
ServerAlias www.domaintwo.com
DocumentRoot /srv/www/domaintwo.com/public_html/
ErrorLog /srv/www/domaintwo.com/logs/error.log
CustomLog /srv/www/domaintwo.com/logs/access.log combined
</VirtualHost>


Top
   
 Post subject: Re: IP access to website
PostPosted: Tue Jan 15, 2013 8:44 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Apache will direct clients accessing the server via the IP address to the default site (the first one you see by running ls -l /etc/apache2/sites-enabled on Debian or Ubuntu). Take a look at that config file to see where clients are being directed. It may be that your web application is generating an error if accessed without a host name.

You could create a config file in /etc/apache2/sites-available called something like "000-default" to send the Arduino (and anyone else accessing the server by IP address) to a location containing the JSON data.


Top
   
 Post subject: Re: IP access to website
PostPosted: Tue Jan 15, 2013 10:13 am 
Offline
Newbie

Joined: Tue Jan 15, 2013 7:03 am
Posts: 3
Thank you so much for your reply.

The IP was directing on a subdomain protected by password (.htpasswd) which of course coursed the "Restricted Area" popup.

So i can setup the "000-default" config file like i did with domainone.com and domaintwo.com and direct to a specific folder?


Top
   
 Post subject: Re: IP access to website
PostPosted: Tue Jan 15, 2013 10:54 am 
Offline
Newbie

Joined: Tue Jan 15, 2013 7:03 am
Posts: 3
I believe i solved it.

/etc/apache2/sites-available/default was not enabled. It is know and i can point it to where i want.

Thank you so much for your help and have a nice day :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group