Menu

THE LOCAL SYSTEM INSTALL

2013-05-18
2015-05-14
  • Karta Larch

    Karta Larch - 2013-05-18

    SERVER BASICS:
    With a local system install you would be installing JBC-BOSC and a fully functional web server on your own desktop.

    First bit of background.
    These days, a server for ecommerce consists of a minimum 3 ingredients.
    1. The web server - which speaks directly to your web browser in a language called Hyper Text Markup Language (HTML). The most common web server in the world today is Apache(2).
    2. The database - a means of storing the transient data in a webpage. A website could work with Apache alone, but it would only be able to display static web pages. It cannot store the dynamic complex information associated with an ecommerce website. In the old days, each product was stored in it own individual HTML page, called STATIC PAGES. These days nearly all product information is stored in databases. The most common web database is MySQL.
    3. A script interpreter - by means of which the server communicates with the database and constructs dynamic web pages in response to user input. The script interpreter translates scripts on the server into HTML for delivery by the web server. It extracts data from the database to include in web pages. The most common scripting language is PHP. These days, for most sites there are no longer any static HTML pages - as all HTML is generated from PHP scripts. The PHP scripts can also interact with other script interpreters such as JavaScript and Perl.

    All this sounds complicated, and well... it aint simple.
    But for the typical user, a local install isn't all that complicated, and the basic skills required are simply the ability to use a decent file manager, as well as editing text files in a simple text editor like NOTEPAD (never, ever, ever word processors like WORD!!!).

    A local install is also advised even for users with a functional production BOSC on a live web hosting site. It allows for testing of new site improvements or design changes without having to shut down the site, 'for maintenance'. And also acts as a backup. There are only a few files that need to be changed to restore a remote site fromm a local one. Or in some cases to change hosting companies. Portability.

    SERVER INSTALLATION:
    The first thing to do is to unzip JBC-BOSC into a temporary directory, or at least one with a small amount of files to avoid confusion. ANYPLACE where its two core components JbookCloud and BOSC can be recognized and temporarily stored.

    The next step is to create a directory called C:\XAMPP
    Systems newer than XP may balk at this - if so please let us know and we will look into it.
    The instructions say any directory can be used, but in the past versions there had been problems occurring with other directories. XAMPP DOES NOT USE THE WINDOWS REGISTRY. Ever. This makes it totally portable. From the Apache Friend's XAMPP readme_en.txt :


    Important! PHP in this package needs the Microsoft Visual C++ 2008 Redistributable package from
    http://www.microsoft.com/en-us/download/details.aspx?id=5582. Please ensure that the VC++ 2008 runtime
    libraries are installed on your system.

    • Apache 2.4.3
    • MySQL 5.5.27 (Community Server)
    • PHP 5.4.7 (VC9 X86 32bit thread safe) + PEAR
    • phpMyAdmin 3.5.2.2
    • OpenSSL 1.0.1c
    • ADOdb 5.17
    • Mercury Mail Transport System v4.62 (not included in the portable version)
    • FileZilla FTP Server 0.9.41 (not included in the portable version)
    • Webalizer 2.23-04 (not included in the portable version)
    • Strawberry Perl 5.16.1.1 Portable
    • Tomcat 7.0.30
    • XAMPP Control Panel Version 3.1.0 by hackattack142 (Great Thanks!!))
      See: http://www.apachefriends.org/f/viewtopic.php?f=16&t=46743
    • XAMPP Security
    • XAMPP mailToDisk 1.0 (write emails via PHP on local disk in <xampp>\mailoutput. Activated in the php.ini as mail default.)</xampp>

    • System Requirements:

    • 64 MB RAM (RECOMMENDED)

    • 750 MB free fixed disk
    • Windows 2003, XP (RECOMMENDED), VISTA, Windows 7

    • ATTENTION!!!!

    For trouble with the mysql connection (via mysqlnd API in php) see also the startpage:
    http://localhost/xampp/index.php

    • ATTENTION!!!!

    For trouble with the mysql connection (via mysqlnd API in php) see also the startpage:
    http://localhost/xampp/index.php

    • QUICK INSTALLATION:

    [NOTE: Unpack the package to your USB stick or a partition of your choice.
    There it must be on the highest level like E:\ or W:. It will
    build E:\xampp or W:\xampp or something like this. Please do not use the "setup_xampp.bat" for an USB stick installation!]

    Step 1: Unpack the package into a directory of your choice. Please start the
    "setup_xampp.bat" and beginning the installation. Note: XAMPP makes no entries in the windows registry and no settings for the system variables.

    Step 2: If installation ends successfully, start the Apache 2 with
    "apache_start".bat", MySQL with "mysql_start".bat". Stop the MySQL Server with "mysql_stop.bat". For shutdown the Apache HTTPD, only close the Apache Command (CMD). Or use the fine XAMPP Control Panel with double-click on "xampp-control.exe"!

    Step 3: Start your browser and type http://127.0.0.1 or http://localhost in the location bar. You should see our pre-made
    start page with certain examples and test screens.

    Step 4: PHP (with mod_php, as .php, .php3, .php4, .php5, .phtml), Perl by default with .cgi, SSI with *.shtml are all located in => C:\xampp\htdocs.
    Examples:
    - C:\xampp\htdocs\test.php => http://localhost/test.php
    - C:\xampp\htdocs\myhome\test.php => http://localhost/myhome/test.php


    OK.
    Lets do some trasslation into real English.

    Assuming you have downloaded XAMPP from the prior step at:
    https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.8.1/xampp-win32-1.8.1-VC9.zip/download?use_mirror=hivelocity&download=

    (A large download)

    Find where that file is and MOVE IT TO THE TOPMOST DIRECTORY of your C:\ drive.

    Unzip it, and make sure that any options for directory recursion in the software used - there are many unzipping apps, are ON. It must keep its directory (folder) structure.

    After a minute or two, thre should be a new directory on the 'root' (base) of C: drive called \XAMPP.
    This is C:\XAMPP.

    Within C:\XAMPP there is a utility called setup_xampp.bat, as mentioned above. All this file does actually is check to see if the MicroSoft files in the links above are installed:
    http://www.microsoft.com/en-us/download/details.aspx?id=5582

    Ignore the part about apache-start.bat and mysql-start.bat.
    Just click on (run) xamppp-control.exe.
    It will bring up a nice interface which will live in the small toolbar in the lower left (system tray).
    If there is no icon on your desktop, right click on xampp-control and make a shortcut for it.
    Then drag the shortcut (move) to c:\documents and settings[your name]\desktop.

    Then go back to the XAMPP control panel.
    Click on Apache. It will start up with 2 files. Ihis is normal.
    Click in MySQL it will start up with a single file.

    On your web browser bar enter:
    http://localhost
    Typically you should get a message saying IT WORKS!

    If it doesnt work, try 127.0.0.1

    If localhost does not work and 127.0.0.1 DOES - you have problems with at least the C:\windows\system32\drivers\etc\hosts file.

    The first two lines need to be:
    127.0.0.1 localhost
    ::1 localhost #[IPv6]

    Try that and post a note to the foorum if it does not work.

    If neither method works there is likely to be a problem with the XAMPP install.
    Try under START/Run/ping localhost

    If there is no error, and you get a few lines of text its definitely the install.
    If it comes up with an error recheck the hosts file.
    Then try the same with 127.0.0.1 instead of localhost
    If that does not work something is seriously wrong with the networking.
    If it does work something may be hijacking your hosts file.

    If everything works, congratulations: you have successfully set up a web server.
    Note that only two programs are actually used:
    APACHE (Apache will always show up in process displays as httpd.exe - 2 instances)
    MYSQL

    PHP is only run as needed and is not a 'daemon' (service).

    Unlike alot of other apps, all the programs included only come when called.
    Be wary of the program called WAMP - its alot like XAMPP - but it will set up many of the programs as 'services' that will fire up automatically. Not a good idea to have a constantly running server on a home system.

    Note that there are many other programs included on this install. Which is one reason it is so large. This will allow the user to run virtually every server based program or utility, including API interfaces to Amazon, Ebay, and use blog website software for personal use. In fact Wordpress and soe others are offered for download at the XAMPP site.

    This also contains PERL for running the old CGI type web pages.

    DON'T FORGET TO TURN THE APACHE AND MYSQL OFF when not in use. The actual risk of 'attack' is very, very low, but it is a good practice to get into.

    INSTALLING BOSC Part 1

    Here it should be noted that Apache as a server will only recognize certain directories, and not permit access outside of them from the web or web servers. On most internet servers this is called public_html. On XAMPP it is called htdocs.

    BOSC and all website related programs, files, and utilities must be located in or under C:\XAMPP\HTDOCS. HTDOCS is where Apache first looks for files and will automatically run anything called index.php or index.html

    BOSC however, lives under the \BOSC\CATALOG directory, and this is where the index.php is located.

    So... what must be done at this point:
    1. Copy or move BOSCxx to C:\XAMPP\HTDOCS
    2. Unzip it in THAT directory (and retain directory structure if it is an option).
    3. Check to make sure C:\XAMPP\HTDOCS\CATALOG\INDEX.PHP exists.
    4. Go get a cup of coffee. Or watch a Simpson's rerun. We are at intermission time, while the discussion now turns to THE DATABASE.

    THE DATABASE!

    This is perhaps the most confusing and grueling part of dealing with web servers.
    Even though BOSC has an installation program for setting up the database, it cannot possibly CREATE it! And the installation will not proceed until it is created.

    1. Make sure Mysql and Apache are TURNED ON at the XAMPP Control bar.
    2. At the START\RUN bar type cmd.exe

    A big black screen appear with a C:\ prompt.

    At the end of that prompt copy and paste this:

    mysqladmin -u root password '[choose a password here, and dont type in the brackets]'

    Remove the brackets and everything in between, and put your password in its place.
    A simple password, NOT one used for important things like PayPal transactions. This password CAN be found/cracked.
    You can have '' as the password (nothing in between the single quotes). In fact, its what I normally do since I normally dont run the server full time. Plus there is not that much damage a hacker can do to a database used on a test system, that is normally updated anyway.
    (The opposite is advised on a production site on a remote host. Password should be strong).
    There should be no error.

    Now...
    At the browser bar type: http://localhost/phpmyadmin

    Note: on most browsers you can omit the http:// part. They will look for the address in the right manner. Mostly.

    An attractive screen should appear.
    The name is deceptive. PhpMyAdmin is not about PHP at all. It is purely a MYSQL database manager.

    Click on DATABASES at the top row far left tab.

    Under CREATE DATABASE type BOSC, and under COLLATION choose LATIN1_SWEDISH_CI. Myles can correct me if the last part is wrong (its what was used on earlier versions). But in any case it does not really matter. Once you click CREATE, a nice new database will be created. And it will be empty.
    Time to fill it.

    First bookmark phpmyadmin. It may be necessary to come back to it.

    INSTALLING BOSC Part 2

    At this point we should have XAMPP, and BOSC installed and in their proper locations. Apache and MySQL should be running, and Phpmyadmin fired up and running and the BOSC database created.

    Now :
    1. Put http://BOSC/CATALOG/INSTALL/index.php in your browser bar.
    2. Create your account for your test site.

    REMEMBER: The database (MySQL) user and password is TOTALLY different and unrelated to your BOSC user name and password, and root SHOULD NOT be used for the website name. BOSC will also apparently require a password so make sure to use one, albeit simple though that password is actually more secure than the database MYSQL one. I'll explain why at a later time.

    When all done at the browser bar, if it does no automatically take you to it:

    http://localhost/bosc/catalog

    And BOSC should appear. It will automatically find that index.php file, which will fire up the website.

    The next installment will either be more BOSC basics or JBC intstall...

     

    Last edit: Myles 2013-05-23
    • Anonymous

      Anonymous - 2013-05-21

      Am I the only one having problems importing books? I downloaded my inventory in Homebase 2.3 format so I could set up HB (I don't usually use it) to get this thing fired up. I could import categories and books into JBookCloud fine before I installed BOSC, but after, could only import categories. Books gives 'persistance exception' over and over. Any suggestions? I'm trying to get a local test setup going, using IIS on an XP machine.

       
      • Karta Larch

        Karta Larch - 2013-05-21

        As you seem to know what you are doing did you install BOSC from the install.php file or manually?

        The ijnstall.php will also run the attendant SQL queries to (hopefully) get everything up and running. Else you may have to pull up phpmyadmin (or its IIS equivalent) and run the SQL scripts manually to get everything running.

        As far as i know this is the first time JBC-BOSCD is being used on IIS. Myles and myself have (I believe) only run Apache/MySQL.

        Using an ABE download to create a Homebase export is fraught with problems, Particularly as there might be missing fields. I know from experience that MySQL will fail if an entire table is imported and there is a missing/wrong field type.

        What database is normally used for export?
        Perhaps we can find something to convert it.

        If any of this helps, please let us know.

         
        • Anonymous

          Anonymous - 2013-05-22

          I installed from the php script. I have found the problem. I initially found bugs in the sql script that builds the books database (same bug, but in two different places, in two different versions of the script- ? I don't see how either of them could have run for anyone?). The problem with the book table not being populated lies with the triggers scripts which are intended to populate the OS-Commerce part of the database (the manufacturers-products etc side). One of them, for example, does not actually try to populate a required field, so is bound to fail. I now know more about how all this works than I ever intended to. The problem isn't with IIS, which behaves remarkably well. I have been slogging through the triggers, rewriting them as SQL Insert statements (via Access, which I have linked via ODBC to my test MySQL DB) to find the problems. I am coming to the conclusion that I would be better off writing my own set of queries to update the OS-Commerce tables directly, and cut out the middleware :-) The problem is, having found the problems with the triggers, I don't know what will be the best way to deal with them, as I don't know how crucial (for example) the missing fields would be to bOSC. I could alter the tables to drop the 'required' constraints, or put dummy values in... and so on. Sorry, I'm finding typing into this little window a bit of a pain, but if any of my eye-watering slog is of any interest to anyone else let me know and I'll put it together to post. (Sorry to be anon but didn't get round to set up an id when I posted late last night). Best, Christina

           
  • Karta Larch

    Karta Larch - 2013-05-22

    (via Access, which I have linked via ODBC to my test MySQL DB) to find the problems. I am coming to the conclusion that I would be better off writing my own set of queries to update the OS-Commerce tables directly, and cut out the middleware :-)

    A collaborative adventure keeps things interesting.

    Remember there is always room to grow with this software.

    So to clarify:
    The bugs were in the JBC install?
    Did the OSCommerce install.php work correctly?

    I had recently installed from the BOSC install.php and all was well.
    (However I have not yet caught up with Myles so it may have been a NEW bug.

    JBC aint just all about connecting the ankle bone to the head bone via SQL.
    Right now its fairly basic. And while Myles Does Java the best I can do is some half brained Perl.

    So.. kinda what I am saying is that we need you m'lady.

    I am writing up the FAQs at the moment so any advice on steps and bug fixes would be greatly appreciated.

    Myles is apparently writing the java on Win (in the earliest code we had a debbil of a time with cAsE ) - running it on a foreign DB server, and sending the results into I presume a Linux box.

    Here I have JBC-BOSC on WinXP, Debian (Wheezy) and my web host (CentOS).

    But figgering i didnt know too much about the order or precdence for the SQL stuff I just let the BOSC install handle all the trigger stuff, which does seem to work pretty well, at least with the versions we have.

    This project is actually expanding beyond homebase database connections and even BOSC, albeit in baby steps.

    The dream is to turn it into a cyber Lego set.
    JBC-BOSC is already using using freemarker and Jaolt, It may soon take on the major APIs themselves. I have perl scripts ready to translate Homebase to a UIEE format with nearly 100% acceptance, I have a half baked method of doing nightly automated uploads to as many sites as wanted,. I have perl scripts to parse the Amazon report files and find mismatches. I have a homebase2homebase perl script that can competely customize any Homebase export, with differential pricing, and even pre-pended and post-pended notices : Like 30% sale this week L@@K!!!! ,.

    i will need help translating these into java. Although in truth, java should be able to work directly with them.

    Input, geez, we need INPUT!

    The Wizard of Oz is I'm sure already to his bookee placing odds on the infinitisimal chance of a bunch of superannuated boobsellers actually getting together on something as complex as new software techniques.

    Hells bells we have enough problems compiling funny cat pics.
    And now we're out to build Deep Thought!

     
  • Anonymous

    Anonymous - 2013-05-22

    Well, I'm bit too far down the bottle to make much sense at the moment but will try to offer some useful comments tomorrow. I suspect most of my problems have their roots in issues of version control and the like, and documentation not keeping in step with code (like flat pack manufacturers who send out the same instructions when they've changed the design! So I was still trying to screw flange B into panel A when they had both been replaced with a bit of moulded aluminium?). I did find myself baffled by scripts that had fatal bugs, but apparently weren't troubling anyone else. Still am baffled, for that matter. But then, I'm easily baffled. I'm not looking for software to solve the world, just to save me a bit of pain in building a website (and I confess I'm unwilling to give up my own lovingly handcrafted DB, full as it is of my own reports, queries and a home-knitted accounts system, so will be looking for something to complain about whatever is on offer). Dammit, I realise I'm still Anonymous- but have sort of come out over on the ABE forum. Cheers for now, C. PS don't ask me for help with Java; I never really got over the move from C to C++. Or paper tape to punched card, for that matter. I remember when it were all green fields round here... and Kermit was hot technology. Who's taken that bl**dy bottle?

     
  • Karta Larch

    Karta Larch - 2013-05-23

    Things are still so new around here, that I am still removing the paper labels.

    Hopefully Myles fixed those typos! (Myles has fixed some of the typos.)

    Today was spent at the farmers auction, getting stuff for the garden. Its been a late spring here with the ground cold until the past week or so, so even the real farmers are only just getting the corn in the ground.

    Tomorrow will be planting the stuff, and wont even be looking at a book or a database till Friday!

    We have our priorities here: the termaters and peppers (capsicums to Felix).

    ABE is full of IT talent just needing to stick its finger in the pot.

    JBC is not a replacement for a core database at the moment. Its an homunculus. Its still a bit slow to rapidly list books. HomeBase is still the best way to do that for HomeBase 2.3 users - BUT... JDC adds an extra dimension by making the database universally accessible in a simple spreadsheet/access type format. Spreadsheet for general inventory, Access for individual listings.

    This allows for easier, faster display when pulling up info when on the go, particularly with mobile devices. Its the first step into the future.

    Its also the first baby step in getting away from the Windows platform, and if Apple were to ever get its head out of its azz and remember the importance of desktops, M$ could become the next Amiga.

    Meself, I'm directing all the energies at a future full of Linux, as its certainly a dominant and powerful player in emerging nations, as well as the backbone of the Internet itself.

    IIS is not halal, according to The Prophet (May His Tribe Increase), Richard M. Stallman. (but I am a sinner, when tempted...)

    One of the most promising replacements for HomeBase is Cato Jr.
    A multiplatform database that is full duplex with HomeBase!

     

    Last edit: Myles 2013-05-23
  • Anonymous

    Anonymous - 2013-05-25

    Hi there, me again (sorry)- Christina. I'm looking at the data model and see that the authorname is 255 characters in the book table but has to satisfy joins on manufacturer, where it's only 32. Is there code that looks after this, or would I be safer restricting authorname in my version of the book table to 32? Sorry if this isn't the right place to ask this but the forum headings have a bit of overlap. Also, there's a similar issue with BookNumber (varchar(14)) and products_model (varchar(12)).

     
  • Karta Larch

    Karta Larch - 2013-05-25

    Change the varchar for Manufacturers to 255.

    It seems to be a default for OSCommerce, which obviously needs to be fixed.
    I fixed it on both my Linux BOSC install and on my OSC2.2 live site, and no ill effects on either. Never noticed the truncation before, as I reparse the Author field also direct into the description rather than the database from my Perl script.

    The same can presumably be done with SKU, but I figger i'll be dead or retired before I sell my trillionth book.

    Hopefully they will be fixed in the next version.

     
  • Myles

    Myles - 2013-05-27

    Well spotted. The structure of BookCloud derives from the HomeBase 2.3 Access database. Data from HomeBase can be imported without loss (apart from conversion to UTF-8). The other tables in BOSC are unaltered from OSC 2.3.3. The two parts of the database remain distinct. There are no table joins between the two parts.

    Our intention is that the two parts remain loosely coupled. (They were initially two distinct databases but restrictions on database names by hosts forced us to put the two into one database.) Triggers on the BookCloud part of the database propagate the data changes to the OSC part. If the data is too long for an OSC field it gets truncated.

    The reason for the lengths of fields in OSC is related to the width reserved for display. If they are too large for the display area they will wrap which will spoil the symmetry.

    There are good reasons not to modify the OSC part too much. Addons rely on a structure that is found in the release version. Tight coupling with OSC 2.3.3 will make migration to OSC 3.0 difficult.

     

Anonymous
Anonymous

Add attachments
Cancel