Ad_Feed

Tuesday, October 18, 2011

Install Solaris, Apache, Mysql & Php (SAMP)

You may be conversant with the terms LAMP and WAMP. This means a stack of applications.

For LAMP = Linux, Apache, Mysql and Php/Perl/Python.
For WAMP = Windows, Apache, Mysql and Php/Perl/Python.

To get your new Solaris 11 installation SAMP ready, we need to install Apache, Mysql and Php.

kilo@kilo:~$ sudo -s
Password:
root@kilo:/home/kilo#
root@kilo:/home/kilo# pkg refresh
root@kilo:/home/kilo# pkg install amp
               Packages to install:    12
           Create boot environment:    No
               Services to restart:     1
DOWNLOAD                                  PKGS       FILES    XFER (MB)
database/mysql-51                         3/12     554/729    59.0/75.2


When done, enable the apache and mysql service.
root@kilo:/home/kilo#svcadm enable apache22
root@kilo:/home/kilo#svcadm enable mysql

By default, the mysql root user has no password.
root@kilo:/home/kilo# mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.37 Source distribution

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

mysql>;


We can set the password for the root user in mysql using
root@kilo:/home/kilo#mysqladmin -u root password "PASSWORD"

If you get the error - 
bash: mysqladmin: command not found

It means that the command mysqladmin is not in the path.
root@kilo:/home/kilo# which mysqladmin
which: no mysqladmin in (/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin)
 
To solve this, use the full path for the command.
root@kilo:/home/kilo# find / -name mysqladmin
/usr/mysql/5.1/bin/sparcv9/mysqladmin
/usr/mysql/5.1/bin/mysqladmin

/usr/mysql/5.1/bin/mysqladmin -u root password "PASSWORD"

Configure pkg in Solaris to use proxy

To configure your Solaris image packaging retrieval client (pkg) to use proxy -

kilo@kilo:~$ sudo -s   (I am using solaris 11. su - root can also be used)
Password:
root@kilo:/home/kilo# 
root@kilo:/home/kilo#export http_proxy=”http://proxyusername:proxypassword@proxyservername:port

Replace the following -
proxyusername = your proxy account username
proxypassword = your proxy account password
proxyservername = your proxy server address
port = proxy port number

Tuesday, October 11, 2011

Access scanner from LTSP server and thin clients

There seem to be a permission issue with accessing usb scanners from LTSP server and connected thin clients. Logging in as normal users, you cannot access the connected scanner.

Running the scanimage command as a normal user 
ltsp@ltsp-ProLiant-DL380-G4:~$ scanimage -L
device `hp3900:libusb:001:011' is a Unknown RTS8822 chipset based flatbed scanner

while logging in as the root user, running the scanimage command gives the parameter of the connected scanner.
root@ltsp-ProLiant-DL380-G4:~# scanimage -L
device `hp3900:libusb:001:011' is a Hewlett-Packard Scanjet 3800 flatbed scanner

You can however use any scan utility, but you will need root access to do this. To correct this - Looking at the permission for the usb character file
ltsp@ltsp-ProLiant-DL380-G4:~$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 005: ID 1c4f:0002 SiGma Micro
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 011: ID 03f0:2605 Hewlett-Packard ScanJet 3800c
Bus 001 Device 009: ID 03f0:5c17 Hewlett-Packard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The user/group permission to the usb character device responsible for the connected usb device has read & write for the root user and group.
ltsp@ltsp-ProLiant-DL380-G4:~$ ls -l /dev/bus/usb/001
total 0
crw-rw-r--  1 root root 189,  0 2011-10-11 00:28 001
crw-rw-r--+ 1 root lp   189,  8 2011-10-11 13:03 009
crw-rw-r--+ 1 root root 189, 10 2011-10-11 09:17 011

Change the group from root to users. (In my case, the group users has all ltsp client users in that group)
root@ltsp-ProLiant-DL380-G4:/dev/bus/usb/001# chgrp users 011
root@ltsp-ProLiant-DL380-G4:/dev/bus/usb/001# ls -al
total 0
drwxr-xr-x  2 root root      100 2011-10-11 09:10 .
drwxr-xr-x  7 root root      140 2011-10-11 00:28 ..
crw-rw-r--  1 root root  189,  0 2011-10-11 00:28 001
crw-rw-r--+ 1 root lp    189,  8 2011-10-11 13:03 009
crw-rw-r--+ 1 root users 189, 10 2011-10-11 09:17 011

