Thursday, May 28, 2009

Setup Samba - Filesharing with Windows


Setup Samba - Filesharing with Windows
If you have other Windows computers on your LAN and want to share files from Linux with them, you must setup Samba.
To setup Samba you must (1) install samba, (2) add you 'shares', (3) add users, (4) start Samba service and (5) manage security options (Firewall and SELinux).

1. Install Samba
It is best to have Samba installed in the installation process. If not < users can install using the command line:

[alex@localhost ~]$ sudo yum install samba samba-client

2. Add Shares
You must edit /etc/samba/smb.conf as root: (use nano instead of gedit if you do not have a GUI)

[alex@localhost ~]$ sudo gedit /etc/samba/smb.conf
Set your Windows Workgroup name in [global] section.
Added shares at the end of the file. Example:

workgroup = WORKGROUP
server string = Samba Server Version %v

# A publicly accessible directory, but read only, except for people in
# the "staff" group
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = +staff

[Share]
comment = Samba shares
path = /home/commons
read only = no
valid users = alex
create mask = 0775
directory mask = 0775
#
# New additional samba shares
#
[mnt_local]
comment = Local shares
path = /mnt/local
public = yes
writable = yes
browseable = yes

[mnt_resume]
comment = Resume partition
path = /mnt/resume
public = yes
writable = yes
browseable = yes

[mnt_account]
comment = Accounts partition
path = /mnt/account
public = yes
writable = yes
browseable = yes




If 'writable' the location must be writable in Linux first. Additionally permissions must match (for example: drw-rw-rw-).
If home data (all personal files under /home/username) is to be accessible, then set 'browseable = yes' under [homes] (~line 250). This configuration file is very descriptive, read through it to get more ideas or information.

3. Add Users
To access shares, you must be a valid user. Add valid users AND passwords using the smbpasswd command.
This login name WILL be the login name and password you use from Windows to access your Linux computer. The password does NOT need to match your Linux password.

[alex@localhost ~]$ sudo smbpasswd -a alex
New SMB password:
Retype new SMB password:
account_policy_get: (warnings ignored)
Added user username.
(Note: 'alex' MUST be a valid account on the Fedora machine)

4. Start Samba Service
Run samba and check for any errors:

[alex@localhost ~]$ sudo /etc/init.d/smb start
Starting SMB services: [ OK ]
Use chkconfig or serviceconf to enable samba (smb) in both runlevels 3 and 5. This will make sure to run Samba each time Fedora boots.

[alex@localhost ~]$ /sbin/chkconfig --list smb
smb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[alex@localhost ~]$ sudo /sbin/chkconfig --level 35 smb on
[alex@localhost ~]$ /sbin/chkconfig --list smb
smb 0:off 1:off 2:off 3:on 4:off 5:on 6:off
Restart Samba for every change to users/passwords or 'smb.conf'
[alex@localhost ~]$ sudo /etc/init.d/smb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]

5. Managing Security for Samba
Firewall
The Firewall will by default block Samba, to allow access run:

[alex@localhost ~]$ system-config-firewall

To allow Samba access to work through the firewall you must set 'Samba' as a 'Trusted Service' and hit 'Apply'. Alternatively if you are only using the shell and do not have access to a graphical X-server, you can run:

[alex@localhost ~]$ sudo system-config-firewall-tui

To allow Samba access to work through the firewall, use to go to Customize. In the Trusted Services: scroll down to Samba, hit and use again to go to Close, then finally to OK.
SELinux
SELinux has significant control over restricting different parts of Samba. Run system-config-selinux. Please read lines #23 - #51 in /etc/samba/smb.conf for a better explanation. Alternatively, you can run:

[alex@localhost ~]$ system-config-selinux
Go to Boolean and type 'samba' in the Filter (without quotes).
The following is NOT complete and is NOT recommended but is a quick enable to allow Samba to work permissively through SELinux.
[alex@localhost ~]# sudo /usr/sbin/setsebool -P samba_export_all_rw on
Alternatively, you can ignore SELinux at this point and try to access your shares in Windows and SELinux TroubleShooter should give an automatic pop-up in GNOME explaining what is wrong. If you follow those recommendations you most likely will be more secure.
For any changes made above to the SELinux settings or smb.conf, it is recommended to restart Samba.
Top Resources

