Debian 7.0 Wheezy PHP 5.3 Install (Downgrade from PHP5.4)

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Debian Wheezy comes with PHP 5.4. If this is too new for your application and it doesn’t work properly, here is a short description on downgrading to PHP 5.3.

Add the following to /etc/apt/sources.lst

deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

Create

/etc/apt/preferences.d/preferences

And add the packages you need downgraded such as in my case

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

#Package: libapache2-mod-php5

#Pin: release a=oldstable
#Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Then run the commands

aptitude update
aptitude reinstall <necessary packages>

 

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

 

  • First, add these two lines to /etc/apt/sources.list. In short, it adds Debian Squeeze repositories as an additional source of packages:

deb http://ftp.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free

 

  • Then, add these to pin your old PHP 5.3 packages, to /etc/apt/preferences.d/preferences. If you don’t have this file, create an empty one.

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: php-apc
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

 

  •  This will list your PHP packages

PHP=$(dpkg -l|grep php|grep 5.4.4|awk '{print $2}')

 

  • Finally, reinstall:

# apt-get update

# apt-get install –reinstall $PHP
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libicu44 libjpeg62 libmagickcore3 libmagickwand3 libmysqlclient16 libt1-5 php5-suhosin
Suggested packages:
libmagickcore3-extra php5-dev
The following NEW packages will be installed:
libicu44 libjpeg62 libmagickcore3 libmagickwand3 libmysqlclient16 libt1-5 php5-suhosin
The following packages will be DOWNGRADED:
libapache2-mod-php5 php-apc php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imagick php5-imap php5-intl php5-mcrypt php5-mysql
0 upgraded, 7 newly installed, 4 reinstalled, 14 downgraded, 0 to remove and 0 not upgraded.
Need to get 30.5 MB of archives.
After this operation, 30.9 MB of additional disk space will be used.
Do you want to continue [Y/n]?

Read More

Add/Modify custom Accept-Languages to Chrome/Firefox/IE for pseudolocalization testing

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

In Firefox

Use about:config

enter image description here

enter image description here

(There is a typo in qps-ploc in the screenshots, but you surely get the idea)

In Chrome

Edit the file C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\Preferences, and add:

<code>{ ...

   "intl": {
      "accept_languages": "qps-ploc,en-us,en"
   },

   ...
}
</code>

For example:

enter image description here

enter image description here

Read More

Mp4 Mod h264 streaming setup for Lighttpd

Download Lighttpd 1.4.19 & 1.4.20 (and other 1.4.x)

Follow the instructions for ‘Download Lighttpd 1.4.18’ first. Then continue with the following steps.

Download a source distribution (e.g. ​version 1.4.28), build and install your version of Lighttpd (from the official site) as you would do normally.

The following instructions are basically a copy of the Lighttpd’s page of ​How to add a Lighttpd plugin.

Prerequisites

Make sure you have automake 1.9 (required by autogen.sh), autoconf 2.59 and libtool 1.5.x.

Files

Copy the module’s files from the 1.4.18 source distribution to your source distribution (lighttpd-1.4.x).

cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.x/src/
cp lighttpd-1.4.18/src/mod_streaming_export.h lighttpd-1.4.x/src/
... see below for a list of all the files to copy ...
cp lighttpd-1.4.18/src/output_mp4.* lighttpd-1.4.x/src/

Makefile

First you add the following to the lighttpd-1.4.x/src/Makefile.am file:

lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c \
                                mod_streaming_export.h \
                                moov.c moov.h \
                                mp4_io.c mp4_io.h \
                                mp4_reader.c mp4_reader.h \
                                mp4_writer.c mp4_writer.h \
                                mp4_process.c mp4_process.h \
                                output_bucket.c output_bucket.h \
                                output_mp4.c output_mp4.h
mod_h264_streaming_la_CFLAGS = $(AM_CFLAGS) -DBUILDING_H264_STREAMING
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd)

(for example, just after ‘mod_flv_streaming’)

Then, you type this:

./autogen.sh
./configure --enable-maintainer-mode --prefix=${HOME}/test/lighttpd-1.4.x