And now.......
ltsp@ltsp-ProLiant-DL380-G4:~$ scanimage -L
device `hp3900:libusb:001:011' is a Hewlett-Packard Scanjet 3800 flatbed scanner
ltsp@ltsp-ProLiant-DL380-G4:~$


Ubuntu 11.04 installation hangs on timezone selection

When installing Ubuntu 11.04, the installation process hangs on time zone selection.  The installation hangs because of your network (Internet) connection.

The trick in dealing with this is disable your network connection and restart the installation.



Monday, September 12, 2011

Drupal Internal links don't work after migration

In some cases, after migrating all internal links in drupal defaults to the homepage. If you encounter this issue, enable mod_rewrite in Apache.

For Ubuntu users,
sudo a2enmod rewrite

Restart Apache
sudo /etc/init.d/apache2 restart

 
You can also.......
(a) make sure that you have Drupal's .htaccess file
(b) make sure that the apache vhost which controls your site does not contain an AllowOverrides None which disables .htaccess files in your site's directory. Change it to AllowOverrides All

Monday, August 15, 2011

Moodle 2.1.1 - Redirect to 'My Moodle' page after user logon

To redirect users to their course page referred to as 'My Moodle' page after login in moodle 2.1.1,

Click on Site administrator -> Appearance -> Navigation -> Default home page for users -> My Moodle

Thursday, August 11, 2011

Moodle 2.0 - Convert database engine from MyISAM to InnoDB

This scenario usually occurs when you upgrade moodle. If upgrading from moodle-1.9 to moodle-2.1.1, there is a database engine compatibility issue.

In the moodle notification page, the message below usually pops up:
Database tables are using MyISAM database engine, it is recommended to use ACID compliant engine with full transaction support such as InnoDB.

To convert your database engine to InnoDB, run the innodb.php script in the directory of the admin directory which is resident in the moodle directory.
http://moodlesite.domain/admin/innodb.php
 
Replace moodlesite.domain with you moodle path or IP address.

Enable Apache "public_html" for users in Ubuntu 10.04

Enable mod_userdir, which is installed by default with Apache2.  
sudo a2enmod userdir   

Create public_html directory with the user's permissions
mkdir public_html   

I don't know if that is a bug or a feature. Edit file /etc/apache2/mods-available/php5.conf and comment out lines

...IfModule mod_userdir.c...
        ...Directory /home/*/public_html..
        ...php_admin_value engine Off
        .../Directory
    .../IfModule...

Restart Apache Finally, you should restart Apache.  
sudo /etc/init.d/apache2 restart  

You can test with http://localhost/~username  or http://ip-address-of-system/~username

Monday, July 25, 2011

How to configure rpm/debian package manager to use proxy

To configure package manager to use proxy in fedora, CentOS, ubuntu or generally any rpm/debian based linux, you will need to enter your proxy login details in apt.conf (for debian based) and yum.conf (for rpm based).


For RPM Based
Create or edit /etc/yum.conf and add the details below, replacing proxy-server, port, username and password with your own login details.

# The proxy server - proxy server:port number
proxy=http://proxy-server:port 

# The proxy account details 
proxy_username=username
proxy_password=password


For DEBIAN Based
Create or edit /etc/apt/apt.conf and add the details below, replacing proxy-server, port, username and password with your own login details.

ACQUIRE {
http::proxy "http://username:password@proxy-server:port/"
}

Monday, July 18, 2011

How to disable Reverse Proxy Filter on Bifrost during startup

Bifrost is an operating system modified, minimal and optimized Linux distribution, with the kernel configured for firewalling and routing. The filter which controls the firewall security policy, is part of the kernel code and can be configured via ipfwadm, ipchains or iptables. The Bifrost Network Project aims to find stability, performance, filter capabilities, administration, computer security, scalability and development possibilities of a Linux based streamlined router/firewall system. The hardware is basically a standard PC with two or more network interfaces or fiber ports (using preferably the Intel Tulip chip or an e1000 Gigabit card) and a flash disk.

Reverse proxy Filtering seems to be enabled by default on this OS. Even after disabling (setting value to 0) this in the rp_filter file,  a system reboot enables it back.

To disable reverse proxy filtering even at start-up, a script must be placed in the /etc/rc.d/rc.inet.local file to automatically set the value in rp_filter to 0 for all interfaces. To do this, follow the steps below:

remount disk in writeable mode

remount w
 
Edit the /etc/rc.d/rc.inet.local file and add the run script
#This script disables Reverse Proxy Filter during startup
for a in /proc/sys/net/ipv4/conf/*/rp_filter;

do
echo 0 > $a
done

To take effect, restart inet
/etc/rc.d/rc.inet.local

How to install Google Reader Indicator on ubuntu using PPA

Google Reader Indicator displays the number of unread items in your Reader account along with article title and excerpt. Click on an article will open it in your default browser.

Install Google Reader Indicator on ubuntu using PPA

Open the terminal and run the following commands

sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install google-reader-indicator

Cloned moodle site log in problem


I can't log in - I just stay stuck on the login screen (Extracted from Moodle)

This may also apply if you are seeing “Your session has timed out. Please login again” and cannot log in.
The following are possible causes and actions you can take (in no particular order):
  • Check first that your main admin account (which will be a manual account) is also a problem. If your users are using an external authentication method (e.g. LDAP) that could be the problem. Isolate the fault and make sure it really is Moodle before going any further.
  • Sessions may not be configured properly on the server. You can test this by calling the script http://yourserver/moodle/lib/session-test.php.
  • If your server is on shared hosting check that you have not reached your disk space quota. This will prevent new sessions being created and nobody will be able to log in.
  • Carefully check the permissions in your 'moodledata' area. The web server needs to be able to write to the 'sessions' subdirectory.
  • Your own computer (not your Moodle server) may have a firewall that is stripping referrer information from the browser. Here are some instructions for fixing Norton firewall products.
  • Try deleting the sessions folder in your moodledata directory (anybody currently logged in will be thrown out)
  • Try deleting cookies on your computer and/or try another browser or another client computer
  • In Site Administration > Server > Session handling, try setting a value for 'Cookie prefix'. You can also do this by setting $CFG->sessioncookie='something'; in config.php. This is especially true if you are using multiple Moodles on the same browser.
  • Make sure you have not removed or changed the Password Salt value(s) in config.php. If passwords were created using a salt the correct salt must be in config.php for those passwords to continue to work. This feature was optional since Moodle 1.6 but has been applied by default since 1.9.7.
  • Do you have a .htaccess file in your Moodle folder (or its parent directories). If so, is there anything in there that might be causing trouble (strange redirects, access restrictions etc.)?
  • You are using the correct username and password, yes?

Planned Changes to Next Ubuntu Version 10.04 (Lucid Lynx)

Planned Changes to Next Ubuntu Version 10.04 (Lucid Lynx)