This guide is one section of a larger guide to installing a cent 6.x server in virtual box for development purposes with different applications. The top level guide with links to all of the sections is here: https://gist.github.com/ryanguill/5149058 Some instructions in this guide may assume a configuration from other parts of the guide.
#GitBucket
Gitbucket is a github clone written in scala. If you need a git remote inside your own network or on a server you control this is a good alternative to hosted providers like github or bitbucket. There are other hosted solutions such as atlassian stash, gitlab and others, but this is one of the easiest to install and has lots of features.
These instructions are taken and modified from here: https://github.com/takezoe/gitbucket
Make sure your server is up to date
# yum update
Install Tomcat using the instructions above.
Install HTTPD using the instructions above.
Download the latest version of gitbucket from here: https://github.com/takezoe/gitbucket/releases
# cd ~
# wget https://github.com/takezoe/gitbucket/releases/download/1.8/gitbucket.war
When I have done this in the past it named the file some really long cryptic name. Rename it to gitbucket.war for ease of use
# mv e0f01092-59b6-11e3-81cf-8e7d926fa50f.war\?response-content-disposition\=attachment\;\ filename\=gitbucket.war\&AWSAccessKeyId\=AKIAISTNZFOVBIJMK3TQ\&Expires\=1386345155\&Signature\=B1916sLylLvn9jg1Q7p3w6HAAtU\= gitbucket.war
So now to deploy the war file to tomcat, just copy it to the webapps directory
# cd ~
# mv gitbucket.war $CATALINA_HOME/webapps/gitbucket.war
If tomcat is started, it will automatically extract the war file and deploy everything.
Now test it:
http://cent6-gitbucket.local:8080/gitbucket
If that connects ok, then we can go ahead and set up httpd
# vi /etc/httpd/conf/httpd.conf
Rename the ServerName
ServerName cent6-gitbucket.local:80
Find the proxy section and turn proxying on from localhost
ProxyRequests On
<Proxy *>
Allow from 127.0.0.1
</Proxy>
Turn on named virtual hosts
NameVirtualHost *:80
Create a new VirtualHost
<VirtualHost *:80>
ServerName cent6-github.local
ProxyPreserveHost On
ProxyPassReverse / ajp://localhost:8009/
ProxyPass / ajp://localhost:8009/
</VirtualHost>
Save and restart httpd
service httpd restart
You should now be able to hit gitbucket without the 8080 port
http://cent6-gitbucket.local/gitbucket
Note: chrome for some reason wants to do a search if you leave off the http:// from the link. Not sure why or if there is something you can do to keep it from doing that.
You may want to move the default webapps from tomcat to a backup folder or just delete them if you arent going to use them.
# mkdir $CATALINA_HOME/webapps-backup
# mv $CATALINA_HOME/webapps/docs $CATALINA_HOME/webapps-backup/docs
# mv $CATALINA_HOME/webapps/examples $CATALINA_HOME/webapps-backup/examples
# mv $CATALINA_HOME/webapps/host-manager $CATALINA_HOME/webapps-backup/host-manager
# mv $CATALINA_HOME/webapps/manager $CATALINA_HOME/webapps-backup/manager
# mv $CATALINA_HOME/webapps/ROOT $CATALINA_HOME/webapps-backup/ROOT