Mycgiserver

From Fxp Wiki

Jump to: navigation, search

jspwiki sur Mycgiserver : un tutoriel
jspwiki at Mycgiserver : a tutorial


Contents

Ne fonctionne pas encore

Doesn't work yet

Here are my attempts to build a jspwiki site at Mycgiserver.

My account name is : vendo

The address is thus http://www.mycgiserver.com/~vendo

If I ftp to my account, the root is /, and contains only an example of helloworld, and a .vendo file

You need
  • The distribution
  • The sources (same version as distribution). The sources contains only the heart of the software, and we need to modify these files before replacing the ones already in place in the distribution.
  • A search and replace tool (if you are on windows, or don't know how to use grep). I suggest InfoRapid (free).
  • Ant
  • An account at mycgiserver

Packages

Mycgiserver refuses to work with ".jar" files, wich are a compressed file containing many java ".class" files.

You then have to download jspwiki sources, which contains a "src" directory, with inside a chain of empty directories, with in the end, a lot of ".java" files.

src > com > ecyrd > jspwiki > (.java files) > more .java files

bmsi > ...

Search and replace

If you open one of the ".java" file, in a text editor, you will notice that one of the first line is

package com.ecyrd.jspwiki.xxx

Of course, it is easy to understand that this line must match the place of the file inside the architecture of the directories. As we are going to change this architecture for mycgiserver, we also need to change the "package" line in all the .java files in "src".

The best tool I have found for this on windows is InfoRapid. It's a free software, very efficient.

You need to change (beware of small and capital letters) :

  • all the package lines of the .java files
    package com.ecyrd.jspwiki.
    into
    package vendo.com.ecyrd.jspwiki.
  • all the import lines of the .java files
    import com.ecyrd.jspwiki.
    into
    import vendo.com.ecyrd.jspwiki.
  • all the import lines of the .jsp files. These files are not in the sources but in the distribution.
    import com.ecyrd.jspwiki.
    into
    import vendo.com.ecyrd.jspwiki.
  • all the taglib lines of the .jsp

Change architecture; Replace in build.xml

I'm not sure if this step is necessary. Please if you know insert your advice. Create a directory named "vendo" (your mycgiserver account name) in "src" and cut-paste the directories "com" and "bmi" inside: now, all your java files are really located in vendo.com.ecyrd ...

%%

Installing Ant

So now you have "cd" to the directory where buld.xml is. Install Ant: just put it in a directory near the top of one of your partition: "c:\ant" or "e:\ant" or whatever as long as the names of the files above are less than 8 letters, and doesn't contain any spaces. (Actually, is a good advice for any java file under windows).

Ant : autoexec.bat

Go to "c:" and open a file called autoexec.bat in a text editor. Add the line

SET ANT_HOME=c:\ant
of course, replace "c:\ant by the place where you installed ant. Carefull, usually, the zip file containing ant contains another ant directory (the important one, just above bin, docs, etc) if you put everything both in c:, then the path might be "c:\ant\ant"

Check if there is a line

Set path=
If not, you well create it. It is a list of places (directories) where windows might find what it needs for various programs. We need to add one location, the "bin" directory of ant. So if you installed in "c:",
SET PATH=.;c:\ant\bin;
A more complicated path could be:
set path=.;e:\progs\ant-625ab\bin
if you put ant in e:\progs and left a weird name to the main directory of ant. One more remark: if some of the locations contains spaces like the "program files" directory, you might have hypens after the "=" sign :
set path=".;c;\program files\mon prog;c:\ant;"
Just leave the hyphens and in every cases, let the dot "." just between the = and the first ";". The dot means the first place to look is the directory where you are.

YOU HAVE TO RESTART YOUR COMPUTER

Compilation

Dos command line

Go to the console (dos command line) and "cd" to the directory where the build.xml file is

Reminder of dos navigation commands

  • The command line is to be found in "start > progs> (here maybe) or accessories > ..."
  • A letter and ":" followed by a strike on the "enter" key of your keyboard makes you change to the partition (hard disk) of the letter.
  • "dir" (no hyphens) followed again by "enter" display the list of what the directory contains (you can then check with your file explorer where you are)
  • "cd " (Change directory) and the name of a directory just under (plus "enter of course) make you go down to this directory
  • "cd .." + enter you go up
  • for more, just find a little tutorial on dos commands for file navigation.

Start compiling

So now you have "cd" to the directory where buld.xml is. Type "ant" + enter.

You should see a few lines commenting what is happening.
If there are errors, you will see the name of the files. if you see something like "com.ecyrd.jspwiki" it means that you didn't change a path into "vendo.com.ecyrd"
Another error is about not enough environment space.You should then edit a file in "c:" called config.sys, and add this line:

shell=command.com /e:32768 /p
In this case, you have to restart your computer

Upload

FTp your jspwiki ditribution to your account.

In the root of your sources, you will find a "build" directory, with inside the "vendo" directory. You will have to upload the "com" and "bmsi" directories at the root of your mycgiserver account. We don't need the "vendo" directory, because it is already the name of your root directory.


Voici mes tentative pour construire un site jspwiki sur Mycgiserver.

Personal tools