More Information
Fedora 10 - Services and Daemons in Fedora 10
Fedora 10 Blog Entries
Fedora Nvidia Driver Install Guide
Fedora 9 - Personal Installation Guide
Fedora 9 Update and Nvidia Update
Update to RPMFusion
Fedora Core 5 on Dell D810 Latitude Laptop
Managing Services in Fedora
Fedora Help Forum Posts and Threads
Top Resources

5. Managing Security for Samba

Firewall

The Firewall will by default block Samba, to allow access run:

[mirandam@charon ~]$ system-config-firewall

To allow Samba access to work through the firewall you must set 'Samba' as a 'Trusted Service' and hit 'Apply'. Alternatively if you are only using the shell and do not have access to a graphical X-server, you can run:

[mirandam@charon ~]$ sudo system-config-firewall-tui

To allow Samba access to work through the firewall, use to go to Customize. In the Trusted Services: scroll down to Samba, hit and use again to go to Close, then finally to


OK.



Thursday, May 7, 2009

UNIX network analysis


Finding open ports on your workstation
[root@localhost alex]# nmap -T Aggressive -O 192.168.0.106

Starting Nmap 4.76 ( http://nmap.org ) at 2009-05-07 11:38 EDT
Interesting ports on 192.168.0.106:
Not shown: 991 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
902/tcp open iss-realsecure
1521/tcp open oracle
3306/tcp open mysql
6000/tcp open X11
8009/tcp open ajp13
8222/tcp open unknown
8333/tcp open unknown
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.15 - 2.6.25
Network Distance: 0 hops

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 2.49 seconds

Finding other services on your network
[root@localhost alex]# nmap -sT 192.168.0.106/22

Starting Nmap 4.76 ( http://nmap.org ) at 2009-05-07 11:47 EDT
Stats: 0:00:08 elapsed; 104 hosts completed (2 up), 2 undergoing Connect Scan
Connect Scan Timing: About 84.28% done; ETC: 11:48 (0:00:00 remaining)
Interesting ports on 192.168.0.1:
Not shown: 998 closed ports
PORT STATE SERVICE
80/tcp open http
5678/tcp open unknown
MAC Address: 00:1C:F0:54:4C:67 (D-Link)

Interesting ports on 192.168.0.100:
Not shown: 999 filtered ports
PORT STATE SERVICE
10000/tcp open snet-sensor-mgmt
MAC Address: 00:11:A0:04:59:EA (Vtech Engineering Canada)

Interesting ports on 192.168.0.106:
Not shown: 991 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
902/tcp open iss-realsecure
1521/tcp open oracle
3306/tcp open mysql
6000/tcp open X11
8009/tcp open ajp13
8222/tcp open unknown
8333/tcp open unknown

Nmap done: 1024 IP addresses (3 hosts up) scanned in 98.37 seconds
[root@localhost alex]#

Discovering hosts on your network
[root@localhost alex]# arp
Address HWtype HWaddress Flags Mask Iface
192.168.0.1 ether 00:1c:f0:54:4c:67 C wlan0


Finding other hosts on your network
[root@localhost alex]# nmap -sP 192.168.0.106/22

Starting Nmap 4.76 ( http://nmap.org ) at 2009-05-07 11:41 EDT
Host 192.168.0.1 appears to be up.
MAC Address: 00:1C:F0:54:4C:67 (D-Link)
Host 192.168.0.100 appears to be up.
MAC Address: 00:11:A0:04:59:EA (Vtech Engineering Canada)
Host 192.168.0.106 appears to be up.

Nmap done: 1024 IP addresses (3 hosts up) scanned in 81.99 seconds
[root@localhost alex]#

Windows How do I tell if a TCP network port is open or not?

So how do I tell if a TCP or UDP network port is open or not under UNIX or Linux oses?
Sure iptables can be used to block or open port or to apply packet filtering.
However any program can open a network port. For example if use has access to gcc / cc compiler she can open a port.

So it is necessary to list open TCP or UDP ports.

List open TCP port with netstat

Use netstat command to list open tcp port
Code:

[root]# netstat -tulpn

Output:
Code:

tcp        0      0 0.0.0.0:22               0.0.0.0:*                   LISTEN      11960/sshd
tcp        0      0 127.0.0.1:3306           0.0.0.0:*                   LISTEN      3992/mysqld
tcp        0      0 64.19.12.xx:80           0.0.0.0:*                   LISTEN      9474/lighttpd
tcp        0      0 64.19.12.xx:80           0.0.0.0:*                   LISTEN      9474/lighttpd
tcp        0      0 127.0.0.1:25             0.0.0.0:*                   LISTEN      1859/master
tcp        0      0 64.19.12.xx:443          0.0.0.0:*                   LISTEN      9474/lighttpd
netstat also works under Windows XP or 2000 server

Using telnet 
You can also use telnet to find out if port is open or not
Code:

telnet server-ip port-no
telnet localhost 80
telnet 192.168.1.111 25

telnet also works under Windows XP or 2000 server/UNIX oses

Using nmap
Nmap is a free security scanner which is used to evaluate the security of computers, and to discover services or open/close port numbers
Code:

nmap server-ip

Code:

[root]# nmap localhost

Sample output from my computer:
Code:

Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-10-10 03:52 MST
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1656 ports scanned but not shown below are in state: closed)
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
53/tcp  open  domain
80/tcp  open  http
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds
902/tcp open  iss-realsecure-sensor

Nmap finished: 1 IP address (1 host up) scanned in 0.449 seconds

Nmap works under Windows and UNIX oses
Checking to see if a port is open, blocked, dropped, or filtered at the iptables or windows firewall is not simple. But with above three tools you can get list of open port quickly for both Windows and UNIX servers.

Have fun 

Wednesday, May 6, 2009

Howto create Loop Device on REDHAT, CENTOS or FEDORA


Type : System
Operating System : Redhat,Fedora,Centos
Write by : Fabien FAYE

This mini howto explain how to create more loop device on your operating system.

You need to create more loop device in some case like encrypted file system or HVM xen virtualization.

By default there are 7 devices available, named /dev/loop0 through to /dev/loop7 .

* INFORMATION
* HOT CREATION
* STANDARD CREATION
* MODULE LIMITATION
* TIPS & COMMAND

INFORMATION
-----------
You can find the loop device like that :

# ls -al /dev/loop*
brw-r----- 1 root disk 7, 0 Mar 19 09:34 /dev/loop0
brw-r----- 1 root disk 7, 1 Mar 19 09:34 /dev/loop1
brw-r----- 1 root disk 7, 2 Mar 19 09:34 /dev/loop2
brw-r----- 1 root disk 7, 3 Mar 19 09:34 /dev/loop3
brw-r----- 1 root disk 7, 4 Mar 19 09:34 /dev/loop4
brw-r----- 1 root disk 7, 5 Mar 19 09:34 /dev/loop5
brw-r----- 1 root disk 7, 6 Mar 19 09:34 /dev/loop6
brw-r----- 1 root disk 7, 7 Mar 19 09:34 /dev/loop7

The creation of the loop device is very simple but you have 2 options for this creation one is without reboot and the other one is with a reboot.

HOT CREATION
------------
Creation of loop8, loop9, loop10 :

[root]# mknod -m640 /dev/loop8 b 7 8
[root]# mknod -m640 /dev/loop9 b 7 9
[root]# mknod -m640 /dev/loop10 b 7 10

a.) -m640 define the permission of the device
b.) /dev/loop8 define the name of the device
c.) b for the creation of the special block device
d.) 7 8 the number 7 AND 8 define the MAJOR AND the MINOR

