Installing ICSD-for-WWW

Installing an ICSD-for-WWW Server

(On Windows, unzip files and change access using the GUI)


17 February 2006 [⚠ Outdated zone]

Always use the latest version of this file. Regularly perform step 2 below to update your ICSD-PHP software.

Important: You do not need to install anything to use ICSD-for-WWW from an existing server.
These instructions are only needed if you want to set up a local server on a Windows, Linux, Macintosh SGI, Sun, HP or IBM-AIX machine using Apache+PHP+MySQL. The ICSD-for-WWW search routines, written in PHP, are machine independent, but a modern PC under Linux or Windows will probably be faster than an older Unix machine.
You may not modify or use this software or database for any other purpose.

Special 1-step Windows installation of ICSD-for-WWW server

You can quickly install the complete package for Windows-2000 or -XP by downloading icsd-win.zip (15 Mbyte) to your C: disk and doing "Extract Here" to produce the directory "jaws" (Just Another Web Server). Then go to the C:\jaws directory and double-click the first 4 *.bat files to start your Apache and MySQL servers. Open http://localhost/icsd/ and it should work, both for you and for others on your network.
Notes:
  • Regularly perform step 2 below to update your ICSD server software. Do it now, it's very easy.
  • If you get an error "Unknown MySQL Server Host" it is probably because your "dbconfig.php" and "password.php" files are missing from your icsd directory. Copy them from your last install, or download and unzip dbconfig.zip, copy the standard files to your icsd directory, and edit these two files to set up your local configuration.
  • If Apache fails to install, another application like Skype may be using port 80. There is an option in the Skype connection tab that says "Use port 80 and 443 as alternatives..." Uncheck it and restart Skype.
  • ILL-FIZ cannot accept responsibility for possible security issues in operating a Windows server, which should be protected by a firewall.

  • Updating the ICSD-for-WWW database for licensed users

    Licensed users will receive a CD from FIZ every 6 months with new data (several thousand new entries). To update your server, unzip the data folder called eg "icsd-full-2005-2.zip" and copy the new database folder "icsd" that it contains to replace that already in your "mysql\data" folder. You may need to stop and restart your MySQL server to initialise the new data. At the same time, update your ICSD server software from step 2. If you dislike updates, you can instead subscribe to use FIZ's own ICSD server which is updated regularly.

    Otherwise, Installing ICSD-for-WWW server in 4 steps

  • 1 Install an Apache+PHP+MySQL WWW server. Apache may already be installed for linux/unix/OSX, but you will probably need to install PHP-MySQL from your system disks. A complete package (jaws) is available for MS-Windows. If you are a commercial company, you may want to check your license rights for MySQL, but MySQL.com have confirmed that ICSD-for-WWW qualifies under the open source GNU General Public License.

    Test your Apache+PHP+MySQL installation. Do not install the PHP-HTML files until PHP is working.

  • 2 Download icsd.zip, the ICSD PHP software, and unzip it in your html directory eg /srv/www/htdocs/ or C:\jaws\htdocs\ to produce directory icsd. This is the only file you need to download to update the interface and search software, but if you get an error "Unknown MySQL Server Host" it is probably because your "dbconfig.php" and "password.php" files are missing from your icsd directory. Copy them from your last install, or download and unzip dbconfig.zip, and copy the standard files to your icsd directory Note: If you have not previously installed this PHP software, you will need to download and unzip dbconfig.zip to your icsd directory, and edit these two files to set up your local configuration. If you do not have "unzip" (on some unix systems) install it or else unzip files on a PC.
    unzip icsd.zip will create the PHP-HTML directory icsd. Note: the same version for all computers. [Beware: files not updated to 2019 version]

  • 3 Download icsdd.zip, the ICSD demo database, to the MySQL directory eg /var/lib/mysql/ or C:\jaws\system\mysql\data\
    unzip icsdd.zip will create the demo data directory icsdd. Note: same version for all computers
    When you obtain the full MySQL ICSD database from FIZ Karlsruhe, copy icsd-full.zip to the same MySQL data directory and unzip icsd-full.zip. This will overwrite the original icsd directory which simply contains a copy of icsdd, the demo database.

    You may need to read-enable all icsd data files using eg Unix command chmod -R a+r icsd (or clicking the folder with the right mouse button in windows and selecting properties). You will also need to refresh the MySQL server using eg Unix command mysqladmin --password=[your pwd] refresh or rebooting the system. [Beware: files not updated to 2019 version]

    You should now be able to use ICSD-for-WWW, but you will need icsd-cgi.zip to enable all features.
    (If you have an old version of the ICSD-for-WWW server, most of these features may already work).

  • 4 Download icsd-cgi.zip, the ICSD support applications, to your cgi-bin directory eg /srv/www/cgi-bin/ or C:\jaws\cgi-bin\
    unzip icsd-cgi.zip will create the cgi-bin/icsd directory. Note: different versions for different computers
    If icsd-cgi.zip is not available for your server, you can still run ICSD-for-WWW,
    but without the features to draw structures, plot powder patterns etc. [Beware: files not updated to 2019 version]

    Other Server Software: This may be already present (it is provided in the Windows package). Without these applications, ICSD-for-WWW will be missing some features, but will still work fine. You need gzip to compress files, ghostscript gs to convert postscript files to PDF, vrml1tovrml2 (only available for Windows & SGI) to convert VRML1 to VRML2 structures.

    Testing ICSD-for-WWW

  • Point your browser to http://localhost/ or your server.
    If you obtain an error, check that the httpd server is installed and running

  • Create a file info.php containing just <?php phpinfo(); ?> in your html base directory.
    Point to http://localhost/info.php (info.php on your server). Your PHP installation should be summarised.

    Important: Do not install ICSD-for-WWW until PHP is working, and delete file info.php after testing.

  • Under Unix, type "which mysql" in a shell. If mysql is not found, check that MySQL is installed and running.

  • After you have installed ICSD-for-WWW, go to the icsd input form and try to run a query
    If you get an error such as Access denied, check the MySQL user access permissions

  • Possible Problems and Solutions (use only if you have a problem :-)

  • The most common unix problem is file permissions. If you have a problem accessing files, check:

    The htdocs/icsd and cgi-bin/icsd directories and all subdirectories should have read permission for all.
    Note: If other users can logon to your server, you should restrict read access to the Apache user.
    >cd htdocs/icsd
    >find . -type d -exec chmod 755 {} \;
    >find . -type f -exec chmod 644 {} \;
    >cd cgi-bin/icsd
    >find . -type d -exec chmod 755 {} \;
    >find . -type f -exec chmod 644 {} \;

    The htdocs/icsd/tmp directory and files must have read/write permission for all.
    >cd htdocs/icsd/tmp
    >chmod 777 .

    The MySQL data directories and files must by owned by mysql.daemon and have read permission.
    >cd /var/lib/mysql
    >chown -R mysql.daemon *
    >chmod -R a+r *

  • "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"
    This is a fairly common problem with a new PHP-MySQL installation. Check that in /etc/php.ini the variable mysql.default_socket is empty, and then the default MySQL socket file, given in /etc/my.cnf (eg /var/lib/mysql/mysql.sock) will be used. See the MySQL WWW manual for a summary of common MySQL problems and solutions.

  • If some features fail with PHP-5
    If you have trouble with PHP-5, try setting register_globals=On & register_long_arrays=On.
    These parameters are found in the /etc/php.ini file (thanks to Bud Dickerson).

    ICSD Access Permissions (if you have the full database).

    The server administrator is responsible for ensuring that the full ICSD database cannot be accessed by unlicensed users. (The demo database can be accessed by default).

    In file icsd/dbconfig.php there are two alternatives to set access permissions.

  • Domain name/IP recognition. Access is provided if part of the IP address or name is found in array $domain. To provide access to all (within a firewall) set $domain=array("."); to deny access to all (forcing password recognition) replace the "." with an long string of random characters.
  • Username/Password recognition. If domain recognition fails, a username/password is checked against an encrypted list (usually in) bin/.passwd. This list, which is compatible with passwords used by the .htaccess system, may be generated by the administrator from the un-encryted list .users by running .passupdate.php
  • Please check access by connecting from a domain outside the domain of your server!

  • If the apache server is configured with "performance cache enabled" (default with Mac OS0X), it may return the Host-IP rather than the Client-IP. The Performance Cache can be disabled in ServerAdmin -> Web ->Settings->Options
  • With old versions of apache (1.3.xx) you need to use an extra module (mod_proxy_add_forward) on the server which runs a proxy, to get the HTTP_X_FORWARED_FOR variable in the http header. With Apache 2.0 mod_proxy this is not anymore necessary, as it is included by default.

  • Installing Apache+PHP+MySQL on Windows, Linux, SGI, Sun…

    Apache, PHP and MySQL are not provided nor supported by FIZ/ILL, but may be freely downloaded.

  • Windows-2000/XP Apache+PHP+MySQL install
    The following applies if you don't want to install everything all at once. Download jaws.zip, a complete Apache+PHP+MySQL package for Windows, to the root of your main disk C: unzip jaws.zip (This is a simplified version of JAWS). Go to C:\jaws and check that the directories cgi-bin, htdocs, icons and system exist. As Windows administrator, double-click the *.bat files 1.1, 1.2, 2.1, 2.2 to install & start Apache & MySQL. Note: to un-install jaws, just run the remaining scripts and delete the jaws directory.
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • Linux Apache+PHP+MySQL install
    Mount your linux system disks, search for all packages "Apache", "PHP" and "MySQL"
    Install the basic versions if they are not already installed (usually Apache is already installed).
    For help, try the WWW pages of Suse, Redhat, Mandrake, Debian for your particular linux version.
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • SGI Apache+PHP+MySQL install
    Apache or another WWW server is usually already installed. Install PHP & MySQL as well.
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • Sun Apache+PHP+MySQL install
    Apache or another WWW server is usually already installed. Install PHP & MySQL as well.
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • IBM-AIX Apache+PHP+MySQL install
    Ported and tested by Kathy Tzeng of IBM Chemistry and Life Sciences Solutions Development.
    Install Apache, PHP and MySQL from the IBM-AIX website. Update libphp4.so to version 4.3.1 if necessary. Modify /etc/opt/freeware/apache/httpd.conf as follows
    LoadModule  php4_module libexec/libphp4.so
    AddModule   mod_php4.c
    AddType  application/x-httpd-php .php
    
    Copy /etc/opt/freeware/apache/php.ini to /usr/local/lib/php.ini
    Copy pgdisp and grfont.dat from cgi-bin/icsd/bin/ to /usr/bin
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • Macintosh OSX-10.3 (Panther) Apache+PHP+MySQL install
    Apache+PHP+MySQL is usually installed with Mac OSX-10.3 (Panther), but you may need instructions to activate PHP-MySQL. The pattern and structure generator applications have been compiled for Mac OSX-10.3 by Christian Baerlocher, who uses Mac OSX for his ICSD server.
    Important: Test Apache+PHP+MySQL before installing ICSD-for-WWW.

  • Other Computer Systems
    If all else fails,
    Apache binaries can be downloaded from the Apache site
    MySQL-4.0 binaries can be downloaded from the MySQL site
    PHP Binaries may be listed on the PHP site.

    MySQL User Access Permissions

    If you get:
    Access denied for user: 'dba@localhost' (Using password: YES)"
    then you must add user/password=dba/sql. You can do this using the GUI tool phpMyAdmin or else from the Unix/DOS shell.

    Installing phpMyAdmin

    Download phpMyAdmin and unzip the file in your htdocs directory (or elsewhere), then open the resulting phpMyAdmin directory in your WWW browser. You will get the error message:
    The $cfgPmaAbsoluteUri directive MUST be set in your configuration file!.

    Edit the file config.inc.php in your phpMyAdmin directory and set the variable $cfgPmaAbsoluteUri to the full URL of your phpMyAdmin directory eg http://icsd.myserver.net/phpMyAdmin/. You will now get a welcome message in your browser, probably followed by an error message such as
    Access denied for user: 'root@localhost' (Using password: NO)
    In config.inc.php, set $cfgServers[$i]['password'] to your password, or else change $cfgServers[$i]['auth_type'].

    Now you should have a phpMyAdmin GUI-interface that will allow you to add users and generally administer your MySQL databases "icsd" and "icsdd". Click on Users and create a user dba with password sql and No Privileges. You should also have an administrator user with a password and All Privileges. You will be asked to enter that user name/password when you connect to MyAdmin. After making any changes, click Reload MySQL and log-out.

    Adding a MySQL user from the unix/DOS shell

    To summarise, in a shell in the mysql.exe directory eg C:\Program Files\WebServer\MySQL5.1\bin\ do the following commands (in bold): Don't forget the ";" termination.
    >mysql --user=root mysql
    Note: If a mysql-root password is already set eg "your_password", you must instead do:
    >mysql --user=root mysql --password=your_password

    mysql> INSERT INTO user (Host,User,Password)
    -> VALUES ('localhost','dba','sql');
    Query OK, 1 row affected (0.03 sec)

    mysql> INSERT INTO db
    -> (Host,Db,User,Select_priv)
    -> VALUES ('localhost','icsdd','dba','Y');
    Query OK, 1 row affected (0.00 sec)

    mysql> INSERT INTO db
    -> (Host,Db,User,Select_priv)
    -> VALUES ('localhost','icsd','dba','Y');
    Query OK, 1 row affected (0.00 sec)

    mysql> SET PASSWORD FOR root@localhost=PASSWORD('your_password');
    Query OK, 0 rows affected (0.00 sec)
    (Note: This sets the mysql-root password to 'your_password' – see above)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)

    mysql> quit
    Bye

    For more details see the MySQL WWW pages Adding New Users


    The ICSD database is copyright 2003-2007 by Fachinformationszentrum (FIZ) Karlsruhe
    Please report technical problems with ICSD for WWW to hewat@ill.fr (Alan Hewat).