wiki:SystemAdministration

Version 12 (modified by erittenh, 10 years ago) (diff)

--

The software team uses a cloud-server hosted at DigitalOcean. The server runs Ubuntu 14.04 linux and has 512MB RAM and 20GB storage.

The server name is jupiter2.raidtech.net and the static IP is 104.236.89.124. The domain name wiki.raidtech.net takes you to the same server and is directed to the Wiki virtual host. So users can access the server here:

Administration can be performed by command line (SSH) or via Webmin

User Management

Adding a new student:

In addition, for students on the software team, you should also create a unix user account and add them to the swdev group; this gives them permission to access the software repositories

You can also do these from the unix command line:

        sudo adduser <username>
        sudo usermod -a -G swdev <username>
        cd /var/local/trac
        sudo htpasswd .htpasswd <username>
        sudo trac-admin /var/local/trac permission add <username> swdev

Adding a new mentor:

You can add a mentor using the web interfaces as described above for students. Note that mentors should be added to both the appropriate student and mentor groups (e.g. swdev and swmentors) to ensure they have full permissions. You can do this from the command line as well:

        sudo adduser <username>
        sudo usermod -a -G swmentors <username>
        sudo usermod -a -G swdev <username>
        sudo usermod -a -G sudo <username>
        cd /var/local/trac
        sudo htpasswd .htpasswd <username>
        sudo trac-admin /var/local/trac permission add <username> cfgmgmt

Version Control

Subversion is used for version control; the repositories are stored in /home/svn. Repositories are accessed securely from subversion clients (such as NetBeans) using the URL:

Separate repositories are used for each sub-team that does not need to share code with other sub-teams (e.g. gameapp, sensors, etc.). Experiments should be done using the test repository.

Creating a repository:

sudo svnadmin create /home/svn/myrepo
sudo chown -R root:swdev /home/svn/myrepo/db
sudo chmod -R g+w        /home/svn/myrepo/db
sudo chown -R root:swdev /home/svn/myrepo/locks
sudo chmod -R g+w        /home/svn/myrepo/locks

After creating a repository, add it to Trac using the web interface. If there is data in the repository already, you may need to execute the following command:

sudo trac-admin /var/local/trac repository resync "myrepo"

You may also need to add a post-commit hook in the repository to call:

trac-admin /var/local/trac changeset added "myrepo" $REV

For more information see: http://svnbook.red-bean.com/en/1.7/svn.reposadmin.create.html

Adding a project

To create a project within a repository using the command line, on your local computer:

  • create project dir myproj w/sub-dirs: tags, branches, trunk
  • create/copy your project under myproj/trunk (see example helloc project in test repository)
  • cd myproj
  • svn import svn+ssh://jupiter2.raidtech.net/<repositoryname> -m "initial import"

You can also usually create projects using the subversion client in your IDE.

Web Server

An Apache LAMP webserver is installed and is used by the Trac Wiki. Other virtual web servers can be added. The default web page is located here. Important directories for configuration are:

  • /etc/apache2 (the Apache configuration files)
  • /var/www/html (the default web page directory)

Trac Wiki and Defect Tracking

Trac provides a host of features including trouble ticketing, a software repository browser, and a general-purpose wiki. The plugins PermRedirect and AccountManager are installed for additional features.

Configuration

Important directories/files for configuration include:

  • /var/local/trac
  • /var/local/trac/conf/trac.ini

Note that a symbolic link should be created in each of the trac sub-directories back to the VERSION file to avoid an annoying error message:

   ln -s /var/local/trac/VERSION conf/VERSION 
   ln -s /var/local/trac/VERSION db/VERSION 
   ln -s /var/local/trac/VERSION htdocs/VERSION 
   ln -s /var/local/trac/VERSION log/VERSION 
   ln -s /var/local/trac/VERSION plugins/VERSION 
   ln -s /var/local/trac/VERSION templates/VERSION

Trac.ini (mentioned previously) contains a section which describes how the logo of the website is displayed. Specifically:

[header_logo]
alt = RAID 2537 - Software Development #The alt text for the logo
height = 100 #The logo's height in pixels
link = #An optional link to go to if the logo is clicked
src = site/RAIDLogo.jpg #The location of the image
width = 80 #The logo's width in pixels

Descriptions of these properties are listed in the code above. A few things to remember about all this:

  • When placing the logo into the filesystem, anything listed as being in the "site" file is actually listed under /var/local/trac/htdocs
  • The "alt text" mentioned above is just some text that is shown when someone hovers their mouse over the logo

Moving a logo onto the server

In order to get a logo onto the server, you will have to use the linux command scp (if you're using linux or mac) or a SCP windows client, WinSCP being a notable one for its PuTTY integration. The syntax for the SCP command will be

scp <file location on your local disk> <username>@jupiter2.raidtech.net:/home/<username>/

After moving the file to your local account, you will have to mv the file into /var/local/trac/htdocs. After doing, this, you should change the permissions on the file.

sudo chown root:www-data <your image name>
sudo chmod a=r <your image name>

Make sure you update the file name of your image in trac.ini after adding the image to the server, and if you need to delete the old one remember to use rm to delete the old file.