Edgewall Software

Changes between Version 2 and Version 3 of Ubuntu-16.04-Git


Ignore:
Timestamp:
Oct 26, 2017, 9:55:07 PM (6 years ago)
Author:
figaro
Comment:

Cosmetic changes

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
    23[[PageOutline(2-5,Contents,pullout)]]
    34
    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:
     5This 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
     7This guide should apply for the following Debian-based Linux distributions:
    78 * Debian 9
    89 * Ubuntu 16.04
     
    1112 * !LinuxMint 18.2
    1213
    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`
     14Here 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`.
    1415
    1516{{{#!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 {{{#!bash
     17**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
    2021apt-get install subversion libapache2-mod-python pypy python python-babel trac python-pip -y
    2122pip install --upgrade pip
     
    3435
    3536trac-admin /var/www/trac initenv
    36 
    37 }}}
    38 Follow the trac-admin guide...
    39 
    40 Now lets test the trac before we do more
    41 {{{#!bash
     37}}}
     38
     39Follow the trac-admin guide.
     40
     41Now lets test the Trac installation before we do anything else:
     42{{{#!sh
    4243tracd --port 8000 /var/www/trac
    4344lynx localhost:8000/trac
    4445}}}
    4546
    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
     47If 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
     49Run the following to create the admin user:
     50{{{#!sh
    4951htpasswd -c /var/www/trac/.htpasswd adminusername
    5052trac-admin /var/www/trac/ permission add adminusername TRAC_ADMIN
    5153}}}
    5254
    53 Replace `adminusername` with your desired username
    54 
    55 Next we set the propper user and group permissions on the Trac folder to allow the !Nginx/Apache/Trac server to access it
    56 
    57 {{{#!bash
     55Replace `adminusername` with your desired username.
     56
     57Next 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
    5860chown -R UserName:GroupName /var/www/trac/
    5961chmod -R 775 /var/www/trac/
    6062}}}
    6163
    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
     66To enable git source browsing via Admin we need another subfolder:
     67{{{#!sh
    6568mkdir -p /var/www/trac/git
    6669}}}
     
    6871== Systemd startup script == #SystemD
    6972
    70 In your `/etc/systemd/system/` make this new file -->
    71 {{{#!bash
     73In your `/etc/systemd/system/` make this new file:
     74{{{#!sh
    7275nano /etc/systemd/system/tracd.service
    7376}}}
     77
     78Then add the following to your `trac.ini` file:
    7479{{{#!ini
    7580[Unit]
    76 Description=TrackD Daemon
    77 After=network.target
     81Description = TrackD Daemon
     82After = network.target
    7883
    7984[Service]
    80 ExecStart=/usr/local/bin/tracd -p 3050 --protocol=http --basic-auth="*,/var/www/trac/.htpasswd,Restricted" -s /var/www/trac
    81 Type=simple
    82 User=UserName
    83 Group=GroupName
     85ExecStart = /usr/local/bin/tracd -p 3050 --protocol=http --basic-auth="*,/var/www/trac/.htpasswd,Restricted" -s /var/www/trac
     86Type = simple
     87User = UserName
     88Group = GroupName
    8489
    8590[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
     91WantedBy = multi-user.target
     92}}}
     93
     94== Nginx configurations
     95
     96Now it's time to do the NginX configurations.
     97
     98First we have to make a reverse proxy to the Trac daemon we have made in [#SystemD Systemd startup script].
     99
     100In the `/etc/nginx/nginx.conf` we'll have to add a upstream for our reverse_proxy to Trac:
    95101{{{#!nginx-conf
    96102  upstream live_trachosts_com {
     
    99105}}}
    100106
    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`
     107Now 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`:
    103108
    104109{{{#!nginx-conf
     
    131136}
    132137}}}
    133 == Apache ==
    134 And since you properly anyway use apache :( well here is that piece of code :(
    135 
    136 {{{#!bash
     138
     139== Apache
     140
     141If you are using Apache as the webserver, then run the following:
     142{{{#!sh
    137143a2enmod python
    138144nano /etc/apache2/sites-available/trac.conf
    139145}}}
    140146
    141 {{{#!apacheconf
     147It should have the following content:
     148
     149{{{#!apache
    142150<VirtualHost 123.123.123.123:80>
    143151 ServerName trac.local
     
    165173}}}
    166174
    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
     175To enable the Trac site run `a2ensite trac.conf`.
     176
     177== !Find/Replace
     178
     179The 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
     190In this tutorial I have used the following software versions:
     191{{{#!sh
    182192$ uname -a
    183193Linux 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
     
    188198}}}
    189199
    190 === Which list ===
    191 A complete HOWTO copy/paste guide to make Nginx running as "Front-end" of trac
     200=== Which list
     201
     202A complete HOWTO copy/paste guide to make Nginx running as "Front-end" of Trac.