Note: If you made a mistake, just delete the note using:
[root]# rm /dev/loop8

Check if the loop is created
----------------------------
[root]# ls -l /dev/loop8
brw-r----- 1 root root 7, 8 Oct 3 14:54 /dev/loop8

[root]# ls -l /dev/loop9
brw-r----- 1 root root 7, 9 Oct 3 14:54 /dev/loop9

[root]# ls -l /dev/loop10
brw-r----- 1 root root 7, 10 Oct 3 14:54 /dev/loop10


Now you have the applied the proper owner on these devices
----------------------------------------------------------
[root]# chown root:disk /dev/loop8
[root]# chown root:disk /dev/loop9
[root]# chown root:disk /dev/loop10

Now you have to change the module limitation and reboot your system.

STANDARD CREATION
-----------------
You have to modify this file /etc/udev/makedev.d/50-udev.nodes

[root] # vi /etc/udev/makedev.d/50-udev.nodes
loop0
loop1
loop2
loop3
loop4
loop5
loop6
loop7
loop8
loop9
loop10
parport0
parport1
parport2
parport3
net/tun
ppp
console
null
zero

Now you have to change the module limitation and reboot your system.

MODULE LIMITATION
-----------------
In the kernel, you have to allow more creation of loop device.

There is an absolute maximum of 256 devices limited in the kernel. The default limit is set to 8.

