Wednesday, March 30, 2011

How to run ASP.NET on Apache Server?

Just go through this article

http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx

Tuesday, March 29, 2011

How to create a custom cron job on GoDaddy Server

Cron is a standard Linux feature that allows you to schedule tasks, called "Cron Jobs," to run unattended at a specified frequency. You can quickly set up a Custom Cron Job schedule using the Cron Manager Feature in the Hosting Control Center. A Custom Cron Job differs from a Basic Cron Job in that you have more control over the frequency at which the task runs.

To Create a Cron Job

  1. Log in to your Account Manager.
  2. From the Products section, click Web Hosting.
  3. Next to the hosting account you want to use, click Launch.
  4. In the Content section of the Hosting Control Center, click the Cron Manager icon. This action displays the Cron Manager screen.
  5. Click edit next to the Email Address heading in the left navigation area.
  6. Enter the email address to which you would like to have all information sent regarding this Cron Job.
  7. Click Save.
  8. Click Create Cron Job.
  9. Click Custom.
  10. Enter the required information in each field to schedule the task to run repeatedly at specific intervals.
    Cron Job Title
    Enter a name for this Cron Job. Ideally, this title relates to this task, so you can identify it easily.
    Command
    The Command field is the script or executable that runs at a specified frequency. Click Browse to locate a file in your hosting account. The full file name of your selection is placed into this editable field. Click the question mark icon for additional assistance in selecting a command. NOTE: Our sample scripts use the variable $HOME. We recommend using $HOME to represent the actual server path, although either can be used.
    Minutes
    Enter the time that you want the Cron Job to run. For example, you can set your job to run at 15 minutes after each hour by selecting "x:15." You can run tasks twice per hour by selecting the Run twice an hour setting. This setting automatically sets tasks to run 30 minutes apart.
    Hours
    Enter the time of day that you want the Cron Job to run. For example, you can set your job to run each day at 1:00 p.m. by selecting "13:xx."
    Day of the Month
    Enter the day of the month that you want the Cron Job to run. For example, you can set your job to run on the 15th of each month by selecting "15."
    Month
    Enter the month that you want the Cron Job to run. For example, you can set your job to run each February by selecting "February."
    Day of the Week
    Enter the day of the week that you want the Cron Job to run. For example, you can set your job to run each Thursday by selecting "Thursday."

  11. Click Save.

Your Cron Job is saved, enabled, and runs at the next scheduled interval.

Sunday, March 13, 2011

How To Attack An Internet Explorer (Win) Display Bug

It's a well-known fact that the Internet Explorer (Win) browser has a wide variety of display bugs. While it may seem satisfying to badmouth that browser, IE is by far the most popular browser on the web, so whining about its drawbacks is not going to help very much.
Sadly, many authors who desire to make the switch to table-less design begin with high hopes, only to have those hopes dashed by what is sometimes known as the "Explorer bug suite." Some of those bugs are not "bugs" at all, but rather misapplications of the W3C standards. Although a full understanding of how IE "gets it wrong" is a full-time job, it is possible to get by with a modicum of bug fixing tools, which is what this article is going to teach you. All ready? Let's go!

Clearing The Decks

Before any bug fixing can be done, it is necessary to make sure that the problem really is a bug, and not just improper coding, or a failure to understand how CSS positioning works. As a primer on bug hunting you should read Debugging CSS, the Easy Way, which details this preliminary phase in detail. It also describes how to create a "minimal test case," which can greatly simplify the issues to be addressed. But just making such a test case is time consuming, and job pressures often prevent people from going this route. Still, it is a highly recommended method to use, and one we put into practice regularly.
Even when a test case is made, it is not always easy to just look and say, "Aha! That's it!" While it's true that having extensive bug knowledge does help in locating a problem, many busy coders don't have time to devote to studying bugs at length.
However, once a minimal test case is prepared, there are usually very few page elements remaining to consider, and it becomes possible to fire "magic bullets" at various elements in an attempt to solve the problem. Be aware that these fixes are useless against any proper browser behaviors that are mistaken for bugs by CSS newcomers. It's up to you to have a firm grasp on the basics of CSS coding. You can read up on the subject in the following articles:
The fixes to be discussed are also worthless against any of the deliberate CSS specification violations that occur in IE/Win. To learn about the major non-bug IE misapplications, read:
One special problem worth pointing out is the way in which floats are "cleared," as described in the Float: The Theory article mentioned above. IE will usually (wrongly) allow a container to enclose a nested float, even when no clearing element is present. This creates the impression that the non-IE browsers are incorrect, when the real offender is IE/Win. Don't be fooled in this way as have so many others.
You may also find useful information on many smaller display problems in the Common Coding Problems series of articles here at CMX. (A search for the terms Common Coding Problems will get you a list of all the articles in the series.) Assuming these issues are well understood or are not relevant to your current problem, let's proceed to look at the bug fixing methods themselves, shall we?

