How to Upload Files on Sourceforge
And how to redirect visitors to a website
Before to access the space allowed to your web pages at Sourceforge or another
open source repository, you have to generate a pair of keys, and send it at
the host. Then the scp command, under Unix, allows to send files directly.
Once the page(s) uploaded, visitors can view the site of your project at an
address in the form: http://projectname.sourceforge.net
Here is the process, step by step, under Unix. This is simpler under Windows, thanks to Tortoise and other graphical tools.
You need for these infos:
- user: you user name, the exemple uses scriptol that if my user name.
- login or project name or Unix name: the exemple uses myproject that is the Unix name of the Universal Configurator project.
Update June 2015
This page was written 8 years ago, before the appearance of other project hosting such as GitHub. Recently, Sourceforge got the attention of the media because it incorporates malware in archives it distributes, against payment and without the consent of the authors.. So I would advise to evaluate all options of project hosting before opting for Sourceforge.
Uploading files in his space using Winscp
The personnal space holds the content of its your in sub-domain of sourceforge.net.
You can now upload more easily your pages on Sourceforge with winscp.
- Download winscp and run it.
- Fill the fields with info given by Sourceforge for scp.
- For the host, web.sourceforge.net.
The name of the host could change. See the documentation on the site.
- Ignore the key.
- Enter your login and your password.
- Select in the right panel the target directory, not that of your account in /home/user/ but that of your project in /home/groups/
See below for more info.
- Select in the left panel, your local file.
- Drag and drop them in the right panel.
Uploading archives on Sourceforge
This is done with WinSCP too:
- The host is now frs.sourceforge.net.
The sub-directory is uploads.
(frs means for File Release System.)
- Go to Features Setting.
- To the line File Release System.
- Click on manage in the column at right.
- Create a package and a release.
The documentation on SF gives more details about packages and releases.
Generating the keys
You have to create a key pair (private, public) to exchange data between
your local computer and your web space.
Under Unix the command is:
ssh-keygen -t rsa
ssh-keyken is the name of the key generator.
-t is an option to pass the type of encryption.
rsa is a type commonly supported.
You are prompted for a filename, type enter instead.
You are prompted also for a paraphrase. Type a simple word, or nothing.
This creates the ".ssh" sub-directory at the root of your local account, with the id-rsa.pub file inside.
Even if the current directory is not the root, the .ssh directory is created at the root.
Sending the key
At Sourceforge, registering the keys is achieved through the graphical user interface. It is accessed through your account page (scroll the page and click on the "registering key" line). You must cut the the code from the public file and past it into the textbox.
On other repositories, registering the key have to be made manually. Type
ssh-copy-id -i ~/.ssh/id_rsa.pub firstname.lastname@example.org
ssh-copy-id is the name of the registering program.
-i option to pass the name of the identity file.
~/.ssh/id_rsa.pub is the path of the previously created key file.
scriptol is my user name. It is not yours, type your user name instead.
shell.sourceforge.net is the remote address.
You are prompted for your password. If it is recognized, all is done, you are ready to upload your pages.
Uploading a page
The command to upload a web page is under Unix:
scp index.php email@example.com:/home/groups/myproject/htdocs
- scp is the name of the program.
- index.php is the file you want to upload. You can use the "index.html" filename, but in this case you must delete the file that is here by default, since its name is index.php. Otherwise your file replaces the default file.
- scriptol is my user name, but not yours, type your user name instead.
- shell.sourceforge.net is the remote address, the shell directory.
- /home/groups/ is the directory of all projects.
- myproject is the Unix name of the directory
of my project and the login. type your login instead.
The true path may be something as: /m/my/myproject (replace with letters of your project name.
- htdocs is the sub-directory for html files. You have also a cgi-bin
subdirectory, but this out of the topic.
This command sends directly the file index.php on your web space and become visible at the address http://myproject.sourceforge.net.
You are prompted for your password in addition to keys, or not, depending
You may have more sub-directories, the first letter of the login, and inside this directory, the two first letters of your login, and your directory or login stays inside this second sub-directory.
The ls /home/groups/ command may help to find the directory.
Working in your web space
To delete a file, index.php for example if you have loaded the file index.html,
you have to enter into you web space.
You must also enter your web space to perform various tasks as renaming a file, etc...
The command to do that is, under Unix:
ssh -l myproject firstname.lastname@example.org
- ssh is the command.
- -l (not the digit one, not i uppercase, but l the letter and the
first letter of the word login).
This is an option to pass the name of your login, that is also the name of the directory of your project.
- myproject is my login. Use your login instead.
- scriptol is my user name. Not yours, use your user name instead.
- shell.sourceforge.net is the remote address.
Once the command is passed, you are prompted for a paraphrase. Type the word
you have given at generation of the keys, and you enter into your web space.
The program displays a message, for exemple: "Have a lot of fun". But it is too late, I already had all the fun while trying to access my account!
How to redirect your visitors without PHP
If you own a web site, and you want your visitors at the repository redirected on this site, you may redirect them automatically with a very simple HTML page with frames:
<html> <head> </head> <frameset rows="*,0" cols="*" frameborder="NO"> <frame name="mysite" src="http://www.scriptol.com" noresize scrolling="NO"> <frame src=""> </frameset> <noframes> <body> Home page: http://www.scriptol.com </body> </noframe> </html>
You can download the code. This is the file I use to redirect "http://myproject.sourceforge.net" to "http://www.scriptol.com".
Redirecting visitors with PHP
Replace the home page with this PHP script (nothing else):
<?php header("Status: 301 Moved Permanently"); header("Location:http://www.scriptol.com"); ?>
Of course, the domain "scriptol.com" must be replaced by your own
web address otherwise your visitors will be redirected to my site.
The file must be named index.php and uploaded according to the instructions above.