in the lighttpd-1.4.x directory. The ‘enable-maintainer-mode will trigger a rebuild of all makefiles by autoconf …

Note: You may not see the plugin listed in the ‘Plugins: enabled:’ list. No reason to worry.

After this you are all set and should type ‘make && make install’ – the exe+libs will be installed in ${HOME}/test/lighttpd-1.4.x.

Download Lighttpd 1.5.0

cd ~
wget http://h264.code-shop.com/download/lighttpd-1.5.0_mod_h264_streaming-2.2.9.tar.gz
tar -zxvf lighttpd-1.5.0_mod_h264_streaming-2.2.9.tar.gz

Build

Run configure in the Lighttpd directory.

cd ~/lighttpd-1.4.18
./configure

Make and install Lighttpd.

make
sudo make install

Configuration

Edit the configuration file (in /etc/lighttpd/lighttpd.conf) so that file requests ending in “.mp4” are handled by the mod_h264_streaming module.

server.modules = ( 
  ...,
  "mod_h264_streaming",
  ...
)
h264-streaming.extensions = ( ".mp4" )

Make sure that DAEMON in your startup script (/etc/init.d/lighttpd) is set to point to the locally build version.

DAEMON=/usr/local/sbin/lighttpd

Start Lighttpd

sudo /etc/init.d/lighttpd start

Advanced configuration

Two other modules that you may consider using are mod_expire and mod_secdownload. The order of the modules in your configuration is important. If you are using mod_secdownload to prevent hotlinking of your mp4 files make sure that it is included before the mod_h264_streaming in the module list.

server.modules = (
  "mod_expire",
  "mod_secdownload",
  "mod_h264_streaming",
  etc...
}

Bandwidth shaping is enabled by setting the h264-streaming.buffer-seconds option.

# Files ending in .mp4 and .f4v are served by the module
h264-streaming.extensions = ( ".mp4", ".f4v" )
# The number of seconds after which the bandwidth is shaped (defaults to 0=disable)
h264-streaming.buffer-seconds = 10

Also add an Expires/Cache?-Control header for your video files, so video files can be cached by webbrowsers or a CDN provider.

# Add Expires/Cache-Control header
$HTTP["url"] =~ "\.(mp4|f4v)$" {
  expire.url = ( "" =&gt; "access 8 hours" )
}

Use mod_secdownload to prevent hotlinking.

secdownload.secret          = "secret"
secdownload.document-root   = "/var/www/video/"
secdownload.uri-prefix      = "/video/"
secdownload.timeout         = 3600
cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mod_streaming_export.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/moov.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/moov.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_io.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_io.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_reader.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_reader.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_writer.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_writer.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_process.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/mp4_process.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/output_bucket.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/output_bucket.h lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/output_mp4.c lighttpd-1.4.x/src/ cp lighttpd-1.4.18/src/output_mp4.h lighttpd-1.4.x/src/ install pkg-config before running autogen.sh apt-get install pkg-config apt-get install autogen apt-get install automake apt-get install libltdl-dev apt-get install make
apt-get install libbz2-dev
apt-get install libpcre3-dev

apt-get install zlib1g-dev
./autogen.sh
./configure --enable-maintainer-mode --prefix=/usr/local/lighttpd-1.4.32
make
make install
apt-get install php4-cgi
<strong> install pkg-config before running autogen.sh

aptitude install sendmail
</strong>

 
				

Read More

“/etc/mtab is not writable”, “read-only file system”, Linux, Virtual Machine Problem Solution

if you are experiencing problems with Linux or Linux Virtual Machines as:

"read-only file system"

on file operations or

 "/etc/mtab is not writable"

on return of typing command “mount”.

Errors are like this:

mount: warning: /etc/mtab is not writable (e.g. read-only filesystem).      

            It's possible that information reported by mount(8) is not      

            up to date. For actual information about system mount points      

            check the /proc/mounts file.

Solution:
Run fsck to fix the device disk, then reboot afterwards

fsck  /dev/sda1

Read More