Difference between revisions of "Web Hosting"

From Wiki | LUG@UCLA
Jump to: navigation, search
Line 17: Line 17:
 
Now edit <tt>'''gitweb_config.perl'''</tt> and change the following configurations:
 
Now edit <tt>'''gitweb_config.perl'''</tt> and change the following configurations:
  
* <code>$projectroot = "/home/<user>/public_html/repos/";</code> (be sure to change <user> to your username)
+
* <code>$projectroot = "/home/user/public_html/repos/";</code> (be sure to change <user> to your username)
* add this to the bottom: <code>@git_base_url_list = ("<nowiki>http://linux.ucla.edu/~<user>/repos</nowiki>");</code>
+
* add this to the bottom: <code>@git_base_url_list = ("<nowiki>http://linux.ucla.edu/~user/repos</nowiki>");</code>
  
To add a repository, just create a new bare git repo in <tt>~/public_html/repos/</tt>:
+
Now you have gitweb installed! View it at [http://linux.ucla.edu/~user/gitweb/ http://linux.ucla.edu/~user/gitweb/]. To add a repository, just create a new bare git repo in <tt>~/public_html/repos/</tt> and it will automatically appear in your gitweb:
  
 
  $ mkdir ~/public_html/repos/my_repository.git
 
  $ mkdir ~/public_html/repos/my_repository.git
Line 29: Line 29:
 
now you can push/pull from your repo using:
 
now you can push/pull from your repo using:
  
  $ git push <user>@ssh.linux.ucla.edu:public_html/repos/my_repository.git
+
  $ 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
+
  $ git pull user@ssh.linux.ucla.edu:public_html/repos/my_repository.git
 +
 
 +
others can clone your repo with:
 +
 
 +
$ git clone {{SERVER}}/~user/repos/my_repository.git
  
 
== Noteworthy files/profiles from former LUGers ==
 
== Noteworthy files/profiles from former LUGers ==

Revision as of 23:21, 3 November 2013

As a member of LUG@UCLA, you have been given an account on this server, and apache will serve your ~/public_html/ directory at //linux.ucla.edu/~user/ (replace "user" with your LUG username). Use your web space for whatever you want, but keep in mind that whatever you put up represents the LUG too. Just try not to get us in trouble!

Here are some ideas for things to host:

  • your resume
  • your blog
  • your code (see a tutorial below)

[Tutorial] Hosting public Git repositories

Here at LUG@UCLA we like to share code. You can share yours by installing Gitweb into your public web space 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");

Now you have gitweb installed! View it at http://linux.ucla.edu/~user/gitweb/. To add a repository, just create a new bare git repo in ~/public_html/repos/ and it will automatically appear in your gitweb:

$ 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

others can clone your repo with:

$ git clone //linux.ucla.edu/~user/repos/my_repository.git

Noteworthy files/profiles from former LUGers