{ position: relative }

This "magic bullet" was the first one discovered, back in December of 2001 by a certain author who's initials happen to be "BJ" (ahem). Anyway, the issue then was a technique developed by Eric Meyer here, which appears to "punch" a box out of the corner of another box.
Eric's method involves floating a box into the upper left corner of a text containing element, and then using 1px negative top and left margins, which has the effect of "pulling" the float up and to the left by 1px. This allows the float to cover, or obscure, the 1px borders on the larger containing box in that area. Then, the float gets a bottom and right border that seems to be a part of the overall border. Neat.
The problem with this method was that Explorer for Windows was failing to obscure the corner of the large element's border properly, ruining the intended "boxpunch" effect. It seems that IE/Win has a problem when an element is negatively margined out of the parent box surrounding it. The portion still within the parent "container" is visible, but any part that goes beyond the inner edge of the container's border just vanishes!
It turns out that applying a simple {position: relative;} to the negatively margined inner box causes the missing portions to magically reappear. Why? Well, moving right along... Seriously, no one knows why this happens, except perhaps the Microsoft engineers, and they aren't talking. Suffice to say it does work.
Soon, this fix was found to work on other IE bugs as well, specifically the Peekaboo Bug in IE6 (look on the third page of the article). We'll get back to the Peekaboo bug in just a little while.
Another primary use for this fix is occasioned when a floated image is in a container and either the container or the floated image has been made "relative." In that case, the floated image can and will "hide" behind any background that may be placed on the outer container element. Removing the relative positioning or making both elements relative will bring the floated image "up front," allowing it to be seen.

Problems With the "Relative" fix

Usually this fix will not adversely affect other browsers, but as just explained, in the case of floated images it may be necessary to perform a "double" fix, using {position: relative;} twice. Figuring out where to apply this fix is not usually a problem. Just stick it on one element at a time and check to see if the bug is zapped. In the event that this fix does cause trouble in other browsers, you may hide this fix from them, feeding it only to IE/Win via the methods outlined in the next section.

Dimensional Bug Fixing

A very large percentage of IE/Win bugs are triggered by the lack of any stated dimensions on elements that contain nested floats. In other words, if you have a box without either a width or a height, and nest one or more floats inside, some very weird display bugs may declare themselves. Such bugs can happen without floats, but are far rarer than the float variety.
The Peekaboo Bug falls into this "dimensional bug" class, as does the Escaping Floats Bug. There's the Peekaboo Bug again! So this hard-shelled devil is vulnerable to both the "relative" fix and the dimensional fix! Very interesting. Such is the nature of IE bug "science."
This sort of dimension-related IE buggy-ness has been known for several years, but simply knowing wasn't good enough. Very often, it is undesirable to apply a dimension to the buggy box. Using a height is usually unacceptable, since having the height be the default value of auto allows the content in the box to determine that box's displayed vertical height. If you give the box a defined height, it may not match the height of the content, particularly if text is involved and the user changes the browser text sizing.
A width may sometimes be used, but often the page design calls for the problem box to be "liquid," so as to automatically widen or narrow in response to changes in window size. Yes, a percentage width can also do this, but what if the box is a center column and needs to have pixel sized side columns next to it? It is impossible to have a percentage width on a box and pixel sized margins on that same box, because no one can predict how rigid pixels may compare against fluid percentages.
Clearly, using width as a bug-fixing dimension is less than satisfactory. There seemed no clean way to accomplish the task at hand, and yet by a strange quirk of fate, the Explorer browser itself came to the rescue.

The Expanding Box Trick

CSS gurus have known for a long time that when IE/Win sees that a box has a stated dimension that is not large enough to enclose the content of that box, the browser will wrongly enlarge the width of the box to accommodate unbreakable lines, such as long URLs. IE/Win will also extend the height of a box so that its content does not overflow the bottom border of the box. Browsers that more closely follow the W3C specifications let the extra content protrude beyond the height or width controlled box.

The Holly Hack

Since IE/Win will misbehave in this manner, when a dimension is needed to fix a float bug, a very small height, such as {height: 1%}, can be applied to the float container, and IE/Win will just make the box taller anyway. Thus, a small height does not change the appearance of the box, but IE seems to think the box is now "dimensioned," and so our magic bullet strikes home. Scratch one bug.

Details of The Hack

