Access wikipedia during blackout

| 3 Comments

Chrome Users:

immediately click the stop button ( the x button ) after the page loads . That will not allow the javascript to run and thus the black screen will not be shown


Firefox Users:

Go to preferences, and click the content tab.
Then disable javascript , and you will be set to go

Solving mysql.sock problem in XAMPP,MAMP

| No Comments

# check path to socket from mysql settings
mysqladmin | grep d.sock

# create a symbolic link
ln -s path_to_mysql_socket /opt/lampp/var/mysql/mysql.sock

Changing base directory of drupal

| 2 Comments

This can be done in several easy steps.

1. Change the base dir in your settings.php to point to your root folder (public_html).

You can edit the file from your cPanel -> File Manager in the following way:

- Navigate to your /sites/default directory.
- Click on the letters next to the icon of settings.php
- A little box should appear on the top-right side of the page.
- Click on Edit File Contents and you should be able to edit the file.

2. Change the RewriteBase dir in your .htaccess file to be /

The contents of your .htaccess file should contain a line like the one below:

RewriteBase /


You can edit this file in the same way as you did with your settings.php file.

3. After that you should move all the Drupal files which are under your subdirectory to your root (public_html) folder. The best and easiest way to do this is using an FTP client.

Creating Drupal database for Islandora

| No Comments

x-128-101-146-59:~ birage$ mysqladmin -u root -p create agecon
Enter password:
x-128-101-146-59:~ birage$ clear

x-128-101-146-59:~ birage$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.51 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| agecon |
| fedora3 |
| fedora4 |
| javatest |
| mysql |
| test |
+--------------------+
7 rows in set (0.00 sec)

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `agecon`.* TO 'root'@'localhost' IDENTIFIED BY 'fedoraAdmin'; Query OK, 0 rows affected (0.02 sec)

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

mysql> quit
Bye
x-128-101-146-59:~ birage$

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Cron Job in Mac OSX Version 10.5 +

| No Comments

Source Drupal

MacOS X after 10.5 no longer seems to use cron and has replaced it by launchd. This uses plist files to register jobs to run. To access cron.php using launchd place the following file in /Users/your_account/Library/LaunchAgents/com.your_site.drupal_cron (create the directory if necessary):

com.x-128-101-146-59.drupal_cron.plist

This will then get loaded when you login and will visit the cron.php page every 300 seconds (5 minutes). To make it take affect you need to logout/login or use the terminal to run launchctl to load it immediately:

launchctl load /Users/your_account/Library/LaunchAgents/com.your_site.drupal_cron

If you need to change the plist file you can unload and reload it again with:

launchctl unload /Users/your_account/Library/LaunchAgents/com.your_site.drupal_cron
launchctl load /Users/your_account/Library/LaunchAgents/com.your_site.drupal_cron

(If you have XTools installed you can use /Developer/Applications/Utilities/Property List Editor to create plist files.)

Installing Islandora module

| 1 Comment

Source: https://wiki.duraspace.org/display/ISLANDORA/Islandora+Installation+Check+List

