Bitnami Gitorious

     

    IMPORTANT: Gitorious requires to use a domain name. If you are trying to log into the Gitorious application using an IP address, you may have problems with Google Chrome (known issue) or Safari browsers. It is highly advisable that you use domains instead of using IP addresses. You can learn how to configure the domain at "How to log in the Gitorious application" section.

    Gitorious is a flexible project management web application. Written using Ruby on Rails framework, it is cross-platform and cross-database.

    Please, take a look to the Quick Start Guide to know the basic use of this Stack.

    How to log in the Gitorious application?

    The default credentials for the Gitorious application are:

    user login or mail: user or user@example.com
    password: bitnami
    

    In the Virtual Machines and AMIs exist a tool for changing the domain name of the application automatically. Do not use "git." in your hostname, this cause problems if you want to access through http. You only have to run the following command to change it:

    $ sudo /opt/bitnami/apps/gitorious/updateip --machine_hostname yourdomain.com
    

    If you have configured Gitorious to use an static domain name, you should remove or rename the "/opt/bitnami/apps/gitorious/updateip" to disable it.

    If you want, you can configure it manually. These are the configuration options that you should modify in the "/opt/bitnami/apps/gitorious/htdocs/config/gitorious.yml" file:

    gitorious_client_host: YOUR_DOMAIN
    ..
    gitorious_host: YOUR_DOMAIN
    

    If you are using the virtual machine, it is also necessary that the machine can resolve the hostname. Add a new entry in the /etc/hosts file:

    127.0.0.1   YOUR_DOMAIN
    

    Then restart Apache server:

    $ installdir/ctlscript.sh restart apache
    

    How to push your changes to the Gitorious application?

    Once you have uploaded your private key to Gitorious, you can upload your repository to the application. These are the basic steps:

    git config --global user.name "Your full name"
    git config --global user.email "user@example.com"
    
    git checkout master
    git remote add origin git@YOUR_HOSTNAME:test/test.git
    git push origin master
    

    Virtual Machines have SSH server disabled by default. That it is necessary to sync your changes with Gitorious. You can see how to enable it at /Virtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f

    How to start/stop the servers?

    You can use the "ctlscript.sh" utility from the command line. This script is in the installation directory.

    $ cd installdir
    $ ./ctlscript.sh start
    

    This command start alls the required servers: Apache, MySQL, Active MQ and the Gitorious specific servers.

    Gitorious requires several daemons to work properly. You can manage them from the same ctlscript.sh tool.

    $ ./ctlscript.sh start gitorious
    

    This command start three processes: Gitorious poller, Git daemon and Ultrasphinx. You can find the log files at /opt/bitnami/apps/gitorious/htdocs/log folder. You can also check the status running the following command:

    $ ./ctlscript.sh status gitorious
    

    You can start the servers independently using scripts in  the "/opt/bitnami/apps/gitorious/scripts" folder: git-ultrasphinx.sh, git-daemon.sh and git-poller.sh.

    How to create a full backup of Gitorious?

    Backup

    Bitnami stacks are self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

    Cloud Server

    Follow these steps:

    • Place in the folder you want to save your backup
      cd /your/folder
    • Stop all servers.
      $ sudo /opt/bitnami/ctlscript.sh stop
    • Create a compressed file with the stack contents.
      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    • Restart all servers.
      $ sudo /opt/bitnami/ctlscript.sh start

    You should now download or transfer the application-backup.tar.gz file to a safe location.

    Virtual Machine

    Follow these steps:

    • Place in the folder you want to save your backup
      cd /your/folder
    • Stop all servers.
      $ sudo /opt/bitnami/ctlscript.sh stop
    • Create a compressed file with the stack contents.
      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    • Restart all servers.
      $ sudo /opt/bitnami/ctlscript.sh start
      

    You should now download or transfer the application-backup.tar.gz file to a safe location.

    Native Installer (Windows)

    Follow these steps:

    • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.
    • Create a compressed file with the stack contents. You can use a graphical tool like 7-Zip or WinZip.
    • Stop all servers using the shortcuts in the Start Menu or the graphical manager tool.

    You should now download or transfer the application-backup.zip file to a safe location.

    Native Installer (Linux and Mac OS X)

    Follow these steps:

    • Place in the folder you want to save your backup
      cd /your/folder
    • Stop all servers.
      $ sudo installdir/ctlscript.sh stop
      
    • Create a compressed file with the stack contents.
      $ sudo tar -pczvf application-backup.tar.gz installdir
      
    • Restart all servers.
      $ sudo installdir/ctlscript.sh start
      

    You should now download or transfer the application-backup.tar.gz file to a safe location.

    Tabs end

    Restore

    Bitnami stacks are self-contained, so to restore a stack, you only need to uncompress the backup file in the same location. It is important to use the same path that was used when the stack was originally installed.

    Cloud Server

    Follow these steps:

    • Place in the folder where you have your backup
      cd /your/folder
    • Stop all servers.
      $ sudo /opt/bitnami/ctlscript.sh stop
    • Rename the current directory to save it.
      $ sudo mv /opt/bitnami /opt/bitnamiBackup
    • Uncompress the backup file to the original directory.
      $ sudo tar -pxzvf application-backup.tar.gz -C /
    • Start all servers.
      $ sudo /opt/bitnami/ctlscript.sh start
      

    Virtual Machine

    Follow these steps:

    • Place in the folder where you have your backup
      cd /your/folder
    • Stop all servers.
      $ sudo /opt/bitnami/ctlscript.sh stop
    • Rename the current directory to save it.
      $ sudo mv /opt/bitnami /opt/bitnamiBackup
    • Uncompress the backup file to the original directory.
      $ sudo tar -pxzvf application-backup.tar.gz -C /
    • Start all servers.
      $ sudo /opt/bitnami/ctlscript.sh start
      

    Native Installer (Windows)

    Follow these steps:

    • Uncompress the backup file to the original directory.
    • Install services by launching a new command prompt and executing the following commands. Administrator privileges are required.
      $ cd installdir
      $ serviceinstall.bat INSTALL
      

    You can now start or stop servers using the graphical manager tool.

    Native Installer (Linux and Mac OS X)

    Follow these steps:

    • Place in the folder where you have your backup
      cd /your/folder
    • Stop all servers.
      $ sudo /opt/bitnami/ctlscript.sh stop
    • Rename the current directory to save it.
      $ sudo mv installdir installdirBackup
    • Uncompress the backup file to the original directory.
      $ sudo tar -pxzvf application-backup.tar.gz -C /
      
    • Start all servers.
      $ sudo installdir/ctlscript.sh start
      

    Tabs end

    IMPORTANT: When restoring, remember to maintain the original permissions for the files and folders. For example, if you originally installed the stack as 'root', make sure that the restored files are owned by 'root'.


    If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

    How to update Gitorious from their repository?

    Since the Gitorious application is changing very fast, Bitnami Gitoriuos stack includes .git files necessary to be sync with the repository.
     
    This is an advanced feature that should be used only by someone that knows the application and what is happening at every step of the process described below. First of all it is important you create a backup of your server before start running commands in your production server.
     
    • Use the "git" user to update the code. First "stash" possible changes that you may have in the Gitorious code or any change that could affect in the Gemfile or Gemfile.lock files
    $ sudo su git
    $ cd /opt/bitnami/apps/gitorious/htdocs
    $ git stash
    • Update the code and use a branch. This example shows how to update to latest "master" version.
    $ git pull
    $ git checkout master
    • Then run the "bundle install" command to install new gems and run the database migration. It was also necessary to install "cmake" (apt-get install cmake) for the "rugged" gem.
    $ bundle install --without test development
    $ bundle exec rake db:migrate RAILS_ENV=production
    
    • Then restart the all the servers to deploy your Gitorious application again with the latest version of the code.
    $ sudo /opt/bitnami/ctlscript.sh restart
    

    How to change the URL?

    This approach is based on the Bitnami Configuration Tool (bnconfig).

    Bitnami Cloud Hosting

    The best way to change your URL in BCH is to go to your application tab and modify it there. In the Bitnami Cloud Hosting console, select Servers, choose your server, Manage and go to the Applications tab. Press there the pencil next to the application which URL you want to modify and choose .

    Refer to this guide for more information.

    Cloud Images and Virtual Machines

    Moving the application to /

     If your application is running in "/gitorious" you can remove the prefix from the URL executing the following command:

    $ sudo /opt/bitnami/apps/gitorious/bnconfig --appurl /
    

    (use --help to check if that option is available for your application)

    Now you will be able to access to the application at http://YOUR_DOMAIN instead of http://YOUR_DOMAIN/gitorious.

    Updating the IP or hostname

    Some applications require to update the IP/domain if the machine IP/domain changes. The bnconfig tool also has an option which updates the IP automatically during boot, called machine_hostname (use --help to check if that option is available for your application). Note that this tool changes the URL to http://NEW_DOMAIN/gitorious

    sudo /opt/bitnami/apps/gitorious/bnconfig --machine_hostname NEW_DOMAIN
    

    If you already moved your application to the root URL you should include both options at the same time.

    sudo /opt/bitnami/apps/gitorious/bnconfig --appurl / --machine_hostname NEW_DOMAIN
    

    If you have configured your machine to use an static domain name or IP, you should rename or remove the "/opt/bitnami/apps/gitorious/bnconfig" file.

    sudo mv /opt/bitnami/apps/gitorious/bnconfig /opt/bitnami/apps/gitorious/bnconfig.disabled
    

    Native Installer

    Remember to use your actual installation directory instead of installdir.

    Moving the application to /

    If your application is running in "/gitorious" you can remove the prefix from the URL executing the following command:

    On Linux,

    installdir/apps/gitorious/bnconfig --appurl /
    

    On Mac OS X, 

    installdir/apps/gitorious/bnconfig.app/Contents/MacOS/installbuilder.sh --appurl /
    

    On Windows,

    installdir/apps/gitorious/bnconfig.exe --appurl /
    

    (use --help to check if that option is available for your application)

    Now you will be able to access to the application at http://YOUR_DOMAIN instead of http://YOUR_DOMAIN/gitorious.

    Updating the IP or hostname

    Some applications require to update the IP/domain if the machine IP/domain changes. The bnconfig tool also has an option which updates the IP , called machine_hostname (use --help to check if that option is available for your application). Note that this tool changes the URL to http://NEW_DOMAIN/gitorious.

    installdir/apps/gitorious/bnconfig --machine_hostname NEW_DOMAIN
    

    If you already moved your application to the root URL you should include both options at the same time.

    installdir/apps/gitorious/bnconfig --appurl / --machine_hostname NEW_DOMAIN
    

    Tabs end

    How to configure the email settings of Gitorious?

    You can configure the SMTP settings during the installation process. If you are using the Virtual Machine or AMI, you can configure it manually. For example, these are the options to configure it using a GMail account:


    /opt/bitnami/apps/gitorious/htdocs/config/environments/production.rb

    config.action_mailer.raise_delivery_errors = true
    config.action_mailer.delivery_method = :smtp   
    config.action_mailer.perform_deliveries = true
    config.action_mailer.smtp_settings = {
      :address => "smtp.gmail.com",
      :port => 587,
      :domain => "gmail.com",
      :authentication => :plain,
      :user_name => "your_account@gmail.com",
      :password => "your_password",
      :tls => true,
      :enable_starttls_auto => true 
    } 
    

    Then restart all servers:

    $ sudo /opt/bitnami/ctlscript.sh restart
    

    How to debug Gitorious errors?

    The Gitorious server logs are saved in /opt/bitnami/apps/gitorious/htdocs/logs folder. The main log file is production.log.

    Once Apache starts, it will create two log files, the access_log and the error_log /installdir/apache2/logs directory or in /var/log/httpd if you are using Amazon Linux or Red Hat Enterprise cloud images.

    In Virtual Machines, Cloud Images and Ubuntu based Bitnami Cloud Hosting images installdir is /opt/bitnami.

    The access_log file is used to track client requests. When a client requests a document from the server, Apache records several parameters associated with the request in this file, such as: the IP address of the client, the document requested, the HTTP status code, and the current time.

    The error_log file is used to record important events. This file includes error messages, startup messages, and any other significant events in the life cycle of the server. This is the first place to look when you run into a problem when using Apache.

    If no error is found, you will see a message similar to:

    Syntax OK
    /installdir/ctlscript.sh : httpd started
    

    The main MySQL log file is created at /installdir/mysql/data/mysqld.log file.

    How to create a cron job for reindexing Ultrasphinx?

    Ultrasphinx is the Gitorious searching engine by default. It requires to run the reindex task to load the new changes. The following example shows a cron task that runs every 30 minutes:

    $ sudo crontab -u git -e
    
    */30 * * * * cd /opt/bitnami/apps/gitorious/htdocs; bin/rake ts:index RAILS_ENV=production'
    

    How to enable SSL to access through https?

    You have to configure Apache to enable SSL connections. To do so, follow the steps indicated at How to enable SSL to access through https?

    Notice that the DocumentRoot specified in the httpd-ssl.conf shoud be: <installdir>/apps/gitorious/htdocs/public.

    You also have to modify the gitorious.yml file, placed at <installdir>/apps/gitorious/htdocs/config/ and change:

          use_ssl: true

    Afterwards, Apache server must be restarted.

    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    53108 view(s), 26 edit(s) and 8868 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
     gitorious.png
    Gitorious
    8.47 kB08:55, 15 Jun 2012AdminActions