Wednesday, May 31, 2006

Drupal.. beginning...

Download " drupal-4.7.1.tar.gz" from drupal.org

Uncompress using,

# tar xvfz drupal-4.7.1.tar.gz

Put the uncompressed folder "drupal-4.7.1" to "/var/www"

/var/www/drupal-4.7.1/INSTALL.mysql.txt was useful in enabling mySQL to work with Drupal..

Already a database named "samarpanam" has been created...

So time to..do the drupal config..

edit "/var/www/drupal-4.7.1/sites/default/settings.php" and change

$db_url = "mysql://username:password@localhost/databasename"; line to suit local needs...

Save the file...

More details @ http://drupal.org/node/260

http://127.0.0.1:81/drupal-4.7.1/ in my mozilla browser gave the drupal site.... :-)

mySQL contd....

As said was a bit scared abt mySQL earlier... But Drupal demanded mySQL in place, so no other go!!

For standard configuration,

# cd /usr

# sudo ./bin/mysql_install_db --user=mysql

To know mySQL version,

# /usr/bin/mysqladmin version

To shut down,

# /usr/bin/mysqladmin -u root shutdown

To start back.

# /usr/bin/mysqld_safe --user=mysql &

Try the following,

# /usr/bin/mysqlshow

# /usr/bin/mysqlshow mysql

# /usr/bin/mysql -e "SELECT * FROM db" mysql

# mysqladmin -u root -p create samarpanam --> creates a database samarpanam...

To access database thru console:

# mysql -u root

Follow the syntax below for root password,

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

and this to create a new user,

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

'-p' has to be appended to all commands to execute since password has been set.

http://dev.mysql.com/doc/refman/5.0/en/unix-post-installation.html

is the real companion to proceed further i believe...

Java Plugin for Mozilla...

I think the file in the following path need to be linked to mozilla plugin,

/jdk1.5.0_07/jre/plugin/i386/ns7/libjavaplugin_oji.so

How to do that?

Go to,

# /usr/lib/mozilla/plugins

then create a Symbolic link using,

# ln -s /jdk1.5.0_07/jre/plugin/i386/ns7/libjavaplugin_oji.so .

Restart Mozilla. Goto Edit ---> Preferences ---> Plug-ins to check successful installation of plugin.

More details can be had from,

http://java.sun.com/j2se/1.5.0/manual_install_linux.html

Tuesday, May 30, 2006

Installing and Configuring Java+Tomcat..

Now that Apache2+PHP+MySQL is working fine up to me, its time to install and configure Java+Tomcat.

Installing and configuring Java:

http://java.sun.com/j2se/1.5.0/install-linux.html was really useful in this account.

From http://java.sun.com/j2se/1.5.0/download.jsp downloaded "jdk-1_5_0_07-linux-i586.bin"

To set permissions,

# chmod +x jdk-1_5_0_-linux-i586.bin

Copied jdk-1_5_0_07-linux-i586.bin to / directory.

# ./jdk-1_5_0_-linux-i586.bin (Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with "./")

Folder "jdk1.5.0_07" was created under / directory.

To Set Java environment variables:

# export JAVA_HOME=/jdk1.5.0_07/

# export PATH=$PATH:$JAVA_HOME/bin

Installation and Configuration of Tomcat:

From "http://tomcat.apache.org/download-55.cgi" downloaded apache-tomcat-5.5.17.tar.gz

# tar xvfz apache-tomcat-5.5.17.tar.gz

Copy the folder "apache-tomcat-5.5.17" to /usr/local

Open,

# gedit ~/.bashrc and add the following to the file,

#Stuff we added to make tomcat go
export JAVA_HOME=/jdk1.5.0_07/
export CLASSPATH=/usr/local/apache-tomcat-5.5.17/common/lib/jsp-api.jar:/usr/local/apache-tomcat-5.5.17/common/lib/servlet-api.jar


To start Tomcat,

# sh /usr/local/apache-tomcat-5.5.17/bin/startup.sh

and following has to appear

Using CATALINA_BASE: /usr/local/apache-tomcat-5.5.17
Using CATALINA_HOME: /usr/local/apache-tomcat-5.5.17
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-5.5.17/temp
Using JRE_HOME: /jdk1.5.0_07/

Now,

8080 is the default port and so,

http://127.0.0.1:8080/ should open the "Apache Software Foundation" properly from Mozilla.

To b contd...

Monday, May 29, 2006

Installing and Configuring Apache2+PHP+MySQL

My PC runs on Ubuntu. And just thought of configuring Apache2+PHP+MySQL

How do i do that?

https://wiki.ubuntu.com/ was really useful on this account.

Just typed PHP on the search window and it populated few results that took me to,

https://wiki.ubuntu.com/ApacheMySQLPHP?highlight=%28php%29

Installing Apache:

As root user run,

# aptitude install apache2

Installing PHP:

As root user run, and i preferred PHP4,

# aptitude install php4

Now its the turn for mySQL,

# aptitude install mysql-server
# aptitude install libapache2-mod-auth-mysql
# aptitude install php4-mysql


For want of GUI admin for mySQL and PHP admin did the following,

# aptitude install phpmyadmin

# aptitude install mysql-admin


Then follows the mySQL configuration which am yet to do and jumped to "PHP Configuration to Work With MYSQL"

To achieve this,

# gedit /etc/php4/apache2/php.ini

and remove the ";" before the line ";extension=mysql.so"

Commands used for Apache Start/ Stop/ Restart,

# /usr/sbin/apache2ctl start
# /usr/sbin/apache2ctl stop
# /usr/sbin/apache2ctl restart


To check PHP's fine funtioning,

# gedit /var/www/testphp.php

and add php phpinfo(); inside php tag and Save.

On mozilla browser, at http://127.0.0.1/testphp.php or http://localhost/testphp.php, I got the successful output.

This was working fine till i rebooted my PC.

Apache is not actually parsing the php after i rebooted my PC.

I believe port 80 used default by Apache was occupied and hence the problem.

# netstat -nap --inet|grep -w 80|grep -i listen

used the above command to plot which process is occupying port 80 and killed the process and restarted Apache and it started working fyn :-)

In order to fix this,

# gedit /etc/apache2/ports.conf

and changed "Listen 80" to "Listen 127.0.0.1:81"

This will also prevent it from listening for incoming connection attempts.

Now rebooting was not a problem and

http://127.0.0.1:81/ is running without parsing problems.

To be contd....