Installing Apache, MySQL, PHP in Gentoo Server


Hits: 9122  

All commands are performed as root to install Apache, MySQL, PHP and phpMyAdmin in Gentoo Linux Server.

1. Update your System

# emerge –sync

2. Install Apache Webserver

# emerge apache

The web server ROOT is in /var/www/localhost/htdocs/

# /etc/init.d/apache2 start

Then go to http://server-ip/
it works on gentoo

Add apache2 to the startup script
# rc-update -v add apache2 default

3. Install MySQL Database

# emerge mysql

Install MySQL database
# /usr/bin/mysql_install_db

Start MySQL Server
# /etc/init.d/mysql start

Change MySQL User Password
# /usr/bin/mysqladmin -u root -h localhost password ‘new-password’

Test MySQL Server
# /etc/init.d/mysql restart

Add MySQL to the startup script
# rc-update -v add mysql default

4. Install the PHP with modules

# USE=”cli cgi apache2 xml mysql mysqli” emerge ‘dev-lang/php’

Before you can use PHP with Apache… Edit /etc/conf.d/apache2 and add “-D PHP5″ to APACHE2_OPTS

It looks like
APACHE2_OPTS=”-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5″

You can find php.ini in /etc/php/apache2-php5.4

then restart apache server
# /etc/init.d/apache2 restart

Then go to http://server-ip/info.php (Create phpinfo() file)

phpinfo on gentoo
phpinfo on Gentoo

phpinfo php

phpinfo mysql

5. Install phpMyAdmin

# emerge -av phpmyadmin

Then go to http://server-ip/phpmyadmin/

phpMyAdmin on gentoo
phpMyAdmin on Gentoo

SQL OR NOSQL?


Hits: 3809  

If you are searching for SQL or noSQL solutions, it is very difficult to decide among top SQL / noSQL Databases.

MySQL is the best for multi-document transactions, complex security, complex join, extreme compression.

NoSQL is good for linear scalability, high performance, schema flexibility.

But both depend on data need to manage 😉

Scalability

MySQL support master and slave approach for scaling (vertical scalability).
NoSQL supports horizontal scalability.

Vertical scalability is the ability to increase the capacity of existing hardware or software by adding resources – for example, adding processing power to a server to make it faster. On the other hand, horizontal scalability is the ability to connect multiple entities so that they work as a single logical unit.

Flexibility

SQL is the best for query flexibility, SQL supports both simple and complex queries.
MongoDB supports SQL query and indexes.

Down Time

NoSQL perform well for database size and server performance.

Transactions

SQL is king of transactions.
MongoDB and Redis support limited transactions.

Hosting

Every database solution need deployment, backups, monitoring, and performance tuning.

NoSQL are modern web-scale databases having qualities of non-relational, distributed, open-source and horizontally scalable database.

Get Remote Host Client IP Behind Load Balancers (ELB)


Hits: 20193  

I was working on “Private AWS Cloudfront Distribution” for AWS Elastic Load Balancer (ELB), allowing our application servers private access to our AWS cloudfront.

But PHP Server Environment Variable $_SERVER[“REMOTE_ADDR”] is displaying suspicious results, it really tedious to get remote host client IP behind ELB 🙁

Now we have 2 options…

1. mod_rpaf and Amazon ELB
http://tech.superhappykittymeow.com/?p=281
http://giantdorks.org/alain/easily-get-the-correct-client-ip-with-mod_rpaf/

if ($_SERVER[“HTTP_X_FORWARDED_FOR”]) {
$realclientip = $_SERVER[“HTTP_X_FORWARDED_FOR”];
} else {
$realclientip = $_SERVER[“REMOTE_ADDR”];
}

2. %{X-Forwarded-For}i from Apache Log (Time Consuming)
http://blog.kenweiner.com/2009/09/amazon-elb-capturing-client-ip-address.html
https://forums.aws.amazon.com/message.jspa?messageID=216977

You Apache log format would then look something like this:
LogFormat “\”%{X-Forwarded-For}i\” %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-agent}i\”” combined-elb
CustomLog log/acces_log combined-elb