Since other browsers don't have the bug, and more importantly, don't wrongly expand height-defined boxes, this bug-fixing height should be hidden from browsers other than IE/Win. It is not necessary to hide this fix from earlier versions of IE/Win, since even though they don't have the Peekaboo Bug, they do have other dimension based bugs, and they all do the expansion trick. However, IE5/Mac doesn't incorrectly expand boxes, so letting that browser see the small height is sure to damage its display. Thus, the height needs to be hidden from it, as well as the other, non-IE browsers.
The following code is an instance of the Holly hack. Primarily, the Holly hack consists of a set of hiding methods wrapped around that 1% height, which is the key to the hack. Remember, the whole idea is to let IE/Win and only IE/Win see that height and apply it to the buggy box.
/* Hides from IE5-mac \*/
* html .buggybox {height: 1%;}
/* End hide from IE5-mac */
Code Block 1
Two Hacks in One: The first line of code is a CSS comment with an "escape" (colored red) just before the comment closing tag. The presence of that escape character causes IE5/Mac to ignore the closing tag of the comment, and think that the comment is still active. Thus, it ignores everything until it sees what it thinks is a correct CSS comment closing tag. The last line of the hack is a normal CSS comment, and its closing tag is what lets IE5/Mac begin parsing code again. We generally refer to these two lines (the top and bottom in the above code box) as the "Mac-hack," but it is also referred to as a "comment-backslash hack."
The second, or middle line, has, in this example, three items separated by descendant combinators, which are the spaces you can see, and then the height property within curly brackets. First item is a universal selector or star, *, which selects any element, followed by html (both also in red), followed by the element suspected to have the bug. The above code selects an element with the class attribute of buggybox that is a descendant of an html element, (which will always be true), when html itself is a descendant of any element (*), and applies a {height: 1%} to that element, in this case, .buggybox.
It so happens that all IE browsers, both Win and Mac, recognize an invisible and mysterious wrapper element around <html>. The use of the universal selector preceding html, also known as the Tan Hack (or Star HTML Selector Bug), works in IE browsers and nowhere else. Thus, the reason for using the "Mac-hack" is to prevent IE5/Mac from seeing this height just as other browsers are, because it does not wrongly enlarge the box like IE/Win, but it does read the Tan hack.
Note that the element to be given the height need not be classed. Any valid selector may be inserted instead of .buggybox, and even entire strings using descendant combinators may be used there. What really matters is that * html must always precede whatever target element is to be fixed, and that the * and html have a space between them, followed by another space, and then the target element.
There are other methods that can be employed to both give IE/Win the height-fix it needs, and not give it to other browsers. One method is to set the small height in the regular selector for the element and then override that height with the auto value in a following selector that uses a child combinator, >, which IE/Win browsers do not recognize. This requires knowing the direct parent of the buggy box. It is not a good idea to use spaces around the child combinator, as this can cause bugs.
Another method is to use the Tan hack to hide the height from browsers other than IE, and then override that height for IE5/Mac only, using a modified Mac-version of the Tan hack, which again uses the child combinator to prevent IE/Win from reading the redefined value. The Mac-version also requires an escape character (a backslash, \) to be used in each property name included in a ruleset to prevent IE5/Win from reading the rules. In the Mac-modified version of the Tan hack, the child combinator replaces the descendant combinator normally used between the star and html. This is shown in red in the last line below. The escape (the backslash character, also in red) is used in the height property. Both of the alternate methods just described are shown in the following code block.
Child Combinator Override Method
.buggybox {height: 1%;}
#parentElement>.buggybox {height: auto;}

Mac-modified Tan Hack Method
* html .buggybox {height: 1%;} /* for IE/Win */
*>html .buggybox {he\ight: auto;} /* for IE5/Mac */
Code Block 2
Which method should you choose? Well, as with most everything CSS, it depends. Of the three options presented, the one we would be least likely to use is the Child Combinator Override Method. We prefer to have the original selector for an element contain the correct value for the properties defined within, and use a hack, or filter, as they are sometimes called, to provide alternate values for IE/Win. The other two methods can come down to a matter of preference.
Note: The Child Combinator Override Method is our name for the method described in Code Block 2 above. As far as we know, there is currently no commonly used name for this method, or the one using the Mac-modified version of the Tan hack. Also be aware that if a future version of IE/Win finally does support the child combinator, this hack may backfire by letting IE/Win see the "wrong" height value, depending on what changes actually occur in that browser.

Trick Shooting

