Set posts at corners and 8 feet apart if more are needed. Install these in concrete if possible. Otherwise use column anchors, or steel plates fastened to porch decks, using anchor bolts. Use 4-by-4-inch posts for a small porch, and 6-by-6-inch posts for a larger one. Plumb the posts vertically with a level and secure with screws driven into the posts through the sides of the anchors.
Remove the shingles or house siding to expose the wood sheathing and locate the studs, wall plates and roof rafters. Measure from the porch to the bottom of the chosen connecting point on each side and snap a level chalk line. Install a 2-by-6-inch ledger or nailer board horizontally along the chalk line, using lag bolts. Drill starter holes with a power drill and drive bolts with a ratchet wrench in every stud or truss or every 16 inches along a wall base plate.
Set 2-by-6-inch beams upright atop the outside columns the width of the porch and along the sides from the house to the end column on each side. Fasten these to the ledger board with metal rafter hangers, which are brackets screwed into the ledger to support the beam and fastened with screws on each side of the beam. Toenail the beams to the columns, driving 12d framing nails with a hammer through the beam into the column top. Add metal hurricane clip brackets to tie the boards together.
Cut 2-by-4-inch rafters to fit between the ledger board and the outside beam. Divide the width of the roof by 24 to determine the number of rafters needed. Install rafters with metal hangers nailed to the ledger and outer beam. Add 2-by-4-inch vertical supports between the outer rafter and the outer beam for a porch more than 4 or 5 feet deep.
Nail oriented strand board over the rafters, using the hammer and 8d galvanized nails. Fasten roofing paper over the OSB with a construction stapler. Put wide metal flashing at the top, one side nailed to the house and the other to the OSB, under the roofing paper. Put drip-edge metal flashing at the bottom and along the sides.
Install shingles to match the original house and replace any shingles or siding you removed. Run shingles on top of the roof so any replaced shingles or siding overlap. Fit OSB panels to cover the opening along the sides of the roof. Finish the roof with 1-by-4-inch fascia or facing trim nailed across the outer ends of the eave rafters and down the top of the roof sides.