Apache Module mod_remoteip

PHP: $_SERVER[“HTTP_X_FORWARDED_FOR”]
PHP: $_SERVER[“HTTP_X_CLUSTER_CLIENT_IP”]

$_SERVER[‘REMOTE_ADDR’]; Apache Enviromental Variable is not working on your server 🙂
http://php.net/manual/en/function.getenv.php
http://www.zytrax.com/tech/web/env_var.htm

Install Wowza Examples


Hits: 8328  

Wowza Media Server 3 have 2 option to install
* Developer Edition (up to 10 Connections) license and all free premium AddOns.
* Paid

Wowza Server Install
# yum install sun-java6-jre sun-java6-plugin
# wget http://www.wowza.com/downloads/WowzaMediaServer-3-0-4/WowzaMediaServer-3.0.4.rpm.bin
# chmod +x WowzaMediaServer-3.0.4.rpm.bin
# ./WowzaMediaServer-3.0.4.rpm.bin

Wowza Location
/usr/local/WowzaMediaServer-3.0.4

Enter License
# cd /usr/local/WowzaMediaServer-3.0.4/bin
# chmod +x startup.sh
# ./startup.sh

Install SimpleVideoStreaming

# cd /usr/local/WowzaMediaServer-3.0.4/examples/SimpleVideoStreaming
# chmod +x install.sh
# ./install.sh

Install TextChat
# cd /usr/local/WowzaMediaServer-3.0.4/examples/TextChat
# chmod +x install.sh
# ./install.sh

Install the Wowza Examples
# cd /usr/local/WowzaMediaServer-3.0.4/examples
# chmod +x installall.sh
# ./installall.sh

Wowza Server Commands
# service WowzaMediaServer status
# service WowzaMediaServer start
# service WowzaMediaServer restart
# service WowzaMediaServer stop

Upload Client to Web Server

Uninstall Wowza
# rpm –e WowzaMediaServer-3.0.4

Make Own CDN


Hits: 10383  

Well… I am working on alternatives to make OWN CDN…

I have few options to create such CDN

* Google App Engine
http://24ways.org/2008/using-google-app-engine-as-your-own-cdn
http://www.digitalistic.com/2008/06/09/10-easy-steps-to-use-google-app-engine-as-your-own-cdn/

* Amazon EC2

* Wowza
http://www.wowza.com/forums/content.php?81-How-to-achieve-the-lowest-latency-from-capture-to-playback

* GeoIP, NGinx, Bind, Varnish
http://blog.unixy.net/2010/07/how-to-build-your-own-cdn-using-bind-geoip-nginx-and-varnish/
http://www.caraytech.com/geodns/
https://www.varnish-cache.org/

* ONApp
http://onapp.com/cdn/pricing/
http://cdn.onapp.com/files/datasheets/onapp_cdn_datasheet.pdf

Some Open Source to create CDN
http://www.fromdev.com/2011/06/create-cdn-content-delivery-network.html
http://labtel.ing.uniroma1.it/opencdn/
http://www.coralcdn.org/
http://cacheboy.net/
http://code.google.com/p/phloem/

Other Resources
http://serverfault.com/questions/244158/how-to-create-my-own-cdn-or-private-cloud
http://nixcraft.com/web-servers/17014-creating-own-cdn-using-nginx-possible.html

Limitations
* Performance that you get from a professional / Commercial CDN
* Smart DNS
* Edge points
* Caching server – squid or nginx

Webisode


Hits: 3524  

The webisode is simply a web episode, this is a new medium called web television that stream live broadcast, dramas, serial storyline, media events online over the Internet

The webisode is web episode especially viewed at a Web site for TV show have been telecast.

Technologies Used

* HTTP
* RSS/JSON
* RTSP/RTMP
* SMIL
* WTVML
* ASX
* MMS

Streaming Audio/Video formats

* Adobe Flash – MP3, FLV, MP4
* Microsoft Media – Silverlight, ASF, ASX, WAX, WMA, WMV
* RealNetworks – RM, RAM, RA, SMIL
* Apple QuickTime Audio/Video streams
* Shoutcast/Icecast – MP3, AAC, OGG
* MoveNetworks MoveMediaPlayer

