Featured Posts

Earn Residual Income Residual income is a passive or recurring income that continues to generate after the initial effort. Most people earn "linear" income or receive a "one-shot" compensation. Royalties, rent from properties,...

Read more

Job Opportunity Looking for work? Want to earn a few extra bucks? Start full-time or part-time. Be your own boss. Have the flexibility and the freedom. It's a business opportunity where you supply consumers with services...

Read more

Get Paid While Using Your Phone Imagine getting paid each time you or someone else makes a phone call, watches tv, surfs the internet, or uses gas and electricity. Imagine getting paid every month, every year, or over an entire lifetime....

Read more

  • Prev
  • Next

Run Multiple Applications in CodeIgniter

Category : General, Linux, PHP, Programming

You’ve installed CodeIgniter and you’ve written a couple of applications. Now, you want to run two of your applications under one install of CodeIgniter. The following article discusses how to run several applications within a single install of CodeIgniter. The approach is accomplished using Apache’s Virtual Host.

Install Apache Virtual Host

1. To add a virtual host, edit /etc/apache2/sites-available/default. We will use “vhostname” as the virtual hostname in this example. Edit the default file and add the following:

<Virtualhost *:80>
ServerName vhostname
DocumentRoot /var/www2
</VirtualHost>

2. Run the a2ensite script which enables your virtualhost within the apache2 configuration. It creates symlinks within /etc/apache2/sites-enabled.

# sudo a2ensite vhostname

3. Restart Apache

# sudo /etc/init.d/apache2 restart

4. Check your virtualhost if it’s working by pointing your browser to http://vhostname.

CodeIgniter Setup

One way of setting up CodeIgniter to support multiple applications, is to have separate folders for each application. You can set up your CodeIgniter directories like the following:

system/
   application/
       app1/
          config/
       app2/
          config/

1. Under the “app1/config” directory, edit the config.php file. Point your application to be hosted at vhostname by changing the following line:

$config['base_url'] = “http://vhostname/”;

2. Copy the “index.php” file under the main CodeIgniter directory to the http://vhostname web root directory.

3. The “.htaccess” file recommended by CodeIgniter also needs to placed to the web root of http://vhostname.

4. Open your browser and check if your application is working by placing http://vhostname in the address bar of the browser.

5. Repeat steps 1-4 to add additional virtual hosts.That’s it.

If you have questions or suggestions, please leave a comment.

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

Code Igniter Is Great

3

Category : General, PHP, Programming

I finally had a chance to evaluate Code Igniter for a couple of hours. The sample videos, tutorials, and online manual are simple and straightforward. I tried a couple of examples and they worked great. I can’t wait to get started with a couple of projects. I might try a simple todo list just to get my feet wet.

What impressed me most are the number of helpers and classes that are available for use. It’s quite comprehensive from email, form, array, file, date, smiley, just to name a few helpers. Why recreate the wheel if it’s already available.

It takes a little bit of used to the MVC framework because it’s completely a different paradigm. Separating code from design does make a lot of sense. I do see the potential for rapid development due to the simplicity of functions like queries to the database, for example.

One thing I want to figure out how to get a template system working.

After two hours with Code Igniter, I’m fairly impressed.

I can’t wait to dive deeper into Code Igniter.

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

Code Igniter vs CakePHP

1

Category : General, Internet, PHP, Programming

In the next several weeks, I will be evaluating two PHP frameworks: Code Igniter and CakePHP. I have been coding in PHP for several years now, and that’s without the help of a framework. I would still recommend this approach to anyone who is learning PHP for the very first time.

Knowing the basics of a programming language is essential first and foremost. A programmer needs to know the ins and outs of a language before jumping on a framework.

One of the reasons I want to use a PHP framework is for the rapid development of applications. So, in the next two weeks I will be evaluating both frameworks. I’ll come back a few weeks later with my observations.

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

PHP 5.3.1 Released

Category : General, PHP

If you are a fan of PHP, things are getting better. PHP 5.3.1 was just released containing over 100 bug fixes. From Marc Plotz article:

The most significant and security-conscious addition in PHP 5.3.1 is the inclusion of a max_file_uploads INI directive, making it possible to limit file uploads per request to 20 files by default. This is extremely important in circumventing denial of service (DoS) attacks.

If you have not heard of denial of service attacks, the basic principle is that a website gets pounded with hundreds or even thousands of requests at the same time, thus rendering the server essentially useless because all of its sources are being consumed in serving the attack. Thus, a user having unlimited upload possibilities certainly could bring a production server to its knees by constantly uploading something like one hundred files repeatedly from various machines.

You could in effect have 1000 or more files being uploaded at the same time, and a slow or shared server will not handle that well at all. Even a dedicated server would struggle considerably. So, what max_file_uploads does is make sure that no more than 20 files can be uploaded at a time on that server.

Other bug fixes include missing sanity checks around EXIF (exchangeable image file format) processing, while Rasmus Lerdorf himself fixed a safe_mode bypass in tempnam(). An open_basedir bypass in posix_mkfifo() was also repaired, along with the failing safe_mode_include_dir. You can see the CHANGELOG for more details.

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon

A New Webhost

Category : General, Internet, WordPress

If you noticed some strange behavior in this site the last day or so, I was in the middle of moving from one hosting company to another. What a difference a day makes. Notice how fast and responsive the site is now! It’s like night and day. It’s all good. The move was a lot more involved that I thought it would be. Learned something new about the move.

Moving WordPress was a bit tricky since I had way too many plugins. I had 32 at one point. So, I cut the plugins by 1/3. I’m running 12. Still too many plugins in my opinion. I’ll cut it down some more. I’m trying to limit the number of plugins since they tend to slow the site down.

I installed WordPress using Subversion. I need to update my shell script to get ready for WordPress 2.9 which is just around the corner. Anyway, the site is back faster than ever. Thanks to my new host.

Post to Twitter Post to Plurk Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to MySpace Post to Ping.fm Post to Reddit Post to StumbleUpon