Saturday, December 28, 2013

How to Install an SSL Certificate on a Shared IP


It was kind of annoying in the midst of cPanel 11?s release when cPanel discontinued the ability to install an SSL certificate on a shared IP. Sure, you can do it as ‘nobody’, but this tends to mess up things when you have open_basedir set up or you’re using suPHP. Sometimes you might not have another IP to use, or you’re using an IP-based monitoring system and don’t want to complicate things. I, personally, prefer to install my shared SSL certificates on the shared IP. But that’s just me…and I’m right about everything.

There is a crafty way to get around this limitation, though it does require root access and it can be a little tedious when it’s something you have to do on a normal basis. Come on cPanel, just let us do this again so we don’t have to keep coming up with workarounds. I assume at this point that you already know how to use WHM to install a certificate, and you’re aware that the hostname for the certificate has to correspond with a user already on the server.

First, hop into WHM ~> Install a SSL Certificate and Setup the Domain and install the SSL normally, BUT, in the user field, put ‘nobody’ and finish the installation.

Now that the certificate is installed, you need to force cPanel to accept its fate to allow a shared SSL on the main IP. Go into /var/cpanel/userdata and run the following commands, noting that $user should be replaced with the username owning the SSL domain, $ssldomain.

mv nobody/$ssldomain_SSL* $user/

