Changes between Version 2 and Version 3 of Ubuntu-16.04-Git
- Timestamp:
- Oct 26, 2017, 9:55:07 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ubuntu-16.04-Git
v2 v3 1 = Install Trac on Ubuntu proxied by Nginx = 1 = Install Trac on Ubuntu proxied by Nginx 2 2 3 [[PageOutline(2-5,Contents,pullout)]] 3 4 4 How to install and run a single hosted Trac project from https://trac.edgewall.org 5 6 This guide should apply for the following debian variations:5 This is a guide on how to install and run a single hosted Trac project from https://trac.edgewall.org with Nginx as the proxy server. 6 7 This guide should apply for the following Debian-based Linux distributions: 7 8 * Debian 9 8 9 * Ubuntu 16.04 … … 11 12 * !LinuxMint 18.2 12 13 13 Here is a somewhat basic copy paste #!bash script for this, however, there will be some manual labor for you :P but a find+replace would help you a lot. Be aware you might run all of these commands with the `sudo -H`14 Here is a somewhat basic copy paste bash script for this. However, there will be some manual steps, but a find+replace will help a lot. Be aware you might run all of these commands with the `sudo -H`. 14 15 15 16 {{{#!div class="important" 16 ** important** remember to replace the `https://trac-hacks.org/svn/fullblogplugin/0.11` with [https://trac-hacks.org/wiki/FullBlogPlugin latest verion]17 }}} 18 19 {{{#! bash17 **Notice**: Remember to replace the `https://trac-hacks.org/svn/fullblogplugin/0.11` with the plugin's [https://trac-hacks.org/wiki/FullBlogPlugin latest verion]. 18 }}} 19 20 {{{#!sh 20 21 apt-get install subversion libapache2-mod-python pypy python python-babel trac python-pip -y 21 22 pip install --upgrade pip … … 34 35 35 36 trac-admin /var/www/trac initenv 36 37 }}} 38 Follow the trac-admin guide. ..39 40 Now lets test the trac before we do more41 {{{#! bash37 }}} 38 39 Follow the trac-admin guide. 40 41 Now lets test the Trac installation before we do anything else: 42 {{{#!sh 42 43 tracd --port 8000 /var/www/trac 43 44 lynx localhost:8000/trac 44 45 }}} 45 46 46 Great it's working, then it's time to setup a admin user and password for the admin account. Bad luck if it doesn't as that is beyond this wiki and you'll need to go https://duckduckgo.com to find a solution :( 47 48 {{{#!bash 47 If it's working, then it's time to setup a admin user and password for the admin account. If it doesn't work, then that is beyond this wiki and you'll need to consult internet resources for a solution. 48 49 Run the following to create the admin user: 50 {{{#!sh 49 51 htpasswd -c /var/www/trac/.htpasswd adminusername 50 52 trac-admin /var/www/trac/ permission add adminusername TRAC_ADMIN 51 53 }}} 52 54 53 Replace `adminusername` with your desired username 54 55 Next we set the prop per user and group permissions on the Trac folder to allow the !Nginx/Apache/Trac server to access it56 57 {{{#! bash55 Replace `adminusername` with your desired username. 56 57 Next we set the proper user and group permissions on the Trac folder to allow the !Nginx/Apache/Trac server to access it: 58 59 {{{#!sh 58 60 chown -R UserName:GroupName /var/www/trac/ 59 61 chmod -R 775 /var/www/trac/ 60 62 }}} 61 63 62 == Preparation to Enable GIT source == 63 To enable git source browsing via Admin we need another subfolder 64 {{{#!bash 64 == Preparation to Enable Git source 65 66 To enable git source browsing via Admin we need another subfolder: 67 {{{#!sh 65 68 mkdir -p /var/www/trac/git 66 69 }}} … … 68 71 == Systemd startup script == #SystemD 69 72 70 In your `/etc/systemd/system/` make this new file -->71 {{{#! bash73 In your `/etc/systemd/system/` make this new file: 74 {{{#!sh 72 75 nano /etc/systemd/system/tracd.service 73 76 }}} 77 78 Then add the following to your `trac.ini` file: 74 79 {{{#!ini 75 80 [Unit] 76 Description =TrackD Daemon77 After =network.target81 Description = TrackD Daemon 82 After = network.target 78 83 79 84 [Service] 80 ExecStart =/usr/local/bin/tracd -p 3050 --protocol=http --basic-auth="*,/var/www/trac/.htpasswd,Restricted" -s /var/www/trac81 Type =simple82 User =UserName83 Group =GroupName85 ExecStart = /usr/local/bin/tracd -p 3050 --protocol=http --basic-auth="*,/var/www/trac/.htpasswd,Restricted" -s /var/www/trac 86 Type = simple 87 User = UserName 88 Group = GroupName 84 89 85 90 [Install] 86 WantedBy=multi-user.target 87 }}} 88 89 == Nginx configs == 90 Now it's time to do the NginX configureations :) 91 92 First we have to make a reverse proxy to the Trac daemon we have made in [#SystemD Systemd startup script] 93 94 In the `/etc/nginx/nginx.conf` we'll have to add a upstream for our reverse_proxy to Trac 91 WantedBy = multi-user.target 92 }}} 93 94 == Nginx configurations 95 96 Now it's time to do the NginX configurations. 97 98 First we have to make a reverse proxy to the Trac daemon we have made in [#SystemD Systemd startup script]. 99 100 In the `/etc/nginx/nginx.conf` we'll have to add a upstream for our reverse_proxy to Trac: 95 101 {{{#!nginx-conf 96 102 upstream live_trachosts_com { … … 99 105 }}} 100 106 101 Now make the site.conf file in your preferred location, which by default would be `/etc/nginx/conf.d/` for other it would be in `/etc/nginx/sites-available` but we go whit the default [[br]] 102 `nano /etc/nginx/conf.d/site.conf` 107 Now make the site.conf file in your preferred location, which by default would be `/etc/nginx/conf.d/`, for other it would be in `/etc/nginx/sites-available` but we go whit the default `nano /etc/nginx/conf.d/site.conf`: 103 108 104 109 {{{#!nginx-conf … … 131 136 } 132 137 }}} 133 == Apache == 134 And since you properly anyway use apache :( well here is that piece of code :( 135 136 {{{#!bash 138 139 == Apache 140 141 If you are using Apache as the webserver, then run the following: 142 {{{#!sh 137 143 a2enmod python 138 144 nano /etc/apache2/sites-available/trac.conf 139 145 }}} 140 146 141 {{{#!apacheconf 147 It should have the following content: 148 149 {{{#!apache 142 150 <VirtualHost 123.123.123.123:80> 143 151 ServerName trac.local … … 165 173 }}} 166 174 167 To enable the trac site run `a2ensite trac.conf` 168 169 == !Find/Replace == 170 The following paths is to be replaced with your preferences [[br]] 171 `/var/www/trac` --> `/full/path/to/trac` [[br]] 172 `adminusername` --> `YourUserName` to be used as the track admin [[br]] 173 `UserName` --> The username for which trac daemon runs as ex. `Your login UserName` [[br]] 174 `GroupName` --> The group name for which trac daemon runs as ex `www-data` [[br]] 175 `trac.local` --> `full.domain.tld` [[br]] 176 `live_trachosts_com` --> to what suits your needs [[br]] 177 `123.123.123.123` --> if you are running both NginX and Apache on port 80/443 you'll need to set the IP, but if you only runs Nginx or Apache you can delete the ip to listen on all address 178 179 == Versions == 180 In this tutorial I have used the following software versions 181 {{{#!bash 175 To enable the Trac site run `a2ensite trac.conf`. 176 177 == !Find/Replace 178 179 The following paths is to be replaced with your preferences: 180 * `/var/www/trac`: `/full/path/to/trac` 181 * `adminusername`: `YourUserName` to be used as the track admin 182 * `UserName`: The username for which trac daemon runs as ex. `Your login UserName` 183 * `GroupName`: The group name for which trac daemon runs as ex `www-data` 184 * `trac.local`: `full.domain.tld` 185 * `live_trachosts_com`: to what suits your needs 186 * `123.123.123.123`: if you are running both NginX and Apache on port 80/443, then you'll need to set the IP, but if you only run Nginx or Apache you can delete the IP address to listen on all addresses 187 188 == Versions 189 190 In this tutorial I have used the following software versions: 191 {{{#!sh 182 192 $ uname -a 183 193 Linux hostname 4.11.0-14-generic #20~16.04.1-Ubuntu SMP Wed Aug 9 09:06:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux … … 188 198 }}} 189 199 190 === Which list === 191 A complete HOWTO copy/paste guide to make Nginx running as "Front-end" of trac 200 === Which list 201 202 A complete HOWTO copy/paste guide to make Nginx running as "Front-end" of Trac.