Below is a quick check list of items to be done/installed when installing Islandora.  Some of the items in the list will lead to pages of their own documenting how to do that step.

  • Install Java - steps to do this would depend on your os.
         you can check if your machine has java by typing java -version in the terminal.
         x-134-84-47-23:bin birage$ java -version
         java version "1.6.0_15"
        Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
        Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode  
         In Mac it is installed at /Library/Java/Home so JAVA_HOME should be set accordingly    
  • Install Ant - see http://ant.apache.org/.  Ant is useful when installing gsearch.
  • Set Environment variables such as JAVA_HOME and FEDORA_HOME.  See the Installation and Configuration Guide#Prepare Environment Variables
  • Install Mysql - steps to do this would depend on your os.  We are assuming Drupal will have a mysql database as its backend.
  • Install Postgres - steps to do this would depend on your os.  Postgres is optional.  You may want to use it as the Fedora database.  Mysql could also be used for the Fedora database.
  • Create a database schema for Fedora.  Steps to do this would depend on you chosen database.  See the Installation and Configuration Guide#Database
  • Download and Install Fedora.  See the Installation and Configuration Guide#Installation.  You can see how we answered the Fedora installation questions for a test server here.
  • Download and install gsearch.  Optional but recommended.  See the gsearch guide for instructions.
  • Edit the tomcat-users.xml file.  Optional but helpful if you want to start and stop individual webapps without shutting down tomcat.  More information on tomcat can be found here.
  • Install the Fedora demo objects.  See the Demostrations guide.
  • Edit the fedora-users.xml file.  Optional but recommended, if you want to allow anonymous access to  Fedora through Islandora this will have to be done.  See the Islandora Guide.
  • Install the DrupalFilter servlet filter.  See the Islandora Guide.
  • Install Apache httpd server.  Installation will depend on your os.
  • Enable url rewriting for Apache.  You would have to enable mod-rewrite.  Again this depends on your os.  Some info is available here.
  • Install and configure php.  There is some info in the Islandora Guide#Requirements regarding this.
  • Install Imagemagick.  This is optional but recommended as some of the default Content models use it.  Installing Imagemack would is system dependant so the steps would depend on your os.
  • Download and install Drupal.  See drupal.org for instructions.
  • Install the Drupal Imageapi module.  This module is used by some Islandora content models. LINK
  • Download and install the fedora_repository module.  See the Islandora Guide#Installation.
  • Enable the repository module.  Optionally enable the fedora_imageapi module.  See the Islandora Guide#Installation.
  • Create Drupal roles to assign to users.  One role you should create for sure is administrator.  This role has special rights in Fedora so don't assign this to anyone but an actual administrator.
  • Create Drupal users and give them roles.  For users to authenticate to Fedora they must have a role.  The default roles are not enough.  You must assign a role that has been created.  See drupal.org
  • See the Making the Demo SmileyStuff Islandora Aware page.
  • Visit the Islandora admin page and ingest the demo objects.  See the Islandora Guide.
  • Create your own Content Models and Collection Policies.  See the Islandora Guide#CreatinganIslandoraContentModel.
  • If gsearch is installed and you want to search more then the default fields modify the appropriate luceneToFoxml.xslt.  See the Gsearch guide.
  • Edit Islandora searchTerms.xml file.  If you have customized the fields indexed by lucene you can update the searchTerms.xml to let Islandora know what fields you want to search.  See the Islandora Guide#EnablingSearchandAdvancedSearch.
  • Enable the advanced search block.  See the Islandora Guide#EnablingSearchandAdvancedSearch.

Installing Fedora Commons Repository

| 3 Comments
First install MySQL Server and create a database to use with Fedora:


x-134-84-44-46:bin birage$ ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.44 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE fedora3 default charset utf8;
Query OK, 1 row affected (0.02 sec)

mysql> GRANT ALL ON fedora3.* TO adminFedora@localhost IDENTIFIED BY 'adminFedora';
Query OK, 0 rows affected (0.02 sec)

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

Now Proceed with your Fedora installation:

Download fedora binary and extract fcrepo-installer-3.4.jar
and from the terminal run the command from the directory > java -jar fcrepo-installer-3.4.jar

***********************
Fedora Installation
***********************

To install Fedora, please answer the following questions.
Enter CANCEL at any time to abort the installation.
Detailed installation instructions are available online:

http://www.fedora-commons.org/confluence/display/FCR30/

Installation type
-----------
The 'quick' install is designed to get you up and running with Fedora
as quickly and easily as possible. It will install Tomcat and an
embedded version of the Derby database. SSL support and XACML policy
enforcement will be disabled.
For more options, including the choice of hostname, ports, security,
and databases, select 'custom'.
To install only the Fedora client software, enter 'client'.

Options : quick, custom, client

Enter a value ==> custom

Fedora home directory
--------------
This is the base directory for Fedora scripts, configuration files, etc.
Enter the full path where you want to install these files.

Enter a value [default is /home/fedora/installfedora] ==> /Users/birage/fedora

Fedora administrator password
-------------------
Enter the password to use for the Fedora administrator (fedoraAdmin) account.

Enter a value ==> fedoraAdmin

Fedora server host
------------
The host Fedora will be running on.
If a hostname (e.g. www.example.com) is supplied, a lookup will be
performed and the IP address of the host (not the host name) will be used
in the default Fedora XACML policies.

Enter a value [default is localhost] ==>

Fedora application server context
----------------------
The application server context Fedora will be running in.
If 'fedora' (default) is supplied, the resulting context path
will be http://www.example.com/fedora
It must be ensured that the configured application server context
matches this path if explicitly configured.

Enter a value [default is fedora] ==>

Authentication requirement for API-A
------------------------
Fedora's management (API-M) interface always requires user authentication.
Require user authentication for Fedora's access (API-A) interface?

Options : true, false

Enter a value [default is false] ==> true

SSL availability
-----------
Should Fedora be available via SSL? Note: this does not preclude
regular HTTP access; it just indicates that it should be possible for
Fedora to be accessed over SSL.

Options : true, false

Enter a value [default is true] ==> false

SSL required for API-A
---------------
Should API-A be accessible exclusively via SSL? If true, requests
to access API-A URLs will be automatically redirected to the secure port.

Options : true, false

Enter a value [default is false] ==>