While having a "minimal test case" to try these fixes on is the best way, it is sometimes possible for a CSS coder to skip that step and just apply them directly to parts of a big convoluted page in the hope of "getting lucky." This approach can be problematic for newbies however, because what may look like a bug is often actually correct behavior, or an IE/Win specification violation. A good rule of thumb is to compare the display of a suspected IE/Win bug to the display in Opera 7 and a Mozilla based browser. If both these non-IE browsers look good then it's a fair bet you are seeing an IE bug or misbehavior. Telling these apart is another matter, requiring knowledge of the IE Float model, the IE Box model, the IE 3px problem, and occasionally other issues as well.
These two "magic bullets" can work wonders, enabling authors to utilize many layouts previously out of reach due to IE bugs. They are by no means cure-alls, though they may seem as such at times, and they are certainly no substitute for good coding practices. While there are other fixes not detailed here, the ones we have described are the primary weapons in use today for zapping bugs in complex table-less designs. One recent and very tricky float layout employs as many as eight Holly hacks to force compliance from "that" browser. Bang! Bang!

Monday, March 7, 2011

How to access MySQL database remotely in cPanel - Remote MySQL Database Access(Access Host)

I have rectly encountered a problem with MySQL database connectivity,what was that see it

I'm having problem with accessing database from one of my site to another..

I have one site say a.com and I want to replicate the database from this site to my another site say b.com...

I'm using Cpanel in both the sites. In site A.com, I have created a user with required privileges and also added the other website (b.com) in the access hosts..

Now to access a.com database from b.com, I can use the username and password I have created on a.com but I'm not sure what hostname should I use..

Website a.com use localhost as the hostname..what should I use with b.com..


Solution:

-If a.com and b.com are on the same server, then you can use localhost.

-If they are on different servers, then use the IP address or domain name instead of localhost.

If the site with the database is a cPanel account, then you will need to give permission for remote access. This is done in cPanel>>MySQL databases

Look towards the bottom for a section called Access Hosts.

Start with % (wildcard). Once it works then

Add the IP address of the server that is wishing to access the database.
Then delete the wildcard (%)

-If already changed the "access hosts"
but this mysql error shows up


GRANT ALL PRIVILEGES ON `the_DB` . * TO 'username'@ 'domain_ip';


Try above sql query from MySQL prompt. and flush the prvileges. Check from your end.

Tuesday, March 1, 2011

Automatically Redirect HTTP requests to HTTPS using ASP

It’s possible to Force SSL on web pages using ASP. In this article I will show you how to accomplish this. To do this you need to do 2 things.

1. Create a ForceSSL.asp page
2. Set the file as an include on any pages that require SSL

ForceSSL.asp

Within your website create a file called ForceSSL.asp. I usually put this file in a directory called includes. You can get a copy of the file I used in this example here: ForceSSL.zip


<% If Request.ServerVariables("SERVER_PORT")=80 Then Dim strSecureURL strSecureURL = "https://" strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME") strSecureURL = strSecureURL & Request.ServerVariables("URL") Response.Redirect strSecureURL End If %>
Include File

On every ASP page that requires SSL you will need to add the “include virtual” statement below, you may need to modify it to the location of your ForceSSL.asp file. If you notice on the default.asp page I have created below, I have placed the “include virtual” statement at the top of the document, you want to put it on top so it will run first.



When implementing this solution you need to make sure to use relative paths for all references on your page because there is a possibility you will get a warning asking you if you want to display secure and insecure items. For example, if you have a logo on your page and the URL to this logo is http://domain/images/logo.jpg, do not use the whole path because including the http:// will hard code this image to use http and not https. Instead use /images/logo.jpg.

Install CDONTS mail component and SMTP on Windows Server 2008

CDONTS is mail component used to send messages from an ASP page. Instead of recoding multiple web sites I have created, I am just going to install the component on my Windows Server 2008.

Configuration Information

