Finding the Perfect Website Domain

When creating a new website, you really want to do your homework and find the website domain name and if it is available.

One website that helps ease this task is http://www.namepro.ca, it allows you to enter multiple potential web domains at once and see if they are available.

I use a spreadsheat to help automate creating combinations of domain names that may be available. This technique produces some strange names but often it comes up with somegood names you would not have thought of.

No Comments

Backing up and Restoring Your MySQL Databases

Interesting article on devshed.com on how to backup and restore your databases.

http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/1/

No Comments

Getting going with WordPress

  • Copy gz to directory of website
  • extract to create wordpress folder
  • use the 5 minute start guide (see below)
  • create new database in mysql SITE_WordPress
  • run install using the website address.  http://www.sitedomain.com/wordpress/wp-admin/install.php
  • copy themes and plugins from other base system : eflowone
  • change settings:permalink
  • activate plugins: exec_php,

Here’s the quick version of the instructions, for those that are already comfortable with performing such installations. More detailed instructions follow.

  1. Download and unzip the WordPress package, if you haven’t already.
  2. Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
  3. Rename the wp-config-sample.php file to wp-config.php.
  4. Open wp-config.php in your favorite text editor and fill in your database details as explained in Editing wp-config.php to generate and use your secret key password.
  5. Place the WordPress files in the desired location on your web server:
    • If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (but excluding the directory itself) into the root directory of your web server.
    • If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), rename the directory wordpress to the name you’d like the subdirectory to have and move or upload it to your web server. For example if you want the WordPress installation in a subdirectory called “blog”, you should rename the directory called “wordpress” to “blog” and upload it to the root directory of your web server.Hint: If your FTP transfer is too slow read how to avoid FTPing at : Step 1: Download and Extract.
  6. Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.
    • If you installed WordPress in the root directory, you should visit: http://example.com/wp-admin/install.php
    • If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

That’s it! WordPress should now be installed.

No Comments

Creating a VMServer NAS using FreeNAS

So I wanted to create a NAS on a Virtual machine to store webfiles.  This would allow a good separation of program files and content files.  With the help of my friends Ron and Phil, we were able to get it up and running from scratch in about 90 minutes.  Aren’t friends and VMs nice. 

The idea is to create a NAS on a virtual server as a virtual machine, mount the NAS on the webserver and then setup apache to be able to access it.

Setting up FreeNAS VM

For the NAS virtual machine, we were able to download the FreeNAS VM Image from http://www.freenas.org/index.php?option=com_versions&Itemid=51

  1. Download the VM Image from http://www.freenas.org/index.php?option=com_versions&Itemid=51
  2. unzip in your virtual machines directory on your Virtual Server host.
  3. Then add a new virtual machine from inventory to have the vm show up in your inventory.
  4. At this point, you can increase the size of the hard drive. 
  5. You may also wish change some settings to the network card depending on how you wish to manage your NAS IP.  In my case, I manually set the virtual network card MAC address and set my hardware firewall to assign a static IP address to that MAC address.
  6. You may also wish to set the auto-start/auto stop settings of the VM Server to include the new NAS so it will auto power up and down. 
  7. After starting up the NAS, you can connect to it and reset the webGUI password, assign interfaces and set LAN IP if necessary.
  8. Connect to the webGUI using a web browser.  You will be prompted for the username and password. 
  9. Once connected you will want to create a folder to store your data and enable the services to allow sharing of files.
  10. create a new folder by going to the advanced menu and selecting file manager.
  11. create a new folder  like /usr/local/nas/
  12. Go to the Service menu and select NFS and enable it and save it.
  13. Then go to the Share tab and add a folder to share, browse and select the new folder you created
  14. For authorized network, you can either set it to be your entire network by adding something like 192.168.0.0 and a mask of 24 or you can specify the specific web service IP and set the mask to 32.   

Mounting your NAS on your web server

Next we would like to mount the NAS on the web server so that it has access to it.

  1. log into you webserver.
  2. go to the /mnt directory by using  the cd /mnt command
  3. add a new directory by using the mkdir command, mkdir nasfiles
  4. next mount the new directory to the nas directory using, the command, sudo mount -t 192.168.0.35:/usr/local/nas /mnt/nasfiles
  5. edit the fstab file in the /etc folder to have the nas mounted on power up with the following line 192.168.0.35:/usr/local/nas /mnt/nasfiles ext3 defaults 0 0

Give Apache access to the newly mounted NAS

  1. edit the httpd.conf file and add in an alias to the mnt directory and add a directory declaration
  2. Alias /nasfiles “/mnt/nasfiles”
  3. <Directory “/mnt/nasfiles”>Options None AllowOverride None Order allow,deny Allow from all </Directory>
  4. then restart the httpd service

Test it.

Add a file to the mounted nas directory, see if you can access the file from your website.

3 Comments

Creating a favicon

