Thursday, February 26, 2009

FEDORA + ZTE MF626 Modem + SmartBro

Here's my collected solution to the installation of ZTE MF626 Modem to Fedora 10.

First, download the usb_modeswitch from this site:
http://www.draisberghof.de/usb_modeswitch/#download
(What is this?)

You need this switcher because of the added function of the modem. It can also serve as a card reader. Unfortunately in F10, it does not automatically switches to modem operation unlike in Win platform.

The file downloaded will be in .tar.bz2 format. Place it in your favorite location (i.e. /usr/local/src).
Extract the file

----
#tar xfj usb_modeswitch.xxx.xx.tar.bz2
----

After extraction, a directory will be created and extracted files is inside that directory. Go to that directory.
Copy "usb_modeswitch" file to /usr/sbin
Copy "usb_modeshift.conf" file to /etc

----
#cp usb_modeswitch /usr/sbin
#cp usb_modeswitch.conf /etc
----

Edit the file /etc/usb_modeswitch.conf and locate the configuration which matches the MF626 modem and uncomment it.
---
#vi /etc/usb_modeswitch.conf
---

usb_modeswitch.conf
# ZTE MF628+ or MF 626
DefaultVendor= 0x19d2
DefaultProduct= 0x2000

TargetVendor= 0x19d2
TargetProduct= 0x0031

MessageEndpoint=0x04
MessageContent="xxxxxxxxxxxxxxxxxxxxxxx" (Do not edit the number)
#


Try and test the usb_modeswitch if results/reply will be successfull.

----
#usb_modeswitch
----


Next, add a new connection type in /etc/wvdial.conf . This will be invoked when you run the dialer. I gathered this from some other forum and tried to manipulate its content for proper operation of MF626 modem.

----
#vi /etc/wvdial.conf


wvdial.conf
#
Init1 = ATZ
Init2 = ATE1
Init3 = AT+CGDCONT=1,”IP”,”smartbro”
Modem Type = USB Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB2
New PPPD = yes
Baud = 912600
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Compuserve = 0
Dial Command = ATD
Ask Password = 0
FlowControl = NOFLOW
Username = user
Password = password
#

----


Next create a file in /usr/sbin which will initialize and create a usb serial device in /dev (In my case it created three, but only one is working: /dev/ttyUSB2).

----
#vi /usr/sbin/initmodem

insert the following lines

#!/bin/sh
modprobe usbserial vendor=0×19d2 product=0×0031 && usb_modeswitch
sleep 10


----

Now change the permissions for the created file and make it executable.

----
#chown nobody.nobody /usr/sbin/initmodem
#chmod 777 /usr/sbin/initmodem
----

Plug in your usb modem provided by smart and run the initmodem. This will initialize the serial port and the modeswitch for the dongle.
----
#initmodem
----

To connect to internet, just run the following line
----
#wvdial smartbro
----

After you run wvdial, you will see that the modem is trying to connect. Do not close the terminal for this will also disconnect your connection. Try to look for DNS1 and DNS2 and manually add it to you networks DNS list. Fedora does not capture the auto DNS of your current connection.

If initmodem does not create the said serial port, try to restart your pc but plug the dongle first.
Try to contact me if all else failed.

Cheers

Thursday, January 15, 2009

CAS + LDAP

Well, its been a while and right now I'm installing CAS + LDAP.

Install Java JDK's - required to start tomcat an compilers.
Try to store it anywhere, or in my case @ /opt.

/opt/jdk-version - usually u need V1.5 up.

Set environment variable JAVA_HOME=/opt/jdk-{version}

#export JAVA_HOME=/opt/jdk-{version}/

Install latest apache-maven (for compiling cas if possible)
Install latest apache-ant (for compiling using ant)

Download and Install Tomcat 5.5 (core - usually standalone).

Place tomcat anywhere, for me @ /opt/tomcat5.

Next off, try to run or execute Tomcat to see if it is working. Usually the howto's install and run
Tomcat is already packed within it's source. ( Check Readme or Install files.)
Then check to see if tomcat is running by visiting http://localhost:8080
Running Tomcat:
#/opt/tomcat5/bin/startup.sh
Shutting Tomcat:

#/opt/tomcat/bin/shutdow
n.sh

Download CAS server @ http://www.ja-sig.org/products/cas/downloads/index.html
Extract the archive in your favorite folder.
Explore the extracted file
s and test CAS. Use the war file located in one of its directories
ie. PATH/cas-server-{ve
rsion}/modules/cas{version}.war
Copy the war file to the to
mcat's webapps directory.

#cp /PATH/cas-server-{ver}/modules/cas{version}.war /opt/tomcat/webapps

Start Tomcat. Try to see catalina's logs or monitor the webapps directory of CAS if modules were copy and loaded. Check for errors.

#tail -f /opt/tomcat/logs/catalina.out

Visit the CAS login and test page if loaded successfully. http://localhost:8080/cas/login
Use the default username a
nd password to check if CAS is ok.

If successful, we now ha
ve to compile CAS to support ldap authentication.

Go to CAS source directory (where you extracted the dl'ed source).
CAS-PATH-source/cas-server-webapps

Edit the pom.xml in the directory and add the following line at the dependency area.

(from cas - ldap support)







(from spring ldap support)











I applied both support in my setup cause the first one does not work; well, maybe I just had wrong setup of my deployer.xml file and have to rebuild again and applied both in my new compilation.
Save the file and compile usin
g maven.

#mvn download
#mvn package


After compiling, check to see the subdirectory 'target' if contains *.war file.
You needed this file for tomcat. Remove all your previo
us version of CAS in tomcat's webapp directory and the previous war file. Copy the new war file to tomcat's webapps directory. check if dependencies were copied; or restart tomcat. Check for errors on its log files.

After installation of cas, edit deployerConfigContext.xml file for linking your CAS to an LDAP server.
Backup the original deployerConfigContext.xml file
. The following lines were added in my configuration.

Under the authenticationHandlers property add this lines







Before the end of the file (before the
closing) add this following
lines














Restart Tomcat. Check the CAS site again and use your ldap username and password.


:p