Friday, April 16, 2010

Rename a VPN Connection in Windows 7

Question: How do I rename a VPN connection in Windows 7? There’s no option to rename it in the Network and Sharing Center or on the taskbar.

This question is asked a lot because there is currently no intuitive way to quickly change the name of a VPN connection in Windows 7.

Answer: Click (left mouse button) the connection icon on the task tray then click "Open Network and Sharing Center" then click "Change adapter settings" on the left of that window then right click the connection and click "Rename".

To recap:
"Network and Sharing Center" -> "Change adapter settings" -> "Rename"

And that is how you rename your VPN connection in Windows 7.

Tuesday, April 6, 2010

jQuery Plug-in I Wrote For Doing Web Form Textfield Placeholders

Here is a very useful jQuery plug-in I wrote to show placeholders in input text fields and input password fields. Great for a Facebook style log-in form.

Download it here: Password Compatible jQuery Placeholder

Apache HTTPD Virtual Hosting Setup in Step By Step Instructions

A buddy of mine is new to server administration and one of the first things I am going to show him since he is a web developer is how to setup a virtual host in Apache on CentOS 5 allowing you to run multiple web sites on a single IP address. Read the steps carefully and take your time if this is your first time doing this, it is a simple task that can easily go wrong if you rush it.


  1. Add your server IP to GoDaddy or other domain registrar's DNS settings.
    For GoDaddy this is located by navigating to Domain Manager -> Your domain -> Total DNS Control then editing the "A (Host)" record.
  2. Login to your server using putty.exe or some other SSH client.


  3. Type:
    ls /var/www
    Then look to see if there is currently a folder named "vhosts", if there isn't then type:
    mkdir /var/www/vhosts
    Next add a domain by typing:
    mkdir /var/www/vhosts/www.yournewdomain.com
    Then to add a logging directory type:
    mkdir /var/www/vhosts/www.yournewdomain.com/logs
    Then to add an error log file type:
    touch /var/www/vhosts/www.yournewdomain.com/logs/error-log
    Then to give apache permissions to the logging folder type:
    chown -R apache:apache /var/www/vhosts/www.yournewdomain.com/logs


  4. Type:
    vi /etc/httpd/conf/httpd.conf
    Then hold the "Page Down" key to scroll to the very bottom of the file and then type:
    $a
    Then press the enter key and enter the following lines:

    <VirtualHost *:80>
    ServerAdmin support@yournewdomain.com
    DocumentRoot /var/www/vhosts/www.yournewdomain.com
    ServerName www.yournewdomain.com
    ServerAlias yournewdomain.com
    ErrorLog /var/www/vhosts/www.yournewdomain.com/logs/error-log
    </VirtualHost>
    <Directory /var/www/vhosts/www.yournewdomain.com>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </Directory>

    And then navigate around using the arrow keys and replace all instances of "yournewdomain" with your new domain name. When "-- INSERT --" shows in the lower left corner of the screen you are in edit mode, to enter edit mode you hit "i" or "a", to exit edit mode hit ESC. When in edit mode keystrokes are inserted into the document, when not in edit mode keystrokes are interpreted as commands. Always be aware if you are in edit mode or not.

    You are done editing so hit ESC to exit edit mode.
    When everything looks right then type the following to save and exit (when out of INSERT mode)
    :wq
    If you made a mistake then type:
    :e!
    This series of keystrokes will undo all changes in vi so you can start your edits over.


  5. Restart apache by typing:
    /sbin/service httpd restart


  6. To setup vsftpd (FTP server) to go to the vhosts folder on login then create a ftp user by typing the following command:

    adduser wwwftp -d /var/www/vhosts -M -p PASSWORD_FOR_USER_HERE -s /sbin/nologin

    And you are done. Use FTP with the user "wwwftp" and the password you set to upload your website files to /var/www/vhosts/www.yournewdomain.com/