replace nobody $user — $user/*

Then edit ./nobody/main and remove the SSL domain from the sub_domains list, and run /scripts/rebuildhttpdconf to rebuild the Apache configuration, then restart Apache for the changes to take effect. Voila.

IF this is a shared SSL certificate (meaning, other users on the server can call it via https://$ssldomain/~$user):

You’ll want the SSL to show as the shared certificate on the server, which you can either select from the dropdown in WHM ~> SSL Hosts, or run:

echo $sslhostname > /var/cpanel/.sharedcrtname

If you use mod_php with open_basedir, and/or you have mod_userdir enabled, you need to exclude the user ‘owning’ the SSL certificate from both, to allow other sites on the server to use its certificate. These can both be set in WHM ~> Security Center

Thursday, April 18, 2013

How to find an anonymous spammer on a Plesk server



If you are seeing spamming in a plesk server from the ID anonymous@hostname, then we need to find out the spammer account
For doing the same use the following steps

1) Let’s take a look in the mail queue and read one of those spam email references:

# /var/qmail/bin/qmail-qread

remote ankush_krishna2137@yahoo.com
6 Jan 2012 09:14:53 GMT #34012584 2987

2) Now we have a message ID, let’s search for the actual message:

# find /var/qmail/queue/ -name 34012584

/var/qmail/queue/info/0/34012584
/var/qmail/queue/remote/0/34012584
/var/qmail/queue/mess/0/34012584

3) Great! Now let’s see what’s in the message to get out that all telling UID:

# cat /var/qmail/queue/mess/0/34012584

Received: (qmail 9936 invoked by uid 10820); 6 Jan 2012 09:14:50 +0000
Date: 6 Jan 2012 09:14:50 +0000
Message-ID: <20120106091450.9934.qmail@server.microliteX.com>
To: annette@recdom.wandoo.co.uk
Subject: Urgent Reply
From: Mrs.Farida Waziri

4) Let’s map the UID to a domain name on the Plesk server:

# cat /etc/passwd | grep 10820

admin947932:x:10820:2523::/var/www/vhosts/thisisthespammer.com:/bin/false

5) Spammer caught :D

Sunday, March 31, 2013

apf installation


1. wget http://www.rfxn.com/downloads/apf-current.tar.gz
2. tar xvzf apf-current.tar.gz
3. cd apf-9.7-1
4. ./install.sh

You must run the installation as root because configuration files are placed in /etc/. Once this is done, you will have an initscript to start APF in /etc/init.d/ and the configuration files located in /etc/apf/. The primary configuration file is /etc/apf/conf.apf.

To configure the firewall, edit /etc/apf/conf.apf. A few important variables to set include:

EGF="1" # enable outbound packet filtering
IFACE_IN="eth0" # inbound interface to filter
IFACE_OUT="eth0" # outbound interface to filter
DEVEL_MODE="1"
The DEVEL_MODE option should only be used during testing. This sets up a cronjob that runs every five minutes to disable the firewall — useful if you muck something up. When the firewall is working, you must set DEVEL_MODE=”0″. Change the IFACE_IN and IFACE_OUT ports to suit your system; on a VPS it might be “venet0″, for instance.

Next, you will need to define which ports are allowed.

There are a lot of other entries in the configuration file and it’s likely worth reading them over and tweaking as necessary. For the most part, the defined defaults are fine. The only exception is if you are using a kernel with the iptables module compiled into the kernel, rather than available as a loadable module, which is often the case for a VPS. In that case you will need to also set SET_MONOKERN=”1″ in the configuration file as well.

then /etc/init.d/apf restart

You are done!

Monday, March 25, 2013

Roundcube database error



If you found database error on roundcube then do the following
mysqldump roundcube > roundcube.sql
mysqladmin drop roundcube
mysqladmin create roundcube
mysql roundcube < /usr/local/cpanel/base/3rdparty/roundcube/SQL/mysql.initial.sql
/etc/init.d/cpanel restart

Friday, March 22, 2013

INSTALLATION OF PLESK ON ANY LINUX SERVER


Plesk is 10.2
Plesk is a leading control panel used in many hosting providers today. Plesk is avaliable for both windows and linux machine. The latest stable version of

Use the One-Click Installer utility to perform a clean installation of the Panel in one step into any Linux OS. The utility automatically determines your operating system and installs the latest version of an appropriate distributive in the typical configuration.

One-Click Installer works only on Linux OSes.

To install the Panel, run one of the following commands on behalf of the superuser:

- If you have the wget utility, run

wget -O – http://autoinstall.plesk.com/one-click-installer | sh

- If you have the curl utility, run

curl http://autoinstall.plesk.com/one-click-installer | sh

- If you have the fetch utility, run

fetch -o – http://autoinstall.plesk.com/one-click-installer | sh

SSL Certificates Installation in Plesk Administrator


Installing your Plesk Server SSL Certificate

Download the Primary, Intermediate, and Root certificate files from your DigiCert account.

Login to the Plesk Control Panel.

Select 'Domains' from the left hand menu.

Click on the domain name that the certificate is for.

Click on the 'Certificates' menu item.

You will have the option to either "Upload certificate files" or "Upload certificate as text." Either way will work fine for your purposes.

To upload the files - just click "Browse" next to the "Certificate" box and navigate to the location of the your_domain_name.crt file you received from DigiCert.

Then, next to "CA certificate", click and browse to the DigiCertCA.crt file. Select it, then select 'Send File'. This will install the certificates against their corresponding Private Key.



To Upload certificates as text - Open your_domain_name.crt and DigiCertCA.crt as text files and copy the entire body of those files into the boxes provided under "Upload certificate as text".

The your_domain_name.crt should be uploaded as the "Certificate", and the DigiCertCA.crt as the "CA Certificate".

Next, click on Server > IP Addresses, then click on the IP Address for your Web site.

Change the certificate for your site to use the new SSL Certificate you have just installed.

Click the 'Server' item from the left hand menu.

Click on the 'Service Management' menu item.

Stop and Start the WEB Server (Apache) to activate the certificate.

NOTE: Restarting Apache will NOT work. You must stop the service, then start it again to complete the installation.

Troubleshooting:

If your web site is publicly accessible, our SSL Certificate Tester tool can help you diagnose common problems.

Open a web browser and visit your site using https. It is best to test with both Internet Explorer as well as Firefox, because Firefox will give you a warning if your intermediate certificate is not installed. You should not receive any browser warnings or errors. If you immediately receive a browser message about the site not being available, then the server may not yet be listening on port 443. If your web request takes a very long time, and then times out, a firewall blocking traffic on TCP port 443 to the web server.

If you receive a "not trusted" warning, view the certificate to see if it is the certificate you expect. Check the Subject, Issuer, and Valid To fields. If the certificate is issued by DigiCert, then the Intermediate certificate is not correctly installed.

Passive FTP Plesk


To enable passive mode for FTP connections on your server:
1 Log in as “root” to the server shell over SSH.
2 Edit your ProFTPD configuration file.
a Issue the command vi /etc/proftpd.conf
b Add the following lines anywhere within the section:
PassivePorts 49152 65534
c Save the file
3 Log in to Parallels Plesk Panel as “admin”, go to Modules > Firewall, and
click Edit Firewall Configuration.
4 Click Add Custom Rule.
5 Specify the following:
a Rule name
b Direction: select Incoming.
c Action: select Allow.
d Ports: in the Add port input box, enter the value 49152-65534. Leave the TCP
option selected, and click Add.

PassivePorts 60000 65535

Changing the Plesk Administrator email address


In the Plesk Control Panel, you can set your email address for the Plesk Administrator. This address is used for all system-related messages. The address is also stored in the following files on your server, which uses the the popular qmail mail server:

/var/qmail/alias/.qmail-mailer-daemon
/var/qmail/alias/.qmail-postmaster
/var/qmail/alias/.qmail-root
Instructions

You can edit these files to change the email address as originally configured in Plesk. You can also have multiple entries. Just make sure that each address is on it's own separate line and prefixed with an "&" symbol:

&mjones@example.com
&jsmith@example.com
&jane@example.com

Add wildcard domain in Plesk


Add the * inside the dns zone file of the domain.

* IN A IP

Edit /var/www/vhosts/domainname.com/conf/vhost.conf and add the line

ServerAlias *.domainname.com

Run the following command.

/usr/local/psa/admin/bin/websrvmng -a -v

Restart apache.

View All Email Account Passwords in Plesk


On my server, I have several domains and I have corresponding email addresses for a few of them, for example: ses5909@mydomain.com, ses5909@anotherdomain.com, etc. I have come to find that in Plesk if I have a domain that has an email user named ses5909 and I need to make the same username on another domain, they are not allowed to share the same domain. So if I give ses5909@mydomain.com the password: supersneakypw, I cannot give that password to ses5909@anotherdomain, or anyone else that has the same username. This is pretty lame if you ask me. The reason for this is that mail is not handled on the domain level, but rather the username level. That is a whole other issue though.

Well today I needed to get into my mail and I wasn’t at the computer that I run my mail client on so I went to my webmail account. I couldn’t remember the password for the life of me. I tried a few that I commonly use, but no luck. So, I needed to try to find my password. I could have reset it, but I’ve resorted to this in the past and I am just tired of doing that. I needed to find a way to retrieve my password.

So, I logged into mysql as the root admin. I looked through the databases and noticed there was a psa db which I am assuming stands for Plesk Server Administration. I immediately looked for email and finally saw mail. I saw all of the usernames and a quick join with the domains table showed me which column belonged to which domain.

SELECT mail.mail_name, domains.name from mail LEFT OUTER JOIN domains ON domains.id = mail.dom_id;

But, now I needed to find the passwords for these. After some more hunting, I found the accounts table where passwords are stored in plain text. If only I didn’t have 200 to look through. So a query was in order:

SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id

Domain Names can be Locked/Unlocked from your Control Panel


Domain Names can be Locked/Unlocked from your Control Panel by following the process mentioned below -

1. Login to your Control Panel and search for the domain name that you wish to Lock/Unlock. Click here to read how

2. Click on the Domain name in the search results to get to the Order details view.

3. Click on the Lock/Unlock Button

4. On the following page - * If you wish to Lock the Service, you would have to select the Check Box for Locking and click on the Update button. * For Unlocking, unselect the Check Box and click on the Update button.

Unix Plesk: Generate webserver config files


I don't believe plesk has a way to build the httpd.conf However it should be fairly easy to make it pick them up, i'd just do something like

for i in `ls /var/www/vhosts`;do echo include /var/www/vhosts/$i/conf/httpd.include;done

and chuck that in your httpd.conf (even though it doesn't store the includes there it doesn't matter). Also check /etc/httpd/conf for a backup of httpd.conf theres normally always one or two in there anyway which might save this hassle.

Fix Quota in Plesk


You can use following commands to fix quota.

quotaoff -av

mv /aquota.user /aquota.user.bak

mv /aquota.group /aquota.group.bak

quotacheck -agiuv

quotaon -av

Changing Plesk control panel default port


http://kb.swsoft.com/en/1392

SYMPTOMS
It is not recommended to change the default Plesk port, however, it can be done using the workaround as below.
RESOLUTION
From version 7.5 Plesk supports two web servers as provider for Plesk Control Panel: IIS and Apache. Depending on the type of web server one of the following ways can solve the problem:

I. Internet Information Services is used as web server for Plesk Control Panel:

When configuring Plesk on port 80 a dedicated IP address must be chosen for Plesk control panel as Plesk Control Panel uses HTTPS protocol for connection and architecture of IIS allows assigning single SSL port per IP address. By default PleskControlPanel Web site in IIS is configured to listen on port 8443 on all IP addresses. The following needs to be done to change the port:

1. Go to IIS management console

2. Find PleskControlPanel web site

3. Click on Properties

4. Click on Advanced button in Web Site tab

5. Edit SSL identity for the Web Site

6. Set IP address that you want to use and change SSL port to 443

7. Apply

II. Apache is used as web server for Plesk Control Panel:

A dedicated IP address needs to be used for Plesk Plesk Control Panel and none of domains hosted on the server. This is required to avoid conflicts with existing websites. Then edit Apache configuration file %plesk_dir%admin\conf\httpd.conf.

1. Find the line

Listen 8443

2. Replace with

Listen IP_address:443

3. Retsart Plesk Control Panel service using tray monitor.
ADDITIONAL INFORMATION
Note: In case of Plesk running on Virtuozzo Virtual Environment , port changing can lead to VZPP-Plesk integration failure.

Awstats updation in Plesk Linux


Awstats updation for one domain:

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=domain.com

and for all accounts in a plesk server:

/usr/local/psa/admin/sbin/statistics --calculate-all

PS: Some times Awstats may break its configuration during plesk version upgradation. In such cases try to manually run stats updation script and look for the error occured and symlink the awstats.pl script as specified in the error log.

telnet Mail commands



The a4msl9ux and ZvVx9G1hcg= are the base24 encoded values of email id and its password. You can get the encoded value from the follwoing url. paste the emaild and click on "Convert the source data. Likewise password.

http://www.motobit.com/util/base64-decoder-encoder.asp



> telnet domain.com 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 something.fake ESMTP Sendmail 8.12.11/8.12.11/SuSE Linux 0.6; Wed, 2 Apr 2003 15:13:01 -0700
EHLO domain.com
250-something.fake Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN
250-DELIVERBY
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
a4msl9ux
334 UGFzc3dvcmQ6
ZvVx9G1hcg==
235 2.0.0 OK Authenticated
MAIL FROM: me@domain.com
250 2.1.0 me@something.fake... Sender ok
RCPT TO: you@yourdomain.com
250 2.1.5 you@nowhere.land... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
This is a test
.
250 2.0.0 h12MD1qV026715 Message accepted for delivery
QUIT
221 2.0.0 something.fake closing connection
Connection closed by foreign host.





===========================



If no AUTH is there tyr below.

The first thing to do is to open a connection from your computer to your mail server.
telnet mail.domain.ext 25
You should receive a reply like:
Trying ???.???.???.???...
Connected to mail.domain.ext.
Escape character is '^]'.
220 mail.domain.ext ESMTP Sendmail ?version-number?; ?date+time+gmtoffset?

You will then need to delcare where you are sending the email from:
HELO local.domain.name - dont worry too much about your local domain name although you really should use your exact fully qualified domain name as seen by the outside world the mail server has no choice but to take your word for it as of RFC822-RFC1123.
This should give you:
250 mail.domain.ext Hello local.domain.name [loc.al.i.p], pleased to meet you

Now give your email address:
(On many mailservers the space after the : is required rather that optional. Thanks to Justing Goldberg)
MAIL FROM: mail@domain.ext
Should yeild:
250 2.1.0 mail@domain.ext... Sender ok
If it doesn't please see possible problems.

Now give the recipients address:
RCPT TO: mail@otherdomain.ext
Should yeild:
250 2.1.0 mail@otherdomain.ext... Recipient ok
If it doesn't please see possible problems.

To start composing the message issue the command DATA

If you want a subject for your email type Subject:-type subject here- then press enter twice (these are needed to conform to RFC 882)

You may now proceed to type the body of your message (e.g. hello mail@otherdomain.ext from mail@domain.ext)

To tell the mail server that you have completed the message enter a single "." on a line on it's own.
The mail server should reply with: 250 2.0.0 ???????? Message accepted for delivery

You can close the connection by issuing the QUIT command.
The mailserver should reply with something like:221 2.0.0 mail.domain.ext closing connection
Connection closed by foreign host.



Here are a list of problems I've encountered and their fixes
501 nouser@nosuchplace.here... Sender domain must exist
The domain that you are sending from must exist

503 Need MAIL before RCPT
A recipient has been specified before a sender.

550 mail@domain.ext... Relaying Denied

formmail installation


To install FormMail:

Download the latest version of FormMail from

http://worldwidemart.com/scripts/formmail.shtml.

Open FormMail in a text editor (such as NotePad).

Make sure the Perl path is set correctly. This information can be found on the CPanel homepage.

A typical path is: #!/usr/bin/perl

Make sure the Sendmail path is correct. This information can be found on the CPanel homepage.

A typical path is: /usr/lib/sendmail

Add you domain to the referrers.

For example: @referers = ('www.mydomain.com', '123.123.123.123')

Alter @recipients, if required. A standard setting is: @recipients = @referers Upload FormMail.pl to your

cgi-bin directory, and change the file permissions to 755. Create the form on your web page, with the following fields

form action=http://www.mydomain.com/cgi-bin/FormMail.pl

method=POST

input type=hidden

name=recipient

value=email@mydomain.com

input type=hidden

name=subject

value=Feedback from website

input type=hidden

name=redirect

value=http://www.mydomain.com/thankyou.htm

Upload the web page and test the form.

stress Test in server.


Before conducting stress test, you need check whether stress is installed in the server. If it was installed, please follow the instruction to install stress in the server.

INSTALL
=======

See the INSTALL file for generic installation instructions. The quick
version is:

Download the source from the below URL::

wget http://weather.ou.edu/~apw/projects/stress/stress-1.0.4.tar.gz

then ,

./configure && make && sudo make install

Once this is installed, you need to add the following crons in different time intervals. With in the time period of one and half hours.

**************
* * * * * stress --cpu 2 --timeout 10800s
* * * * * stress --vm 1 --vm-bytes 16000M --timeout 10800s
* * * * * stress --io 150 --timeout 10800s
* * * * * stress --hdd 20 --timeout 10800s
* * * * * stress --cpu 2 --io 40 --vm 2 --vm-bytes 8000 --hdd 20 --timeout 10800s
**************

Here the above values will change depends up on the server memory, cpu etc...

Install ffmpeg using yum


Installing FFMpeg

yum install ffmpeg ffmpeg-devel

If you get package not found, then you will need to add few lines in the yum repository for dag packages installation. Create a file named dag.repo in /etc/yum.repos.d with the following contents on it

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

then

yum install ffmpeg ffmpeg-devel

If everything is fine, then the installation should proceed smoothly. If not you will get something like warning GPG public key missing .
Common Errors

To fix rpmforge GPG key warning:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

For more information refer to this faq depending on Centos version

Missing Dependency Error:

If you get missing dependency error like shown below, in the middle of ffmpeg installation

Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package ffmpeg
Error: Missing Dependency: libtheora.so.0(libtheora.so.1.0) is needed by package ffmpeg
Error: Missing Dependency: rtld(GNU_HASH) is needed by package ffmpeg
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package gsm
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faad2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faad2
Error: Missing Dependency: libgif.so.4 is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package gsm
Error: Missing Dependency: libpng12.so.0(PNG12_0) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package libmp4v2
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package libmp4v2

then most commonly you have GLIB 2.3 installed instead of GLIB 2.4 version. To check the current GLIB version installed on your server. just use

yum list glib*

and it should list the latest GLIB package version.

The reason i was getting this error was my rpmforge packages was pointed to centos 5 versions instead of centos 4.6.

To fix dependency error:

To fix this error, you might need to check your rpmforge packages compatible to the release of your existing CentOS version.
Check the file /etc/yum.repos.d/rpmforge.repo and it should look like for Centos 4.6(Final). If you have lines like http://apt.sw.be/redhat/el5/en/mirrors-rpmforge you might need to make changes to the rpmforge.repos like shown below

Note: Backup the original rpmforge.repo file before you edit its content.

[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el4/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

To know what linux type and version you are running

cat /etc/redhat-release

Once this is done, do again yum install ffmpeg.

This trick resolved the problem in my linux box running Centos 4.6 and this is the only way i found to install ffmpeg using yum.
To check the FFmpeg working:

Finally, check the ffmpeg whether it is working or not.

> ffmpeg
> ffmpeg -formats
> ffmpeg --help
// This lists path of mpeg, its modules and other path information


ffmpeg -i Input.file Output.file
To check what audi/video formats are supported

ffmpeg -formats > ffmpeg-format.txt

Open the ffmpeg-formats.txt to see the ooutput

D means decode
E means encode
V means video
A means audio
T = Truncated
Install FFMPEG-PHP Extension

FFmpeg-php is a very good extension and wrapper for PHP which can pull useful information about video through API interface. Inorder to install it you will need to download the source file and then compile and install extension in your server. You can download the source tarball : http://ffmpeg-php.sourceforge.net/

wget /path/to/this/file/ffmpeg-php-0.5.2.1.tbz2

tar -xjf ffmpeg-0.5.2.1.tbz2

phpize

./configure
make
make install
Common Errors

1. If you get command not found error for phpize, then you will need to do yum install php-devel

2. If you get error like "ffmpeg headers not found" while configuring the source.

configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

then it means you have not installed ffmpeg-devel packages.

To Fix: Just install ffmpeg-devel using

yum install ffmpeg-devel

3. If you get an error like shared libraries not found problem and the program halts in the middle, then you must specify the ffmpeg installed path explicitly to the ./configure.

configure: error: ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

To Fix:

1. First find out the ffmpeg path with ffmpeg --help command. The prefix default path should be like /usr/local/cpffmpeg
2. Configure the FFmpeg-php with --with-ffmpeg option

./configure --with-ffmpeg=/usr/local/cpffmpeg

That should resolve the problem!
Editing PHP.INI

Once you have done that without any problems then you will see the php extension file /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so and you will need mention that extension in php.ini file

nano /usr/local/lib/php.ini

Put the below two lines at the end of the php.ini file

[ffmpeg]
extension=ffmpeg.so

Then restart the server service httpd restart

To check whether ffmpeg enabled with php, point your browser to test.php file. It should show the confirmation of installed ffmpeg php extension

// #test.php



If any case the ffmpeg does not show in the phpinfo() test make sure that php.ini path to ffmpeg.so is correct. Still the problem occurs, the reason could be you might be using older versions of ffmpeg-php which is buggy. Just download the latest version of ffmpeg-php source then compile it.
Installing Mplayer + Mencoder

Just issue the following yum commands to install the rest of the packages.

yum install mplayer mencoder
Installing FlvTool2

Flvtool2 is a flash video file manipulation tool. It can calculate metadata and can cut and edit cue points for flv files.

If you are on Centos 5 try yum install flvtool2 with dag repository and if you get package not found you will need to manually download and compile the flvtool2. You can download latest version of flvtool2 here: http://rubyforge.org/projects/flvtool2/

wget

ruby setup.rb config
ruby setup.rb setup
sudo ruby setup.rb install

If you get command not found error, it probably means that you dont have ruby installed.

yum install ruby

Thats it! Once ffmpeg works fine with php extension, download a sample video, convert to .flv format in the command line and plug it to flowplayer to see it work on your web browser. Try also to download the video file offline and see whether the converted flv file works well with both audio and video. ./configure

Thursday, March 21, 2013

Commands to Check SSL cert’s validity and other details


1. Get complete available details of an SSL certificate

openssl x509 -text -in ssl.cert

2. Who issued the certificate?

openssl x509 -noout -in ssl.cert -issuer

3. To whom the certificate was issued?

openssl x509 -noout -in ssl.cert -subject

4. To check the expiry date of SSL certificate

openssl x509 -noout -in ssl.cert -dates

5. To get SSL cert’s hash value

openssl x509 -noout -in ssl.cert -hash

6. To get SSL cert’s MD5 fingerprint

openssl x509 -noout -in ssl.cert -fingerprint

To check CSR: openssl req -noout -text -in new.csr
To check key: openssl rsa -noout -text -in new.key