Platform: Hyper V Host (http://www.microsoft.com/windowsserver2008/en/us/hyperv.aspx)
OS: Windows Server 2008
Installation Media: CDONTS.zip – You can download the version I used here.
CPU: 2 dedicated 2.0Ghz
RAM: 1024mb
Disk: 40GB
Notes: IIS 7 has already been installed

Background

You can see here sendmail.asp is calling CDONTS when it creates the message.

-----------This is just an example---------

Dim bodyText
bodyText = "..............." & vbcrlf
'Some text here for variable value
bodyText= boxyText & "End of mail"


Set objMail = Server.CreateObject("CDONTS.Newmail")

.....
.....
.....
-------------------------------------


If CDONTS is not installed and I press send on my mail form I get this error

Server Error
Internal Server Error

There is a problem with the resource you are looking for, and it cannot be displayed.





Installing CDONTS

Copy CDONTS.dll to c:\windows\system32 (You can download the version I used here)

Open the command prompt and run "regsvr32 c:\windows\system32\cdonts.dll"

Press OK when registration succeeds

Installing SMTP

Open Server Manager, you can open this several different ways in Windows Server 2008. Probably the quickest way to open Server Manager is to right click "My Computer" and choose "Manage", another way is open "Control Panel" go to "Program and Features" and select "Turn Windows features on or off". A third way to open it is "Server Manager" option under Administrative Tools.

Under Features, select Add Roles

Check the check box off next to "SMTP Server"

IIS will figure out what else it needs and create a list of required features, Press "Add Required Features"

Now there should be a check in the check box next to "SMTP Server", Press "NEXT" to continue

Press "Install" to continue with the installation

You should see a message indicating the Installation has succeeded, Press "Close" to continue

Configure SMTP Server

Make sure when you when you install the SMTP service, you enable Relay for localhost. Go to Administrative Tools > Internet Information Services (IIS6) > SMTP Virtual Server > Right click, Properties > Access Tab > Relay button > Add 127.0.0.1 in the option

Configure SMTP Security

Grant the appropriate permissions on C:\inetpub\mailroot\pickup (I granted USERS group Modify permissions). You could get permission denied if the folder security isn’t adjusted.

Testing

This is my contact form that uses the CDONTS component

No more 500 error, the message was sent out successfully

You can also test using the using the following code in an ASP page. Here is the code to test CDONTS in an ASP page.

Create a TEST.ASP with the following code and put the file in C:\Inetpub\wwwroot. Change the "CDONTSMail.To=" value to your e-mail address. Navigate to http://localhost/test.asp, if all is configured ok then you should receive the mail message. If you do not receive the e-mail check the folders under c:\inetpub\mailroot to see if its queued up.

<% Dim strBody Dim CDONTSMail Set CDONTSMail = CreateObject("CDONTS.NewMail") CDONTSMail.From= "user@example.com" CDONTSMail.To= "user@example.com" CDONTSMail.Subject="This is a Test email" strBody = "This is a test message." & vbCrLf CDONTSMail.Body= strBody CDONTSMail.Send set CDONTSMail=nothing %>

Install and Configure FastCGI & PHP 5.2.9 on (IIS 7) Windows Server 2008

In this article I will install and configure both FastCGI and PHP 5.2.9 on IIS7. You can configure PHP to use an ISAPI filter or CGI, on my old 2003 server I had it running as an ISAPI filter and it worked just fine. On my new 2008 server I am going to attempt to run the requests through Fast-CGI.exe, which should be faster than a filter.

Configuration Information

Platform: Hyper V Host (http://www.microsoft.com/windowsserver2008/en/us/hyperv.aspx)
OS: Windows Server 2008
Installation Media: PHP 5.2.9 was downloaded from http://www.php.net/downloads.php
CPU: 2 dedicated 2.0Ghz
RAM: 1024mb
Disk: 40GB
Notes: a base installation of IIS 7 has already been installed, that installation is covered here.

Installing CGI on IIS 7

You will first need to install CGI on IIS 7 before you install PHP. Installing CGI also installs FastCGI which we need for PHP to work correctly.

Open Server Manager, you can open this several different ways in Windows Server 2008. Probably the quickest way to open Server Manager is to right click "My Computer" and choose "Manage", another way is open "Control Panel" go to "Program and Features" and select "Turn Windows features on or off". A third way to open it is "Server Manager" option under Administrative Tools.

Under Roles, select "Add Roles"

Select "CGI" and press "Next"

Press "Install" to install CGI

CGI will begin its installation

After the installation succeeds, press "Close"

Under "Roles" you should now see CGI installed. Now it’s time to install PHP

Installing PHP 5.2.9

Launch "php-5.2.9-win32-installer.msi". Press "Next" to continue

Accept the terms of the license agreement by checking the checkbox, press "Next" to continue

Install PHP under C:\PHP\. You can install it under whichever directory you choose, what I have learned is C:\PHP works the best. Press "Next" to continue

Select "IIS FastCGI". Press "Next" to continue

Right click PHP and choose "Entire feature will be installed on local hard drive". It’s OK to install ALL of the extensions, we will only enable the ones we need in PHP.ini when we are done.

Press "Next" to continue

PHP is ready to install, press "Install" to begin installation

Set up will copy all the files and do what it needs to do

Do not worry about this error, IIS does not have httpd.conf file Apache does.
"Error trying access httpd.conf file. You need to manually configure the server"


Press "Finish"

-------------------------


Configuring PHP 5.2.9 on IIS 7

Open PHP.ini, which is located in C:\PHP or wherever you installed PHP. You can open it with Notepad

Change "open_basedir" value to the following:

open_basedir = C:\inetpub

Go down to the extensions section, which should be at the bottom I commented out EVERY extension by adding a ; (semi-colon) in front of the extensions name. I did this for ALL of the extensions except for the following:

extension=php_curl.dll
extension=php_gd2.dll
extension=php_interbase.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mysql.dll

I needed to use php_mysql.dll because I am using MySQL for the database. If you are using a different DB you will need to load the appropriate DLL

Please keep in mind: IF YOU GET ERRORS (i.e. an IIS 500 error) most likely you have an extension enabled that your server does not like!

Save your PHP.ini file now

Testing PHP at the command prompt

Open a command prompt. Navigate to the directory you installed PHP to.

Type in: PHP –info and you should see a lot of scrolling and information. This means PHP is good to go.

Below is the start of the command and output, then the second picture is the last thing that will be shown.

Configuring IIS 7.0

Open IIS and click on "Handler Mappings"

Verify there is a handler mapping for *.php. 5.2.9 includes this in the installation package, before this you had to create one manually.

If you go to the properties you can see it maps *.php files to use C:\PHP\php-cgi.exe. Cool!

Testing PHP in a Browser

Navigate to the default site directory at C:\inetpub\wwwroot. Create a file called "info.php" and place the following in the file:





Open your browser and point it at http://localhost/info.php and you should see a PHP information page similar to this:

Again, If you receive a 500 error it might be because of one of the extensions you have enabled.

Install and Configure MySQL 5.1.30 on Windows Server 2008

In this article I will perform an installation of MySQL 5.1.30 on Windows Server 2008, I will take you step-by-step through the whole installation. MySQL is the world’s most popular open source database engine, it’s fast, stable and reliable for most situations.

Configuration Information

Platform: Hyper V Host
OS: Windows Server 2008
Installation Media: MySQL 5.1.30 was downloaded from http://dev.mysql.com/downloads/

CPU: 2 dedicated 2.0Ghz
RAM: 1024mb
Disk: 40GB

Installation

Run Setup.exe

Click “Next” on the Setup Wizard window

I am going to select “Custom” installation so I can see all available options, Press “Next” to continue

I want to change the location of my installation to C:MySQL, press “Change”

I changed “C:Program FilesMySQLMySQL Server 5.1″ to “C:MySQL”, I am only changing this location for personal preference, and you can make it whatever directory you wish. Press “OK” to continue

I also want to change the location of the data the MySQL will store. Select “MySQL Server Datafiles. Press “Change” to continue

I changed “C:Program FilesMySQLMySQL Server 5.1″ to “C:MySQL”, I am only changing this location for personal preference, and you can make it whatever directory you wish. Press “OK” to continue

Press “Next” to continue

Setup is ready to begin the installation. I verified that the destination folder and data folder is set to C:MySQL. Press “Install” to continue

Installation will begin to copy the files

After installation MySQL includes shameless plugs for their enterprise subscription. Press “Next” to continue

Here is one more shameless plug from MySQL. Press “Next” to continue

Select “Configure the MySQL Server now”. Press Finish to continue

Configuration

Press “Next” at the Welcome screen to continue

Because I am a techie I am going to select “Detailed Conifugration”. Press “Next” to continue

I am going to use this to run blog applications so I am going to select “Server Machine”, you can select what is best for your suited for your goal. Press “Next” to continue

I am going to choose “Multifunction Database” because it allows me the flexibility of Transactional and Non-Transactional Database’s to coexist, again you can select what is best for your suited for your goal. Press “Next” to continue

Choose “Installation Path” so it will store the InnoDB Tablespace Settings under the Installation directory. I like to keep everything in the same place, the default location puts this elsewhere. Press “Next” to continue

Because this is for a blog I am going to select “Online Transaction Processing (OLTP)”, you can select what is best for your suited for your goal. Press “Next” to continue

I left the defaults for TCP/IP and I unchecked “Enable Strict Mode”, some blog applications associated with WordPress have an issue if this is enabled. Press “Next” to continue

Keep the default “Standard Character Set”. Press “Next” to continue

I checked off “Install As Windows Service”, set the “Service Name” to “MySQL” and checked off “Launch the MySQL Server automatically”. I checked off “Include Bin Directory in Windows PATH” so I can run the client tools from any location in the command prompt and not have to go to the C:MySQLBin directory. Press “Next” to continue

Enter a new password for the root account, retype the password. Press “Next” to continue

Press “Execute” to initiate the configuration changes to MySQL

The configuration wizard will make the requested changes

Make sure all changes were successful. Press “Finish” to continue

Verification

Go to C:MySQL. Bin is where the system files for MySQL are located. Data is the directory where the databases will be stored, and my.ini is where most of the configuration is kept.

From the command prompt run the following command, if you get the error “‘mysql’ is not recognized as an internal or external command” then you will need to navigate to the “Bin” directory under your MySQL Installation and run it from there. This is used to test connectivity to the MySQL Server.

mysql –u root –p

DCPROMO on Windows Server 2008

From my Windows Server 2008 machine, I will be running DCPROMO to turn it into a domain controller for my new domain.

Prerequisites

Networking

Before we run DCPROMO, we need to make sure we have a Static IP Address set. If this is your first Domain Controller on your network set the DNS server to the same IP address you set for the server itself. This is because we will be installing DNS with this Domain Controller. For clients in an Active Directory domain they must point to a DNS server located on a Domain Controller.

If you are connecting to an existing AD domain then point the Preferred DNS server to another AD Domain Controller. After AD is installed you can point the Preferred DNS server to itself and point the Alternate DNS server to another AD Domain Controller.

Password

If this is a new AD installation, change the administrator password to a complex password or you will get this error during installation

DCPROMO

Press the Start button then enter “DCPROMO” and press “ENTER”

Press “Continue”

The setup will detect if the binaries are installed and if they are not it will install them

Using Advanced Mode Installation

The improvements to the Active Directory Domain Services Installation Wizard are all available by default. However, some wizard pages appear only if you select the Use advanced mode installation check box on the Welcome to the Active Directory Domain Services Installation Wizard page of the wizard.

Advanced mode installation provides experienced users with more control over the installation process, without confusing newer users with configuration options that may not be familiar. For users who do not select the Use advanced mode installation check box, the wizard uses default options that apply to most configurations.

The new option on the Welcome page of the wizard enables advanced mode installation as an alternative to running dcpromo at a command prompt with the /adv switch (dcpromo /adv).

The following table lists the additional wizard pages that appear for each deployment configuration when you select the Use advanced mode installation check box.
Deployment configuration Advanced mode installation wizard pages
New forest Domain NetBIOS name
New domain in an existing forest On the Choose a Deployment Configuration page, the option to create a new domain tree appears only in advanced mode installation.

Domain NetBIOS name

Source Domain Controller
Additional domain controller in an existing domain Install from Media

Source Domain Controller

Specify Password Replication Policy (for RODC installation only)
Create an account for a read-only domain controller (RODC) installation Specify Password Replication Policy
Attach a server to an account for an RODC installation Install from Media

Source Domain Controller

Check “Use advanced mode installation”

Press “Next”

Microsoft’s message letting you know NT 4.0 clients might have issues with Windows Server 2008 Domain Controllers

Press “Next”

We will be creating a nee domain in a new forest.

Select “Create a new domain in new forest”

Press “Next”

Enter the name of the new forest root.

Press “Next”

At this point it will check to see if the forest name is in use, since we set the DNS server to itself – it will not get very far.

Enter the NetBIOS name of the domain. This is for clients who use NetBIOS, you want to keep this under 8 charaters for true NetBIOS clients. I don’t have any of those so my domain is 9 charaters

Press “Next”

Domain and Forest Functional Levels

2008: This forest functional level does not provide any new features over the Windows 2003 forest functional level. However, it ensures that any new domains created in this forest will automatically operate at the Windows Server 2008 domain functional level, which does provide unique features.

2003:
The Windows Server 2003 forest functional level provides all features that are available in Windows 2000 forest functional level, and the following additional features:

- Linked-value replication, which improves the replication of

changes to group memberships.

- More efficient generation of complex replication topologies

by the KCC.

- Forest trust, which allows organizations to easily share

internal resources across multiple forests.

Any new domains that are created in this forest will automatically operate at the Windows Server 2003 domain functional level.

2000:
The Windows 2000 forest functional level provides all Active Directory Domain Services features that are available in Windows 2000 Server. If you have domain controllers running later versions of Windows Server, some advanced features will not be available on those domain controllers while this forest is at the Windows 2000 functional level.

Choose “Windows Server 2008″

Press “Next”

Setup will check our DNS configuration

Select “DNS sever” to make this server a DNS Server

Press “Next”

Press “Yes”

You can change these locations but why would you. If you are running low on space on your C drive then why even make the box a domain controller?

Press “Next”

Enter a password for the “Directory Services Restore Mode Administrator”

Confirm the password

Press “Next”

Press “Next”

Active Directory will install

Press “Finish”

Press “Restart”

After the reboot you should have several Active Directory related tools under “Administrative Tools”

How to change the listening port for RDC/RDP (Remote Desktop Connection)

In this article we will change the default listening port for RDC/RDP from 3389 to 5555. This is useful when you want to prevent external or internal users from scanning port 3389 to see what computers are available to connect to. Sure they can scan port 5555 however it is another step for an intruder and they will need to figure out what is running on port 5555 once they see it is open.

Enable Remote Desktop:

Right click “My Computer”

Select “Properties”

Click “Advanced system settings”, depending on your version of Windows you might be able to skip this step

Select the “Remote” tab

Select “Allow users to connect remotely to this computer” or “Allow connections from computers running any version of Remote Desktop”

Press “Select Remote Users” or “Select Users”

Select the users you want to be able to login remotely.

Press “OK”, until you close out of System Properties

By default RDC/RDP runs on port 3389. When you connect using Remote Desktop Connection it uses port 3389 even though you cannot see it.

Changing the RDP Port:

Select Start, Run then type “Regedit”

Press “OK”

Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

You can see the “PortNumber” value is set to 3389 by default.

Select “PortNumber”

On the Edit menu, click Modify

Select “Decimal” – *very important*

Type the new port number of “5555″

Click “OK”

You can close REGEDIT at this point. A restart or reboot is NOT required for this change.

Open Remote Desktop Connection (“mstsc” from the run window, or you can usually find this under “Start > All Programs > Accessories”)

Type the SERVERNAME which you changed to RDP port on and append :5555 to it

So you should enter SERVERNAME:5555

Press “Connect”

Be sure to open port 5555 on any firewalls that may be in the way

Error: Only machine administrators are allowed to create administration service job definitions of type

Issue:

Tried to deploy a custom solution on a SharePoint 2010 farm from Central Administration > System Settings > Manage Farm solutions. I received the following error in the ULS logs.

Access denied. Only machine administrators are allowed to create administration service job definitions of type: Microsoft.SharePoint.Administration.SPSolutionDeploymentJobDefinition, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Fix:

This fix only needs to be run on the machine that you are trying to deploy the solution on. However I would recommend disabling this “feature” on all SharePoint and SQL Servers in your farm.

Follow “to turn off UAC” http://technet.microsoft.com/en-us/library/cc709691%28WS.10%29.aspx

1. Click Start, and then click Control Panel.

2. In Control Panel, click User Accounts.

3. In the User Accounts window, click User Accounts.

4. In the User Accounts tasks window, click Turn User Account Control on or off.

5. If UAC is currently configured in Admin Approval Mode, the User Account Control message appears. Click Continue.

6. Clear the Use User Account Control (UAC) to help protect your computer check box, and then click OK.

7. Click Restart Now to apply the change right away, or click Restart Later and close the User Accounts tasks window.

Configuring Windows Firewall for FileZilla Server on Windows Server 2008

I download FileZilla Server from http://filezilla-project.org/ and I wanted to install it on my Windows Server 2008. I did a basic install, created a user and set a directory for the user. When I tried to access it via the FileZilla client I noticed I could not connect to the FileZilla server. Troubleshooting led to the Windows firewall being the root cause.

In this article I will show you how to configure Windows Firewall to allow FileZilla Server. You can apply this same method for other network services you want to use with Windows Firewall because we are going to set the firewall rules by the application and not by the port.

FileZilla Client error:

Error: Could not connect to the server
Status: Waiting to retry...
Status: Resolving address of abc.XYZ.com
Status: Connection time out
Status: Could not connect to server
Status: Waiting to retry...


Open "Windows Firewall" from Administrative Tools and select "New Rule"

Select "Program", and then press "Next"

Press "Browse"

Browse to C:\Program Files\FileZilla Server\ and select "FileZilla server.exe". Then press "Open". You can apply this method for almost any program that is having issues connecting through Windows Firewall. The key to configuring Windows Firewall is selecting the right EXE to allow. Sometimes the only way to find the right EXE is trial and error. If I would have selected “FileZilla Server Interface.exe” instead of “FileZilla server.exe” it probably would not have allowed the connection.

Verify that the correct EXE is in the path location and press "Next" to continue


Select "Allow the connection", and then press "Next" to continue

Select Domain, Private and Public then press "Next". For most situations you will need to have all of these checked.

Enter a name for the Firewall Rule, in this case we are going name it "FilaZilla FTP Server" so we can easily find it later if we need to change anything


Make sure the rule is set to "Enabled". We can now try to connect again using the client


After the configuration I was able to connect to the FileZilla FTP Server. In the event you cannot connect to the server check the following:

* Check the Servers active/passive configuration settings
* Check the Clients active/passive configuration settings
* Check to see if a router or another firewall is preventing connection both on the client and server side

Login failed for user 'IIS APPPOOL\Classic .NET AppPool'

Have you just installed Windows 7 or Windows Server 2008 R2 and when you tried to setup your asp.net/mssql website you got following error: "Login failed for user 'IIS APPPOOL\Classic .NET AppPool'"?

It seems that new IIS version 7.5 runs its Classic .NET AppPool process with a different identity, and from there we get error "Login failed for user 'IIS APPPOOL\Classic .NET AppPool'".


Solution


* go into Internet Information Services (IIS) Manager
* expand node with your computer name on left side and select "Application Pools"
* now in the window on the right side, right click "Classic .NET AppPool" and select "Advanced Settings..."



* find "Identity" property and change its value to "LocalSystem"