To jazz up your site and make it look professional, you should add a favicon icon.  This is the icon that shows up in the url of your browser.  An easy way to create a favicon is to use one of the free favicon site out there.  One such on is.

http://www.favicon.cc/?action=edit_image&file_id=35382

No Comments

Creating your first Blackberry Application using the Java API

I am interested in creating applications for blackberrys.  Here are some links to site that my be useful to get the ball rolling.

Information on the CHAPI DEMO that can be used to associate a file extension with a program.

http://java.sun.com/javase/downloads/index.jsp#jdkJavaFX

http://java.sun.com/javame/downloads/sdk30.jsp

http://developers.sun.com/mobility/wtk/demos/wtk-chapi.html

http://bb.emacf1.com/bbfilescout.html

http://supportforums.blackberry.com/rim/board/message?message.uid=207134

 

Creating a blackberry laucher

http://crackberry.com/how-create-blackberry-launcher

http://www.brighthub.com/mobile/blackberry-platform/articles/34913.aspx

http://www.blackberryinsight.com/2008/07/08/howto-setup-an-apache-webserver-to-deliver-blackberry-ota-applications/

For the IPhone, do this.

http://www.tuaw.com/2007/08/28/iphone-coding-url-launcher/

No Comments

Integrating WordPress into an existing site

After playing around with WordPress a bit. I wanted to see if I could intergrate wordpress into one of my existing websites. After searching around a bit, I found the following blog entry.
http://moshublog.com/2005/07/05/integrate/
I will update this entry soon to let you know how it turned out.

No Comments

Securing your WordPress installation

Found this nice article on securing your wordpress installation,  http://codex.wordpress.org/Hardening_WordPress.

The chmod command it used to change the permissions of files and directories.  It should be noted that directories and files need different types of permisssions.  For instance, directories need the x (execute) permision to be able to list files and yence for your wordpress to run. 

For the most secure installation, make your permissions very restrictive and open them up as necessary.

In general, you should be the owner of your files and directories and be able to read, write and execute, rwx or 7.  The group assigned to the files and folders should be the group that is running the apache web service.  For the default CentOS installation, this group is apache.  For the group chmod setting, directories should be set to r-x (5)and files should be r– (4).  To get all the functionality out of wordpress, you may have to loosen that a bit, but it is a good starting point.  See the article mentioned above for more information.

Ok, so here comes the tricky part.  How do you get directories to be one type of permission and files to be another type of permission.  The -R option for chmod will apply the setting to all files and folders recursively and this is not exactly what we want.  So we need to do this in multiple steps.

  1. cd (change directory) to the directory where wordpress is installed.
  2. Use the chmod command with the -R recursive flag to change all directories and files to a value of 750.  This will give the owner, you, full permissions, it will give the group, apache, write and execute permissions (note, we will remove the execute on files in the next step), and is give no permissions to anyone else.
    • chmod -R 750 wordpress
  3. Next we use a little gem of code I found on the net to change all the files ONLY to a new chmod value.
    • find . -type f -exec chmod 640{} \;
    • This finds all the files starting in the current directory and executes the chmod 640 on them.
  4. There you have it.  Now we have 750 protection on directories and 640 on files.  The next step would be to set permissions on individual files on a case by  case basis to support additional wordpress functionality.  Note, you should always turn the permissions back when you are done using the functionality.

No Comments

Changing file permissions

Found this little nugget.  It will change all the files from the current directory and any files in its subdirectories to the chmod value while leaving the chmod value of the directories in tact.  Pretty sweet…

find . -type f -exec chmod 644 {} \;

No Comments

chomod -linux change file permissions

Changes the permission of a file.

Syntax

chmod [OPTION]… MODE[,MODE]… FILE…
chmod [OPTION]… OCTAL-MODE FILE…
chmod [OPTION]… –reference=RFILE FILE…

-c, –changes like verbose but report only when a change is made
–no-preserve-root do not treat `/’ specially (the default)
–preserve-root fail to operate recursively on `/’
-f, –silent, –quiet suppress most error messages
-v, verbose output a diagnostic for every file processed
–reference=RFILE use RFILE’s mode instead of MODE values
-R, –recursive change files and directories recursively
–help display this help and exit
–version output version information and exit

Permissions
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.

Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:

400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody

Examples

The above numeric permissions can be added to set a certain permission, for example, a common HTML file on a Unix server to be only viewed over the Internet would be:

chmod 644 file.htm

This gives the file read/write by the owner and only read by everyone else (-rw-r–r–).

Files such as scripts that need to be executed need more permissions. Below is another example of a common permission given to scripts.

chmod 755 file.cgi

This would be the following 400+040+004+200+020+100+010+001 = 775 where you are giving all the rights but the capability for anyone to edit your file.cgi (-rwxr-xr-x).

Finally, another common CHMOD permission is 666, as shown below, which is read and write by everyone.

chmod 666 file.txt

No Comments