CDN Used

* Amazon S3 CloudFront
* Google
* YouTube
* MaxCDN
* Rackspace CDN
* EdgeCast
* Flickr
* Akamai
* StreamGuys

Servers Used

* Wowza
* Adobe
* Red5
* SHOUTCast
* Windows Media Server

Clients Used

* Adobe – Flash Media Live Encoder
* Windows Media Encoder
* VLC Player
* SMPlayer
* SAMCast

Streaming Tools

* MPlayer
* FFmpeg
* RTMPDump
* VLC
* Flash Media Players
* HTML5

CMS Used

* Kaltura
* VidZapper

A webcast is a media streaming technology to distribute single media content source to many simultaneous listeners/viewers. The webcast might be distributed live or on demand. Webcasting is “broadcasting” over the Internet.

http://www.svnlabs.com/services/media-streaming

 

There are only two ways to live your life

Tolerate things the way they are…… Or take responsibility to change them.

VLC is not supposed to be run as root. Sorry


Hits: 9497  

Today I need to install VLC Media player on CentOS 5.x to capture remote live event from VLC client as HTTP stream.

So, I have installed that using # yum install vlc

But VLC can not be run as root privileged user 🙁

# vlc
VLC is not supposed to be run as root. Sorry.
If you need to use real-time priorities and/or privileged TCP ports
you can use vlc-wrapper (make sure it is Set-UID root first and
cannot be run by non-trusted users first).

To run VLC from command line we need to edit VLC file located below
# vi /usr/bin/vlc

To edit “/usr/bin/vlc” search for geteuid and replace it with getppid using vi editor’s command

:%s/geteuid/getppid/ (here geteuid is search term and getppid is replace one)

If we still face issues with stream capture, we can use mplayer 😉

# mplayer http://stream_link -dumpstream -dumpfile outFileName

The trouble with doing something right the first time is that nobody appreciates how difficult it was.

 

PHP Cloud


Hits: 5040  

Introduction to the Zend Developer Cloud

PHPCloud help to Develop, Deploy and Manage PHP Applications in to Any Cloud (Amazon, Rackspace, RightScale, IBM SmartCloud) using Zend Application Fabric.

Demo: http://svnlabs.my.phpcloud.com
Contact: http://blog.svnlabs.com/contact/

Rackspace Cloud Servers vs Amazon EC2