Servlet engine
---------
Which servlet engine will Fedora be running in?
Enter 'included' to use the bundled Tomcat 6.0.20 server.
To use your own, existing installation of Tomcat, enter 'existingTomcat'.
Enter 'other' to use a different servlet container.

Options : included, existingTomcat, other

Enter a value [default is included] ==> existingTomcat

Tomcat home directory
--------------
Please provide the full path to your existing Tomcat installation, or
the path where you plan to install the bundled Tomcat.

Enter a value [default is home/fedora/installfedora/tomcat] ==> /Users/birage/fedora/tomcat

Tomcat HTTP port
-----------
Which HTTP port (non-SSL) should Tomcat listen on? This can be changed
later in Tomcat's server.xml file.

Enter a value [default is 8080] ==>

Tomcat shutdown port
-------------
Which port should Tomcat use for shutting down? Make sure this doesn't
conflict with an existing service. This can be changed later in Tomcat's
server.xml file.

Enter a value [default is 8005] ==>

Tomcat Secure HTTP port
---------------
Which port (SSL) should Tomcat listen on? This can be changed
later in Tomcat's server.xml file.

Enter a value [default is 8443] ==>

Database
-----
Please select the database you will be using with
Fedora. The supported databases are Derby, McKoi, MySQL, Oracle and Postgres.
If you do not have a database ready for use by Fedora or would prefer to
use the embedded version of Derby bundled with Fedora, enter 'included'.

Options : derby, mckoi, mysql, oracle, postgresql, included

Enter a value ==> mysql

MySQL JDBC driver
-----------------
You may either use the included JDBC driver or your own copy.
Enter 'included' to use the included JDBC driver, or, enter the location
(full path) of the driver.

Enter a value [default is included] ==>

Database username
-----------------
Enter the database username Fedora will use to connect to the Fedora database.

Enter a value ==> root

Database password
-----------------
Enter the database password Fedora will use to connect to the Fedora database.

Enter a value ==> fedoraAdmin

JDBC URL
--------
Please enter the JDBC URL.

