Configuring MySQL

Posted by Chief on Nov 12, 2009 in System Administration
No Comments

The following is how I set up MySQL on wharf.

  1. First, ensure mysql is installed: ls /etc/init.d/my*
  2. Now, make mysql start on boot: sudo /sbin/chkconfig --level 35 mysqld on
  3. Start the mysql server: sudo /etc/init.d/mysqld start
  4. Make MySQL more secure: sudo /usr/bin/mysql_secure_installation
  5. Log into mysql as root: mysql -u root -p [to be entered by prompt]
  6. Add another mysql user:
    mysql> CREATE USER 'newuser'@'%' IDENTIFIED BY 'newuserpass';
    mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'newuser'@'%';
    mysql> FLUSH PRIVILEGES;
  7. Exit mysql: mysql> exit
  8. Test: mysql -u <newuser> -p <newuserpass>

Tags: , , , , ,

Git – Install and Configure

Posted by Chief on Nov 4, 2009 in System Administration
No Comments

Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a centralized system if need be found. Read more …

Tags: , , , , , , , ,

Installing JDK on RHEL5

Posted by Chief on Oct 3, 2009 in System Administration
No Comments

I needed to install the JDK as a prerequisite for GeoServer.

Steps

  1. Download latest JDK (jdk-6u16-linux-i586-rpm.bin) from Sun.
    Note: navigating Sun’s website and using their download accelerator is a PAIN.
  2. chmod a+x jdk-6u16-linux-i586-rpm.bin
  3. sudo ./jdk-6u16-linux-i586-rpm.bin
  4. ls -l /usr/java
  5. Create file /etc/profile.d/java-jdk.sh
    1. sudo vi /etc/profile.d/java-jdk.sh
    2. cat /etc/profile.d/java-jdk.sh
      #!/bin/bash
      export JAVA_HOME=/usr/java/latest
      export JRE_HOME=/usr/java/latest/jre
      export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH

Tags: , , , ,

Compiling Datascope.so for PHP

Posted by Chief on Oct 10, 2008 in System Administration
No Comments

Does the following sentence make sense?

In order to be able to simply dl(“Datascope.so”) in your PHP code, you first need to make sure Datascope.so is compiled and copied to the extension_dir, as specified in php.ini (ex: /usr/lib/php4).

Answer:
No: Stop right now. You’re not qualified to read this article.
Yes: Keep reading.

Notes

You’re not compiling the PHP source code for actual use, so please don’t install it. If you do, you run the risk of clobbering any pre-existing php installations, and overwriting previously compiled-in modules. The only reason why you ”make” PHP is so that the Zend libraries are properly initialized.

The PHP ”make” step may be avoidable, but given that the compile doesn’t affect system performance, I didn’t bother.

Paths should be changed to reflect your setup. If you don’t have the src/contrib/data/php/datascope code, you can get it from the contrib source at BRTT’s web site.

Contrib appears to be maintained by Indiana University.

Paths

  • Antelope Bash Script ”/opt/antelope/4.9/setup.sh”
  • Datascope Source ”/opt/antelope/4.9/src/contrib/data/php/datascope”
  • PHP Source Code URL ”http://downloads.php.net/ilia/php-5.1.4.tar.bz2”
  • PHP Modules Directory ”/usr/lib/php/modules/”

Compile and Install Steps

  1. wget <PHP Source Code>
  2. bunzip2 php-5.1.4.tar.bz2
  3. tar xf php-5.1.4.tar
  4. cd php-5.1.4
  5. PHP_INC=`pwd`
  6. export PHP_INC
  7. ./configure
  8. make
  9. cd <Datascope Source>
  10. source <Antelope Bash Script>
  11. sudo make install
  12. sudo cp Datascope.so <PHP Modules Directory>

PHP Script Example

Proper usage of the ”Datascope.so” module follows:

putenv( "PFPATH=/opt/antelope/4.9/data/pf" );
putenv( "ANTELOPE=/opt/antelope/4.9" );
 
set_include_path(
  get_include_path().PATH_SEPARATOR.getenv('ANTELOPE')."/data/php"
);
 
 
if( !extension_loaded( "Datascope.so" ) ) {
  dl( "Datascope.so") || exit( "Failed to load datascope.so" ) ;
}

Tags: , , , , ,

Copyright © 2010 cat brain.log | less All rights reserved.
Shades v1.2 theme from BuyNowShop.com.