# modinfo loop
filename: /lib/modules/2.6.18-53.1.14.el5.centos.plusxen/kernel/drivers/block/loop.ko
alias: block-major-7-*
license: GPL
srcversion: 82DB6DB3DABF3B945D6394D
depends:
vermagic: 2.6.18-53.1.14.el5.centos.plusxen SMP mod_unload gcc-4.1
parm: max_loop:Maximum number of loop devices (1-256) (int)
module_sig: 883f35047d15787f0a982eee333b2d8112f51f09f68f09b79223a34983b3aef66820c08cc6e8cd3709f6d7c56171e5a579ee1ca2ca56349c56b983a7c46

Now you have to change this value with the modprobe.conf file.

#vi /etc/modprobe.conf
...
options loop max_loop=64
...

TIPS & COMMAND

The command line losetup is used for set up and control loop device.

# losetup
usage:
losetup loop_device # give info
losetup -d loop_device # delete
losetup -f # find unused
losetup -a # list all used
losetup -r # read-only loop
losetup [-e encryption] [-o offset] [-r] {-f|loop_device} file # setup

Last Updated on Tuesday, 03 February 2009 22:17

Thursday, April 23, 2009

Fairfax Auto Parts


Alexandria
Fairfax Auto Parts
456 S. Pickett Street
Alexandria, VA 22304
703-823-0800

Annandale
Fairfax Auto Parts 7219 Columbia Pike
Annandale, VA 22003
703-354-7600

Burke
Fairfax Auto Parts 5663 Burke Centre Parkway Directions
Burke, VA 22015
703-425-4400
Kamp Washington Fairfax Auto Parts-No. Va. 10912 Lee Hwy. Directions
Fairfax, VA 22030
703-591-6500
Falls Church Fairfax Auto Parts 431 S. Maple Ave. Directions
Falls Church, VA 22046
703-534-1200
Merrifield Fairfax Auto Parts, Inc. 8701 Lee Hwy. Directions
Fairfax, VA 22031
703-560-1560
Newington Fairfax Auto Parts 8196-A Terminal Rd. Directions
Newington, VA 22079
703-339-8300
Vienna Fairfax Auto Parts 121 Church Street NE Directions
Vienna, VA 22180
703-281-5700
Chantilly Fairfax Auto Parts 14154-C Willard Road Directions
Chantilly, VA 20151
703-631-3800
Sterling Fairfax Auto Parts 47060 Harry Byrd Hwy. #100 Directions
Sterling, VA 22170
703-450-6600
Fairfax City Economy Auto Parts 3855 Pickett Road Directions
Fairfax, VA 22031
703-978-4500
Machine Shop Machine Shop 8701 Lee Hwy. Directions
Fairfax, VA 22031
703-560-0813
Manassas - Rt. 234 Economy Auto Parts 8106 Sudley Road Directions
Manassas, VA 20110
703-368-1002
Manassas - Euclid Ave. Champ Auto Parts 9088 Euclid Ave. Directions
Manassas, VA 20110
703-368-7106
Manassas - Rt. 28 Manassas Auto Parts 7809 Centreville Rd. Directions
Manassas, VA 20110
703-368-7191
Herndon Fairfax Auto Parts 23070 Oak Grove Road Directions
Sterling, VA 20166
703-707-0800

