Project

General

Profile

RE: Webroot setup for Ubuntu package (apache reverse proxy) ยป serverconnexhowto.txt

HowTo Configure server connectivity variables for wiki - nick cross, 2014-01-22 11:42

 
1
??h1. HowTo Configure server connectivity variables (such as Ports and WebRoot):
2

3

4

5
h2. Find the startup option you require.
6

7
You can change certain variables when starting tvheadend, to see a full list execute:
8

9
<code>
10

11
/etc/default/tvheadend -h
12

13
</code>
14

15
The variables we are interested in are as follows:
16

17
<code>
18

19
Server Connectivity
20

21
  -6, --ipv6                  Listen on IPv6
22

23
      --http_port             Specify alternative http port
24

25
      --http_root             Specify alternative http webroot
26

27
      --htsp_port             Specify alternative htsp port
28

29
      --htsp_port2            Specify extra htsp port
30

31
</code>
32

33
These are all fairly self explanatory, you can set the server to listen on ipv6, adjust the http port, add a webroot to all URLs, adjust the htsp port and add an extra htsp port.  The webroot option is *required* to place tvheadend behind a reverse proxy. 
34

35

36

37
h2. Adjusting upstart/service variables (after installing the maintained package on Ubuntu for example):
38

39

40

41
To add startup options to your newly installed Ubuntu package edit the @/etc/init/tvheadend.conf@ file.
42

43

44

45
p(.Goto the line:
46

47
<code>ARGS="-f"</code>
48

49
This currently only contains @-f@ which will @Fork and run as daemon@. Add your desired options between the quotes, for example to add a webroot @/tv@:
50

51
<code>ARGS="-f --http_root /tv"</code>
52

53

54

55
The restart the service and browse to your previous tvheadend URL but with the /tv suffix.
56

57

58

59
h2. Configuring an Apache reverse proxy with a tvheadend WebRoot:
60

61

62

63
Once your webroot is added to your tvheadend startup options you can use a reverse proxy to access it, this will allow you to access tvheadend on a port that may be in use by multiple services and a webserver; this port may also be accessible from the internet.
64

65

66

67
There are a few ways to configure a reverse proxy, this example is using our previously configured webroot @/tv@:
68

69

70

71
<code>
72

73
<Location /tv>
74

75
order deny,allow
76

77
deny from all
78

79
allow from all
80

81
ProxyPass http://localhost:9981/tv
82

83
ProxyPassReverse http://localhost:9981/tv
84

85
</Location>
86

87
</code>
88

89

90

91
In this case tvheadend will now be accessible on port 80 at http://localhost/tv
    (1-1/1)