Webserver & Bind9 on OnionPi

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
dp2313265939
 
Posts: 11
Joined: Fri Apr 03, 2015 7:26 am

Webserver & Bind9 on OnionPi

Post by dp2313265939 »

Hey!

So I followed the exact instructions for the OnionPi and it works great! My problem is that I'm trying to throw a web server on there and allow it to be accessed through the AP (192.168.42.1). However, the web server works (PHP+Apache+MySQL) when I view it from the LAN side at 192.168.2.102 [IP of the OnionPi from my router]. Everything is followed to a T with the instruction on this website for OnionPi and it's just a default install of PHP, Apache, and MySQL.

It doesn't work when I connect to the AP (192.168.42.1) and go to http://192.168.42.1 .
Trying to clarify so it's not too confusing, here is my setup:
Internet(192.168.1.1[running off neighbours]) -> Router (192.168.2.1) -> (192.168.2.102)-OnionPi-(192.168.42.1)-> (192.168.42.11)Computer

So, when the computer is connected to the router (192.168.2.1) and I look at http://192.168.2.102 I can see the web page
When I connect to the OnionPi (192.168.42.1) and look at http://192.168.42.1 I don't see the web page.

I was told to use bind9 but I can't seem to get that to work either. Here is what I did with the bind9 server

named.conf.local:

Code: Select all

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "onion.pi" {
        type master;
        file "/etc/bind/db.onion.pi";
        allow-update { key rndc-key; };
      };

zone "42.168.192.in-addr.arpa" {
        type master;
        notify no;
        file "/etc/bind/db.192";
        allow-update { key rndc-key; };
      };
db.onion.pi

Code: Select all

;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	www.onion.pi. root.localhost. (
			      2		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	www.onion.pi
www	IN	A	192.168.42.1
db.192

Code: Select all

;
; BIND reverse data file for local loopback interface
;
$TTL	604800
@	IN	SOA	www.onion.pi. root.localhost. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	www.
1	IN	PTR	www.onion.pi.
forward is enabled under named.conf.options to 8.8.8.8 & 8.8.4.4

When I run a dig command to onion.pi this is what I get

Code: Select all

dig onion.pi

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> onion.pi
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 39819
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;onion.pi.			IN	A

;; Query time: 178 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed Apr 22 00:57:08 2015
;; MSG SIZE  rcvd: 26
Can anyone help me?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Webserver & Bind9 on OnionPi

Post by adafruit_support_mike »

You'll probably need to move the webserver to another port and open an exception for that in the port forwarding rules.

The instructions will be the same as the ones for DNS and SSH in the tutorial. The usual alternate ports for webservers are 8000 and 8080.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”