I decided to start a mini website concerning my travel to Japan at the end of this month. I am calling it Japanigans, as I will surely be causing a bit of trouble while I’m overseas. I’m traveling with two other close friends of mine, both of which have never been to see the other side of the world before. The new site is only a day old, and I’m presently writing down all the information I have gathered so far. Check it out and let me know what you think.
There’s a new website in town that deals all there is to do in the city of Montreal: Montrealing. It’s not just a directory or reviews about restaurants, and it’s not a nightlife photo website either. Montrealing is all about what’s fresh and what’s not in the city. For example, what is currently the best shisha lounge in Montreal? You can go ahead and vote or simply see the current results. Montrealers are able to decide what’s good or bad and voice their own opinions instead of a review website telling them how it’s supposed to be. It’s democracy all the way.
There is, of course, a directory of clubs, lounges, bars and restaurants… but it doesn’t stop there. At Montrealing, you’ll be able to find a list of famous Montrealers, talk show and radio hosts, bartenders, bouncers, local DJs and news about local University and CEGEP teams. Oh yes, you’ll find plenty of editorials on the Habs too. For the tourists, there’s a compiled list of landmarks, hot spots and other fun facts about Montreal.
REVISED: Mencoder 1.0rc2 has too many problems with WMV files. Modified the guide to work with Mencoder 1.0rc1 instead. Also, added the necessary steps to install GCC 4.2 to compile FFMPEG correctly.
For the past week, I have been trying to figure out how to get Clip-Share 4.0.9 working on a FreeBSD system. Uploading script files are easy, but when it comes to compiling and installing binaries, everything can go wrong and then some. I wanted to install everything from ports to keep the system clean and organized, and to make future upgrades easy. I also wanted all the options in CS 4.0.9 to work with minimal customization of the scripts, so if I ever update to the next version, I don’t have to worry about overwriting files that are heavily customized. This guide is for the user who can’t get Clip-Share to work on a FreeBSD 6.3 system. Basic understanding of the operating system is required to follow this guide.
My installation guide works with the following installs:
FreeBSD 6.3, Apache 1.3.41, PHP 5.2.6, MySQL 5.0.51a
Mencoder 1.0rc1 (compiled from sources)
You will need root access to perform certain functions in this guide. If all the binaries are already installed for you, you might want to skip down a section or two and probably go to the convert.php file modification part.
While I have tried to simplify and remove unnecessary steps from this guide, I might become a bit redundant during the ports install. I have listed all the ports that you will need to install. Sometimes, installing one port (e.g. Mplayer) might install everything else for you automatically. Chances are that x264, xvid, speex, libtheora, faac, win32codecs, lame, etc. will all be compiled & installed for you as they can be dependencies (if selected during the configure step).
Just so you know, there is no need for ffmpeg-PHP or phpVideoToolkit. Lastly, you can follow this guide whether or not you have DirectAdmin or any other control panel installed.
First, let’s do some basic httpd.conf configuration. Open up your domain’s httpd.conf file (or global httpd.conf) and find the VirtualHost section for the domain you’re installing Clip-Share on. You will have to insert the following lines between the <VirtualHost></VirtualHost> directives of your domain.
DirectAdmin users: login as Admin, go to “Custom HTTPD Configurations”. Select the domain you are installing Clip-Share on. Add the following lines in the top box (“Httpd.conf Customization for yourdomain.com”).
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_execution_time 1000
php_value session.gc_maxlifetime 14000
php_value output_buffering on
php_admin_value suhosin.executor.func.whitelist exec //if using suhosin
Ports, Binaries & Sources
Using your favourite SSH client (putty, SecureCRT, direct console access, etc.) login to your server as root.
While this is not required, I put this setting in make.conf to prevent any of the ports from installing X11 garbage. There is no place for X11 or GUIs on a web server, so this little setting enforces the rule.
In /etc/make.conf, put:
Now, we get to install the necessary applications and libraries via Ports. Before you actually start installing everything, make sure your ports system is up to date. If you don’t know how to do this, check the FreeBSD handbook, section CVS.
Installing ports is very straight-forward and fun.
- Install GD Library 2: cd /usr/ports/graphics/gd && make install clean
- Install Flvtool++: cd /usr/ports/multimedia/flvtool++ && make install clean
- Install lame: cd /usr/ports/audio/lame && make install clean
- Install libogg: cd /usr/ports/audio/libogg && make install clean
- Install libvorbis: cd /usr/ports/audio/libvorbis && make install clean
- Install GCC 4.2 (for proper FFMPEG compilation): cd /usr/ports/lang/gcc42/ && make install clean
Note: this may take a few minutes, as compiling GCC 4.2 takes a while.
- Install FFMPEG: cd /usr/ports/multimedia/ffmpeg && make USE_GCC=4.2 install clean
Note the USE_GCC=4.2 argument to enforce compiling of FFMPEG with a more recent version of GCC.
- Install Mplayer: cd /usr/ports/multimedia/mplayer && make install clean
(make sure to disable X11 stuff and select the codecs you want to support)
- Install Mencoder: The one from ports is version 1.0rc1 (which doesn’t work well). We’re going to compile this binary from source instead.As root, do the following at the console:
# wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
# tar zxvf MPlayer-1.0rc1.tar.bz2
# cd MPlayer-1.0rc1
Next, we’re going to copy the compiled binary to /usr/local/bin/. Just type:
# cp mencoder /usr/local/bin/
We need to do a small tweak to get things running smoothly. Flvtool++ installs itself under /usr/local/bin/, while Clip-Share looks for this utility under /usr/bin/ (beats me as to why). Rather than have duplicate binaries, we’ll create a symlink. Just do the following (as root):
# cd /usr/bin/
# ln –s flvtool2 /usr/local/bin/flvtool++
Upload Clip-Share Files
Now it’s time to go ahead and upload the Clip-Share files. Don’t forget to transfer the files in Binary mode (as recommended by the developers).
Make sure the .htaccess file is uploaded correctly and that it’s present in the root directory of your website. On an OSX workstation, you won’t see this file as Leopard hides files that begin with a dot. Your best bet is to upload the entire Clip-Share archive file and extract it via console, this way making sure all the files are uploaded correctly and are present.
Make sure the CGI-BIN directory is chmod’ed 755, and both the user AND the group belong to YOUR username on the server. Double-check this now; it’ll take you 30 seconds and save you a lot of trouble. If it is different, do the following via the console:
# chown username:username cgi-bin
Where username is your login name on the server.
Follow the rest of the CS installation file. Change the absolute path in ubr_upload.pl accordingly and verify that it is correct. On a FreeBSD system with DirectAdmin installed, it’ll look like: /home/username/domains/yourdomain.com/public_html/
Changes to Script Files
Modify the convert.php script as follows:
*** Removed previous $encodecommand changes as we’re working with Mencoder 1.0rc1 now. ***
exec($config[‘metainject’]. ‘ –Uv ‘ .$config[‘FLVDO_DIR’]. ‘/’ .$vid. ‘x.flv ‘ .$config[‘FLVDO_DIR’]. ‘/’ .$vid. ‘.flv’);
exec($config[‘metainject’]. ‘ ‘ .$config[‘FLVDO_DIR’]. ‘/’ .$vid. ‘x.flv ‘ .$config[‘FLVDO_DIR’]. ‘/’ .$vid. ‘.flv’);
Testing, Verification and Miscellaneous Configuration
Login to your website’s administration panel (/siteadmin) and go to “System Checks”. Make sure there are no binaries missing, other than THEORA and FAAC support.
Go to “Media Settings” and enable “Video resize” if you want.
Upload several test videos of varying sizes and formats. Make sure the audio is in sync and that Clip-Share is resizing them accordingly. Take a look at your server load and see if everything is looking ok. The videos you upload must be error-free and encoded properly. I’ve noticed that videos that are poorly encoded or corrupt won’t convert correctly.
Pay attention to Apache error log file in case something goes wrong. If you get “No file given” errors, it’s related to Mencoder from my experience. Make sure you have 1.0rc1 or 1.0rc2 installed and nothing else.
I hope this guide helps someone out. Feedback is much appreciated. Enjoy!
I would like to take a small opportunity and introduce everyone to a new website that deals with educational toys: Jouets Choo Choo. They launched this week after several months of website development, and the site looks great. For anyone looking to buy educational toys (such as Playmobil, Schleich, Meccano, Ravensburger puzzles, Plan Toys, Thomas the Tank Engine, etc) then look no further, as their prices are the best. These guys have been in business for over ten (10) years now, with two stores active. One of the stores is located in Pointe-Claire (next to Fairview) and the other one, which was recently opened, is located at Quartier Dix-30 (right across Indigo mall). I actually know the owners personally (family friends) and they’re very friendly people with tons of experience in the toys department. If you ever wanted to get a gift for a newborn, young child or games that are non-violent for the kids, and you’re out of town, in a different province or simply too far away to visit the stores, Jouets Choo Choo’s online retail outlet is the answer to getting educational toys and games delivered to you. Check them out today!
I decided to stop being lazy and redesign my website. The other theme, called Connections, started to show its age (plus, I didn’t design it). I wanted something a bit more personal and unique, so I decided to theme my site after BMW’s M5 automobile and logo colours. I find the new theme really motivates me to work, and that’s a good thing. 🙂