Monday, April 20, 2009

TBD


Computing Hourly or Annual Rate


Constant multiplier = 2080

1. How to compute for the Annual Salary given the hourly rate?
Hourly rate = $45.00
Annual = $45.00 x 2080
Annual = $93,600.00

2. How to compute for the Hourly Salary given the Annual Income?
Annual = $93,600.00
Annual = $93,600.00 / 2080
Hourly rate = $45.00

Friday, April 10, 2009

Copy CDROM to ISO image file


1. Using dd
[root] dd if=/dev/cdrom of=/usrISO/tncdcopy.iso

2. Using cat
[root] cat /dev/cdrom > /tmp/trendnet.iso

Note:
1. Ensure that the cd-rom is not mounted
2. These two commands will produce the same result and same size of ISO image

Wednesday, March 25, 2009

WAS 6.1 Application/Portal Developer


WebSphere Application Server 6.1 Portal Developer

DUTIES AND RESPONSIBILITIES

1. Expert level knowledge in WebSphere, WebSphere Portal, LDAP schema,
strong Java, J2EE and Struts are required.

2. Solid experience in Servlets, Web Services, SOAP, XML, Java Beans
and JSP is highly preferred.

3. This role designs, develops and supports application solutions to
meet client requirements delivered through a WebSphere Portal based intranet.

4. The successful candidate will have a strong understanding of Portlet
technologies and have practical hands-on experience developing and
delivering JSR 168 Portlet solutions and J2EE Applications.

5. He/She will design, develop and/or re-engineer highly complex
application components, and integrate software packages, programs
and reusable objects potentially residing on multiple platforms.

6. This role will also manage the WebSphere Portal environment
and mentor junior developer.


ESSENTIAL DUTIES AND RESPONSIBILITIES

1. Design/Develop/Maintain IBM WebSphere Portal solutions using JAVA,
J2EE, XML, EJB, JSP, JDBC, Struts framework, CSS, Javascript using
IBM WebSphere Studio Application Developer (WSAD) IDE.

2. Almost all solutions will be developed using IBM WebSphere and JSR168 Portlets.

3. Strong experience developing Multi-tier application architecture applications.

4. Manage IBM WebSphere and WebSphere Portal environment including, upgrades,
monitoring, security & deployment.