Hits: 3606  
Rackspace Cloud Servers Amazon EC2
Support Cloud Servers™ is backed by the legendary Fanatical Support you can only get from Rackspace. To receive 24x7x365 support for Amazon EC2, you pay the greater of $400 per month or 10% (scaling down) of your EC2 costs.
Third Party Software Support The Cloud Servers™ with a managed service level option gives our customers support for a number of third party software. Amazon does not provide support for third party software even if customers purchase the highest level of support.
Admin Level Troubleshooting If requested by a Cloud Servers™ with a managed service level customer, Rackspace Cloud support techs will log in to a customer’s Cloud Server to help fix a problem. Amazon Support will not log in to a customer’s EC2 server to help its customers fix a problem.
Persistence One of the most significant differences between Cloud Servers™ and EC2 is the persistence of each virtual server. Cloud Servers™ has access to local, RAID10 disk storage, much like you’d expect in a physical server. Amazon EC2 instances are transient or ephemeral—if there is a host failure that causes your instance to terminate, all local data on that instance will be lost. Data persistence (not server persistence) can be added with Amazon EBS; however, EBS adds additional cost and complexity.
Server Sizes We provide a wide variety of Cloud Server sizes, starting at 256 MB and going up to 30 GB. Cloud Servers™ can be resized to scale without any reinstallation. Amazon EC2 Standard Instances start at 1.7 GB, so if your workload requires fewer resources, you are stuck paying for much more than you need. Amazon recently introduced Micro Instances (starting at 613 MB) for customers needing CPU burst capabilities.
Hybrid Hosting Depending on your needs, you can get the best of both worlds with a combination of cloud and dedicated servers with our RackConnect™ solution. Amazon only offers part of the answer, with only cloud solutions. Amazon VPC is a beta service offering to connect a company’s infrastructure to Amazon’s cloud; however, Amazon does not offer hosting on dedicated/managed servers.
CPU Scheduling Cloud Servers™ has guaranteed minimum CPU power (relative to the size of the Cloud Server), with free bursting when extra capacity is available on the host. Amazon EC2 instances have a capped CPU. If additional CPU capacity is required, you need to launch another instance. Amazon recently introduced Micro Instances which can be added (at an additional cost) for extra CPU resources.
Compute Power A recent study conducted by an independent third party demonstrated that US-based Cloud Servers™ is, on average, more than two times more powerful than comparable Amazon EC2 servers. While the pricing of EC2 instances appears to be lower, if it takes more than twice the time to complete a task, the total price to complete a task increases proportionally.
Disk I/O A recent study conducted by an independent third party demonstrated that on average US-based Cloud Servers™ have a higher disk throughput than comparable Amazon EC2 servers. Amazon has a block storage solution that can show better performance than their built-in ephemeral storage under the right conditions; however, this solution results in additional costs, as both the amount of data stored and transferred are billed for.
IP Addresses Each Cloud Server comes with the simplicity of a dedicated and persistent public IP address (no NAT) with a second, private IP address for free. There is also low latency bandwidth between your Cloud Servers™. Additional public IPs are available upon request and shared IPs can be provided for high availability. With EC2, the IP configuration is more complex. Each instance gets a non-persistent private IP address NATed to a public IP address. When instances terminate and new ones are launched, a new private IP address is assigned which means you need to plan for changing private IPs.
Open Philosophy In 2010, Rackspace became a founding member of OpenStack, an open-source cloud platform designed to foster the emergence of technology standards and cloud interoperability. Amazon has not embraced an open-source approach for cloud interoperability.

 

Source: http://www.rackspace.com/cloud/cloud_hosting_products/servers/compare/

Rackspace Cloud Load Balancers vs. Amazon Elastic Load Balancing


Hits: 5537  
Rackspace Cloud Load Balancers Amazon Elastic Load Balancing
Support Chat/phone/ticket support available 24x7x365 To receive 24x7x365 support for Amazon EC2, you pay the greater of $400 per month.
Dedicated Public IP Address A dedicated IP address allows for use as a root record for a zone. When you create an ELB instance, you get a public DNS name; however, it’s not very user friendly and you will want to create a CNAME record in DNS to redirect to your URL.
Access Control List (ACL) Rackspace cloud load balancer has an ACL-based security model. Access control list feature is not available.
Connection Logging Logs are sorted, aggregated, and delivered hourly to Cloud Files™, which is perfect for users who need to perform tuning, inspection, or analysis. Connection logging feature is not available.
Connection Throttling Rackspace cloud load balancers have a connection throttling feature which imposes limits on the number of connections per IP address. Connection throttling feature is not available.
Selectable Algorithms Customize the behavior of your cloud load balancer with selectable algorithms, including: random, round robin, weighted round robin, least connections, and weighted least connections. ELB utilizes only a non-configurable round robin load balancing algorithm.
Advanced HTTP Health Monitoring Rackspace Cloud Load Balancers can use synthetic transaction monitoring to inspect an HTTP response code and body content to ensure the application or site is healthy. While HTTP and TCP-based health monitors are available, ELB does not permit users to define an acceptable status code or body regular expression to match against.
Shared IPs Shared IPs facilitates easier management and better IP utilization of load balancer configuration. ELB does not permit users to share a single IP address across multiple load balancers, but does allow for a single load balancer to support multiple port configurations.
Internal Virtual IPs Internal virtual IPs feature allows you to load balance internal services, without being penalized with external bandwidth charges. All ELBs are configured as public virtual IPs. An internal virtual IP option is not available.
SSL Termination Does not support SSL termination at the load balancer. Supports SSL termination at the load balancer.

 

Source: http://www.rackspace.com/cloud/cloud_hosting_products/loadbalancers/compare/