Enter a value [default is jdbc:mysql://localhost/fedora3?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true] ==>

JDBC DriverClass
----------------
Please enter the JDBC driver class.

Enter a value [default is com.mysql.jdbc.Driver] ==>

Validating database connection...Successfully connected to MySQL
OK

Enable FeSL AuthN
-----------------
Enable FeSL Authentication? To continue to use Fedora's legacy
authentication, enter "false" below. Please note that Fedora's legacy
authentication is expected to be phased out in a subsequent release.
For more information, see: http://fedora-commons.org/confluence/x/h4Ov

Enter a value [default is true] ==> false

Enable FeSL AuthZ (Experimental Feature)
----------------------------------------
Enable FeSL Authorization? This is an experimental replacement for Fedora's
legacy authorization module, and is still under development.
Production repositories should NOT enable this, but we invite you to try it
out and give us feedback.
For more information, see: http://fedora-commons.org/confluence/x/h4Ov

Enter a value [default is false] ==>

Policy enforcement enabled
--------------------------
Should XACML policy enforcement be enabled? Note: This will put a set of
default security policies in play for your Fedora server.

Options : true, false

Enter a value [default is true] ==>

Low Level Storage
-----------------
Which low-level (file) storage plugin do you want to use?
We recommend akubra-fs for new installs. If you are upgrading Fedora from
version 3.3 or below, you should use legacy-fs for compatibility with your
existing storage. Other plugins are also available, but they must be
configured after installation. For more information, please see
https://wiki.duraspace.org/x/Voqv

Options : akubra-fs, legacy-fs

Enter a value [default is akubra-fs] ==>

Enable Resource Index
---------------------
Enable the Resource Index?

Options : true, false

Enter a value [default is false] ==> true

Enable Messaging
----------------
Enable Messaging? Messaging sends notifications of API-M events via JMS.

Options : true, false

Enter a value [default is false] ==>

Deploy local services and demos
-------------------------------
Several sample back-end services are included with this distribution.
These are required if you want to use the demonstration objects.
If you'd like these to be automatically deployed, enter 'true'.
Otherwise, the installer will put the files in your FEDORA_HOME/install
directory in case you want to deploy them later.

Options : true, false

Enter a value [default is true] ==> true

Preparing FEDORA_HOME...
Configuring fedora.fcfg
Installing beSecurity
Will not overwrite existing /Users/birage/fedora/tomcat/conf/server.xml.
Wrote example server.xml to:
/Users/birage/fedora/install/server.xml
Preparing fedora.war...
Processing web.xml
Deploying fedora.war...
Deploying fop.war...
Deploying imagemanip.war...
Deploying saxon.war...
Deploying fedora-demo.war...
Installation complete.

----------------------------------------------------------------------
Before starting Fedora, please ensure that any required environment
variables are correctly defined
(e.g. FEDORA_HOME, JAVA_HOME, JAVA_OPTS, CATALINA_HOME).
For more information, please consult the Installation & Configuration
Guide in the online documentation.
----------------------------------------------------------------------

x-134-84-44-155:~ birage$ echo $PATH
/Users/birage/Fedora/server/bin:/usr/bin:/bin:/usr/local/mysql/bin:
x-134-84-44-155:~ birage$ export FEDORA_HOME="/Users/birage/fedora"
x-134-84-44-155:~ birage$ echo $FEDORA_HOME
/Users/birage/fedora

Installing Apache Solr Drupal Module on Tomcat

| 2 Comments

Installing Apache Solr in Tomcat for Drupal (Snow Leopard)

(Note: If you are planning to use FEDORA on Tomcat then FEDORA installation offers to install an instance of Tomcat which is very easy and saves a lot of time. Check out this link for more details)

There's quite a few information available on how to install Apache Solr for your Drupal website. One of the best places to start is the Apache Solr Search Integration module documentation page. In this post I will gather all the bits and pieces for installing Solr in Tomcat on one specific platform: Snow Leopard. This is the platform I'm developing Drupal sites on and the great thing is it has all the needed Java stuff built in, so it's quite easy to install Solr and Tomcat.

Install guide

  • Download and install the Apache Solr Search Integration module. 
  • Download the Apache Solr PHP Client. As of the module requires revision 22.
  • Extract this package and move the resulting folder to the module folder. You will now have something like [YOUR-MODULES-FOLDER]/apachesolr/SolrPhpClient/Apache/Solr/Service.php. 
  • Download Apache Solr. You might find a faster and newer version for your location on the downloads overview page.
  • Extract this package and move it to a folder of your liking. I'm using ~/bin/apache-solr-1.4.0.
  • Copy solrconfig.xml and schema.xml from the module folder to the Solr instance configuration folder. In my case this is in ~/bin/apache-solr-1.4.0/example/solr/conf. You might want to rename the schema and config file in that folder first to keep a backup. Download the core binary distribution of Apache Tomcat 6 (direct link for 6.0.24). Extract this package and move it to a folder of your liking. I'm using ~/bin/apache-tomcat-6.0.24. 
  • Copy the Solr web application~/bin/apache-solr-1.4.0/dist/apache-solr-1.4.0.war to your Tomcat webapps folder and rename it to solr.war. In my case this resulted in ~/bin/apache-tomcat-6.0.24/webapps/solr.war. Start and immediately shutdown Tomcat by running the following in your terminal (from your home folder): ~/bin/apache-tomcat-6.0.24/bin/startup.sh ~/bin/apache-tomcat-6.0.24/bin/shutdown.sh Note that the exact Tomcat folder name might depend on the Tomcat version you downloaded..
  • This will unpack the war file resulting in a folder ~/bin/apache-tomcat-6.0.24/webapps/solr/.
  • We now just have to point the Solr web application in Tomcat to the Solr example application. You can do this by adjusting the web application configuration file (WEB-INF/web.xml). Uncomment the section specifying the solr/home environment variable and set its value to the path of your Solr example application folder. In my case the configuration file was located at ~/bin/apache-tomcat-6.0.24/webapps/solr/WEB-INF/web.xml and after replacing the solr/home section I had  solr/home /Users/biraj/bin/apache-solr-1.4.0/example/solr java.lang.String
  • Make sure you uncomment the tags . I wasted couple of hours because I did not notice it. And use the absolute path to the solr/conf path. ~ often causes problems.
  • Your system is now set up and you can start Tomcat now issueing the following command in your terminal. ~/bin/apache-tomcat-6.0.24/bin/startup.sh
  • You can access the Solr admininstration interface now at http://localhost:8080/solr/admin/.

Recent Comments

  • ellenmorrison990@yahoo.com: Thanks for the excellent assistance provided. You have shared really read more
  • louis_walton@rocketmail.com: Thank you for sharing this valuable info. It will be read more
  • karenjordan552@yahoo.com: It really works!Thank you for sharing this smart trick with read more
  • johnesnancy@yahoo.com: Thanks for the detailed information, it really helps alot in read more
  • onlinehitches@gmail.com: This was great information. Helped alot in order to get read more
  • Burton Haynes: Nice blog and I really like what you need to read more
  • Luigi Fulk: Thanks for all of the information. On a side notice, read more
  • filmy erotyczne: Ive got look through your other useful article and i read more
  • Deividas Kripas: Nice post. Love your blog read more
  • sitodruk: I don’t even know how I ended up here, but read more

Find recent content on the main index or look in the archives to find all content.