Web Hosting

From Wiki | LUG@UCLA
Revision as of 13:47, 3 November 2013 by 199.48.147.36 (Talk)

Jump to: navigation, search

As a member of LUG@UCLA, you have been given a unix account on this server, and apache will serve your ~/public_html directory.

If your username is johndoe, your web space can be found at http://linux.ucla.edu/~johndoe

Hosting public Git repositories

Here at LUG@UCLA we like to share code. You can share yours by installing gitweb to your public webspace so anybody in the world can git clone your repositories!

$ mkdir ~/public_html/repos
$ cp -r /usr/share/gitweb ~/public_html/gitweb
$ cd ~/public_html/gitweb
$ cp /etc/gitweb.conf gitweb_config.perl

Now edit gitweb_config.perl and change the following configurations:

  • $projectroot = "/home/<user>/public_html/repos/"; (be sure to change <user> to your username)
  • add this to the bottom: @git_base_url_list = ("http://linux.ucla.edu/~<user>/repos");

To add a repository, just create a new bare git repo in ~/public_html/repos/:

$ mkdir ~/public_html/repos/my_repository.git
$ cd ~/public_html/repos/my_repository.git
$ git init --bare
$ mv hooks/post-update.sample hooks/post-update

now you can push/pull from your repo using:

$ git push <user>@ssh.linux.ucla.edu:public_html/repos/my_repository.git
$ git pull <user>@ssh.linux.ucla.edu:public_html/repos/my_repository.git

Noteworthy files/profiles from former LUGers