tv_channels Unauthorized request

426 views
Skip to first unread message

Vesselin Petkov

unread,
Jul 27, 2014, 4:20:46 AM7/27/14
to stalker-m...@googlegroups.com
Hi,

I'm developing android app to communicate with stalker_portal, for now using ubuntu image from your site. I've set user in admin portal, set also service package, tariff plan and group.
Authentication is OK but when call http://xx.xx.xx.xx:88/stalker_portal/api/api_v2/users/2/tv_channels response is {"status":"ERROR","results":"","error":"401 Unauthorized request"}. Also set enable_tariff_plans = true in server/custom.ini. Where should be the problem? Any help is welcome.

If someone can send me all settings, with some description, that should be made to configuration files in nginx, stalker_api and apache to communicate with my app will be great.

Thanks in advance and Regards,
Veselin Petkov

Vesselin Petkov

unread,
Jul 27, 2014, 5:53:25 AM7/27/14
to stalker-m...@googlegroups.com

Or, please,  just give me an image of full set ubuntu server. I'm stuck.

Aleksey Zhurbitsky

unread,
Jul 28, 2014, 8:07:50 AM7/28/14
to stalker-m...@googlegroups.com
http://xx.xx.xx.xx:88/stalker_portal/api/api_v2/users/2/tv_channels
URL should be 

On Sunday, July 27, 2014 11:20:46 AM UTC+3, Vesselin Petkov wrote:

Vesselin Petkov

unread,
Jul 28, 2014, 9:52:38 AM7/28/14
to stalker-m...@googlegroups.com
Ok, but which are the next steps to configure sub domain? How exactly should be done? I'm using bridge to ubuntu virtual machine.

Vesselin Petkov

unread,
Jul 28, 2014, 9:58:59 AM7/28/14
to stalker-m...@googlegroups.com
If you give examples should be great :)

Aleksey Zhurbitsky

unread,
Jul 28, 2014, 10:01:10 AM7/28/14
to stalker-m...@googlegroups.com
On server you should use virtual hosts (in apache)
If this is not real server with domain name you can use fake name and add it to your hosts file e.g. for linux add to the /etc/hosts line
v2.api.example.com 192.168.1.1

Aleksey Zhurbitsky

unread,
Jul 28, 2014, 10:04:31 AM7/28/14
to stalker-m...@googlegroups.com
The simpliest apache config for api host

<VirtualHost *:88>
    DocumentRoot /var/www/stalker_portal/api
    ServerName v2.api.example.com
</VirtualHost>

zaio sarafimov

unread,
Jul 28, 2014, 1:03:46 PM7/28/14
to stalker-m...@googlegroups.com
ok but i don't have a domain my test server is in Canada and i use the IP to access it
how can i make a sub domain for IP

Aleksey Zhurbitsky

unread,
Jul 29, 2014, 3:31:24 AM7/29/14
to stalker-m...@googlegroups.com
how can i make a sub domain for IP

use this method
If this is not real server with domain name you can use fake name and add it to your hosts file e.g. for linux add to the /etc/hosts line
v2.api.example.com 192.168.1.1 

Message has been deleted

Vesselin Petkov

unread,
Jul 31, 2014, 4:43:02 AM7/31/14
to stalker-m...@googlegroups.com
Hi again,

Working with the virtual machine,
on hosts file I added
127.0.0.1   v2.api.vpetkovtest.com

now it looks like
127.0.0.1    localhost
127.0.0.1   v2.api.vpetkovtest.com
127.0.1.1    stalker-test

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00
::0 ip6-localnet
ff00
::0 ip6-mcastprefix
ff02
::1 ip6-allnodes
ff02
::2 ip6-allrouters

here is /etc/apache2/sites-available/default content
<VirtualHost *:88>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
   
<Directory />
        Options FollowSymLinks
        AllowOverride None
   
</Directory>
   
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
   
</Directory>


    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   
<Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
   
</Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
   
<Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
   
</Directory>
   

</VirtualHost>

created vpetkovtest file on /etc/apache2/sites-available with following content
<VirtualHost *:88>
ServerName v2.api.vpetkovtest.com

DocumentRoot /var/www/stalker_portal/api/

<Directory /var/www/stalker_portal/api/>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
</Directory>

</VirtualHost>

then run
sudo a2ensite vpetkovtest

reloaded apache and still nothing, I can't reach v2.api.vpetkovtest.com.
Am I missing something?Any ideas?

Aleksey Zhurbitsky

unread,
Jul 31, 2014, 9:27:40 AM7/31/14
to stalker-m...@googlegroups.com
127.0.0.1   v2.api.vpetkovtest.com
You should add such line on your computer, not on server, and specify the real ip (not 127.0.0.1)
Reply all
Reply to author
Forward
0 new messages