5. Maintain, develop and update the structured Portal Intranet framework
(security implementation, design, layout, graphical content and navigation.

6. Troubleshoots system problems and provides timely resolutions.

7. Maintain, develop and update J2EE Tomcat\MySQL solutions.

8. Supports end-users in the use of deployed portal applications as necessary.

9. Application training and usage documentation required.

10. Identify emerging technologies that can be leveraged in the framework.

11. Mentor others in emerging J2EE and/or IBM Portal and related technologies.

12. Effectively communicate new technology concepts to other team members
and capability of mentoring others.

13. Communicate project status and escalating issues to management as needed

14. Provide extensive input to the architectural design of projects and provide
expertise to project teams and ensure adherence to established architectural
standards and principles

15. Provide detailed system design documentation and deliverables, such as
functional requirements, technical specifications, architecture diagrams,
UML diagrams, sequence diagrams, component and deployment diagrams,
class diagrams, data models, process flows, use cases, and
navigation maps as required

Friday, March 20, 2009

Data Recovery Using FreeNAS

Data Recovery Using FreeNAS
Posted by FrugalNYC at 6:00 AM | Labels: backup, freenas, system admin, tech support

I have written several posts about FreeNAS in the last several weeks. For such a small and compact OS, I have found this to be one of my favorite tools of late. I first wrote about 9 Great Things About FreeNAS and then I wrote 9 Reasons To Use FreeNAS At Work. I then wrote 11 FreeNAS Tips that I picked up after using it and reading about it for several weeks.

Today I would like to talk about how FreeNAS can be used as a data recovery tool. Below is my account of how I used the FreeNAS LiveCD to restore data from a Windows Laptop. I've done this on a HP/Compaq Windows XP Laptop and it worked very well.

Bootup and Install

* I Boot up with the LiveCD.
* Configure the IP address via DHCP
* I go to another machine for the WebGUI to do additional configuration.
* From the WebGUI, I login with the default admin/freenas account.
* Then I setup the Disks - steps are below.



Adding the Disk I want to Recover

* Disks - Management - Add Choose the Disk.
* In My case it was the acd4, the only other one being a RAM Disk or CDROM Drive (acd0)
* I give the description as HD (Hard Disk)
* I leave everything else default, but I do change the Preformatted File system to NTFS
* Save the changes



Mount the Disk

* Disks - Mount Point - Management - Add mount point
* I Choose the Disk I configured above
* I chosse partition 1, since I know the Laptop only has one primary partition.
* Filesystem: I choose NTFS
* Sharename: I call it Windows. You can call it anything you want.
* I leave everything else as the default.
* save the changes.



Get to the Files

* For the easiest access to files I setup the FTP service.
* I go to Services - FTP
* I click enable and then Save and Restart.
* From windows explorer (on the machine I did the WebAdmin work and where I want the data restored to) I go to the folder ftp://freenasIP
* I see the files from my windows install and grab whatever files I need to backup.



Shutdown the Laptop

* When Done copying, I just shutdown the system.
* System - Shutdown


Voila! Now you know how to use FreeNAS as a data recovery tool. There are other dedicated recovery tools, such as SystemRescueCD, but I find FreeNAS very easy to setup and it gives me the results I want faster. Do you use FreeNAS? What features do you like best? Share your thoughts and comments. You can get the current iso of FreeNAS here. Do you have other useful resources for FreeNAS?


ADDITIONAL:
1. http://developer.novell.com/wiki/index.php/HOWTO:_Install_FreeNAS
2. http://pcwizcomputer.com/index.php?option=com_content&task=view&id=71&Itemid=47



For additional links to frugal tips and tricks follow me on Twitter. If you would like to contribute to FrugalNYC or FrugalTech in any way (guest posts, articles, ideas, interesting links, advice, financial assistance, or anything else), feel free to contact me via email. Click here to add this to your RSS reader or Subscribe to FrugalTech by Email.
Monday, March 2, 2009
Reactions:
4 comments:

Brian said...

Cool. It seems so obvious after hearing this, but I probably would have never thought of using my LiveCD for this!
March 2, 2009 9:33 AM
FrugalNYC said...

Hi Brian,

It pays to get a little creative huh? Technically, just about all LiveCD distros of Linux/BSD can be used to do simple data recovery work. I just find FreeNAS to be one of the easiest to use in this regard. :) Thanks for visiting and reading FrugalTech posts.
March 2, 2009 10:46 AM
ravi said...

nice post

to knew more about data recovery you must visit

www.ravi-datarecovery.blogspot.com
March 8, 2009 12:19 AM
FrugalNYC said...

Hi Ravi,

Thanks. I've added you to the blogroll. Good resource for data recovery.
March 10, 2009 9:51 AM

Post a Comment

Thursday, March 19, 2009

Video Hosting - Fedora 5 Server Configuration (Optimized for Dedibox servers)


Video Hosting - Fedora 5 Server Configuration (Optimized for Dedibox servers)
I found it quite hard to get up to date information on how to configure properly a video hosting server on Fedora.

Here is a quick tutorial to tell you every single step I used after setting up my server with fedora core 5 (bordeaux). My hosting provider is Dedibox. It is designed for beginners to follow the step by step; but advanced users will surely know which steps to skip !

This will help you installing:

* Fmpeg (http://ffmpeg.mplayerhq.hu)
* FFmpeg-PHP (http://ffmpeg-php.sourceforge.net)
* Mplayer + Mencoder (mencoder is now built into the mplayer svn release )
(http://www.mplayerhq.hu/design7/dload.html)
* flv2tool (http://inlet-media.de/flvtool2)
* LAME MP3 Encoder (http://lame.sourceforge.net)
* Libogg + Libvorbis (http://www.xiph.org/downloads)



Table of contents

* Requirements

* 1-click Setup

* Setup explained



REQUIREMENTS

First, here are all the packages I needed on my fresh FRESH INSTALL of FC5

yum install subversion
y
yum install ruby
y
yum install gcc
y
yum install ncurses-devel
y
yum install gcc-c++
y
yum install php*dev*
y


You'll need the Livna repository to install mplayer so let's set it up now:

vi /etc/yum.repos.d/livna.repo


Then in Vi, press the key "i" and copy and paste this:

[livna]
name=Livna for Fedora Core $releasever - $basearch - Base
baseurl=http://rpm.livna.org/fedora/$releasever/$basearch
http://livna.cat.pdx.edu/fedora/$releasever/$basearch
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$releasever/$basearch
#mirrorlist=http://rpm.livna.org/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-livna

[livna-testing]
name=Livna for Fedora Core $releasever - $basearch - Testing
baseurl=http://rpm.livna.org/fedora/$releasever/$basearch/RPMS.lvn-testing
http://livna.cat.pdx.edu/fedora/$releasever/$basearch/RPMS.lvn-testing
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch/RPMS.lvn-testing
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$releasever/$basearch/RPMS.lvn-testing
#mirrorlist=http://rpm.livna.org/mirrorlist-testing
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-livna


Save your file by pressing "esc" and:

:wq


Once Vi exited let's import the GPG Key for this repository:

wget rpm.livna.org/RPM-LIVNA-GPG-KEY
rpm --import RPM-LIVNA-GPG-KEY
rm -rf RPM-LIVNA-GPG-KEY



1-click SETUP (just copy and paste)

cd /usr/local/src
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/all-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://switch.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
tar -xjf all-20061022.tar.bz2
tar -xzf flvtool2-1.0.6.tgz
tar -xzf lame-3.97.tar.gz
tar -xjf ffmpeg-php-0.5.1.tbz2
tar -xzf libogg-1.1.3.tar.gz
tar -xzf libvorbis-1.2.0.tar.gz
mkdir /usr/local/lib/codecs/
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
mv /usr/local/src/all-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
cd /usr/local/src/lame-3.97
./configure
make && make install
cd /usr/local/src/libogg-1.1.3
./configure && make && make install
cd /usr/local/src/libvorbis-1.2.0
./configure && make && make install
cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
yum install mplayer
y
cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
cd /usr/local/src/ffmpeg-php-0.5.1/
phpize
./configure
make
make install
echo ‘extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so’ >> /etc/php.ini
service httpd restart

SETUP EXPLAINED

Download needed packages and unpack them:

cd /usr/local/src
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/all-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://switch.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
tar -xjf all-20061022.tar.bz2
tar -xzf flvtool2-1.0.6.tgz
tar -xzf lame-3.97.tar.gz
tar -xjf ffmpeg-php-0.5.1.tbz2
tar -xzf libogg-1.1.3.tar.gz
tar -xzf libvorbis-1.2.0.tar.gz
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg


Install Mplayer codecs

mkdir /usr/local/lib/codecs/
mv /usr/local/src/all-20061022/* /usr/local/lib/codecs/


Secure TMP folder

chmod -R 755 /usr/local/lib/codecs/
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp


Install Lame

cd /usr/local/src/lame-3.97
./configure
make && make install


Install Ogg

cd /usr/local/src/libogg-1.1.3
./configure && make && make install


Install Vorbis

cd /usr/local/src/libvorbis-1.2.0
./configure && make && make install


Install FLVtools

cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install


Install Mplayer

yum install mplayer


Install FFMpeg

cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51


Install FFMpeg-PHP

cd /usr/local/src/ffmpeg-php-0.5.1/
phpize
./configure
make
make install


Add the FFMpeg extension in php.ini and restart httpd.

echo ‘extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so’ >> /etc/php.ini
service httpd restart


Posted by Romain at 01:29
Labels: Tutorials