Difference between revisions of "Web Hosting"

From Wiki | LUG@UCLA
Jump to: navigation, search
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
As a member of LUG@UCLA, you have been given an account on this server, and apache will serve your <tt>~/public_html/</tt> directory at [{{SERVER}}/~user/ {{SERVER}}/'''~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!
+
>>> '''<nowiki>https://linux.ucla.edu/~user/</nowiki>''' <<<
 +
 
 +
As a member of LUG@UCLA, you have been given an account on this server, and apache will serve your <tt>~/public_html/</tt> directory at [https://linux.ucla.edu/~user/ https://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:
 
Here are some ideas for things to host:
Line 6: Line 8:
 
* your code (see a tutorial below)
 
* your code (see a tutorial below)
  
== [Tutorial] Hosting public Git repositories ==
+
== 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 <code>git clone</code> your repositories!
+
Here at LUG@UCLA we like to share code. You can share yours by setting up bare git repositories and installing Gitweb into your public web space so anybody in the world can easily browse your code.
 +
 
 +
First, set up a "repos" directory in your web root:
  
 
  $ mkdir ~/public_html/repos
 
  $ 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 <tt>'''gitweb_config.perl'''</tt> and change the following configurations:
+
Later you can add bare repositories under this directory. For demonstration, we'll add a test repository:
  
* <code>$projectroot = "/home/user/public_html/repos/";</code> (be sure to change <user> to your username)
+
  $ mkdir ~/public_html/repos/my_first_repo.git
* add this to the bottom: <code>@git_base_url_list = ("<nowiki>http://linux.ucla.edu/~user/repos</nowiki>");</code>
+
  $ cd ~/public_html/repos/my_first_repo.git
 
+
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
+
  $ cd ~/public_html/repos/my_repository.git
+
 
  $ git init --bare
 
  $ git init --bare
 
  $ mv hooks/post-update.sample hooks/post-update
 
  $ mv hooks/post-update.sample hooks/post-update
 +
$ echo "replace this with a very short description of this repository" > description
  
now you can push/pull from your repo using:
+
As the repository owner, you should clone/pull/push to this repository '''via SSH'''.  Here is how you should clone it to your local machine:
 +
 
 +
$ git clone '''user'''@ssh.linux.ucla.edu:public_html/repos/my_first_repo.git
 +
 
 +
Or, if you already have some code on your local machine, you can add a new remote and push to it:
 +
 
 +
$ git remote add lug '''user'''@ssh.linux.ucla.edu:public_html/repos/my_first_repo.git
 +
$ git push --all lug
 +
$ git push --tags lug
 +
 
 +
Others can anonymously clone your repository via HTTP(S):
 +
 
 +
$ git clone <nowiki>https://linux.ucla.edu/~</nowiki>'''user'''/repos/my_first_repo.git
 +
 
 +
Now we will install Gitweb to make your repositories browseable, searchable, and beautiful, among other things:
 +
 
 +
$ cp -r /usr/share/gitweb ~/public_html/gitweb
 +
$ cd ~/public_html/gitweb
 +
$ cp /etc/gitweb.conf gitweb_config.perl
  
$ git push user@ssh.linux.ucla.edu:public_html/repos/my_repository.git
+
Edit <tt>gitweb_config.perl</tt> and:
$ git pull user@ssh.linux.ucla.edu:public_html/repos/my_repository.git
+
  
others can clone your repo with:
+
* modify this variable: <code>$projectroot = "/home/'''user'''/public_html/repos/";</code>
 +
* add this to the bottom: <code>@git_base_url_list = ("<nowiki>https://linux.ucla.edu/~</nowiki>'''user'''/repos");</code>
  
$ git clone {{SERVER}}/~user/repos/my_repository.git
+
Now you have Gitweb installed! View it at [https://linux.ucla.edu/~user/gitweb/ https://linux.ucla.edu/~'''user'''/gitweb/].
  
 
== Noteworthy files/profiles from former LUGers ==
 
== Noteworthy files/profiles from former LUGers ==
Line 41: Line 56:
 
* [{{SERVER}}/~phaethon/why_do_i_still_have_this_crap%3f/misccrap/stallman-share_the_software.mp3 stallman-share_the_software.mp3]
 
* [{{SERVER}}/~phaethon/why_do_i_still_have_this_crap%3f/misccrap/stallman-share_the_software.mp3 stallman-share_the_software.mp3]
 
* [{{SERVER}}/~phaethon/cuspemu/ PHFC: Phaethon's Hack For CUSP]
 
* [{{SERVER}}/~phaethon/cuspemu/ PHFC: Phaethon's Hack For CUSP]
* [{{SERVER}}/~natemccoy/ Nathan McCoy's CV]
 

Latest revision as of 21:40, 5 June 2014

>>> https://linux.ucla.edu/~user/ <<<

As a member of LUG@UCLA, you have been given an account on this server, and apache will serve your ~/public_html/ directory at https://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[edit]

Here at LUG@UCLA we like to share code. You can share yours by setting up bare git repositories and installing Gitweb into your public web space so anybody in the world can easily browse your code.

First, set up a "repos" directory in your web root:

$ mkdir ~/public_html/repos

Later you can add bare repositories under this directory. For demonstration, we'll add a test repository:

$ mkdir ~/public_html/repos/my_first_repo.git
$ cd ~/public_html/repos/my_first_repo.git
$ git init --bare
$ mv hooks/post-update.sample hooks/post-update
$ echo "replace this with a very short description of this repository" > description

As the repository owner, you should clone/pull/push to this repository via SSH. Here is how you should clone it to your local machine:

$ git clone user@ssh.linux.ucla.edu:public_html/repos/my_first_repo.git

Or, if you already have some code on your local machine, you can add a new remote and push to it:

$ git remote add lug user@ssh.linux.ucla.edu:public_html/repos/my_first_repo.git
$ git push --all lug
$ git push --tags lug

Others can anonymously clone your repository via HTTP(S):

$ git clone https://linux.ucla.edu/~user/repos/my_first_repo.git

Now we will install Gitweb to make your repositories browseable, searchable, and beautiful, among other things:

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

Edit gitweb_config.perl and:

  • modify this variable: $projectroot = "/home/user/public_html/repos/";
  • add this to the bottom: @git_base_url_list = ("https://linux.ucla.edu/~user/repos");

Now you have Gitweb installed! View it at https://linux.ucla.edu/~user/gitweb/.

Noteworthy files/profiles from former LUGers[edit]