In 1848, he accepted a position as professor of mathematics and acting president of the College of William and Mary in Williamsburg, Virginia. He purchased a farm in nearby James City County west of the old colonial capital city along the Richmond-Williamsburg Stage Road (now U.S. Route 60) and built a large plantation house there which became known as Ewell Hall. He was later named permanent president, and served in that capacity between 1854 and 1888, even between 1861 and 1865 when the college was in abeyance. American Civil War In 1861, he became captain of the college militia. Enlistments in the Confederate States Army depleted the student body, and on May 10, 1861, the faculty voted to close the college for the duration of the conflict. The College Building was used as a Confederate barracks and later as a hospital, first by Confederate, and later Union forces. Although he had been opposed to secession for Virginia, during the American Civil War, he joined the regular forces. The 32nd Virginia Infantry was accepted into Confederate service on July 1, 1861, after it had been formed for local defense at Hampton by Ewell from several local militia units from Elizabeth City County, Warwick County, York County, and James City County. He was commissioned as a colonel in the Confederate Army. In 1861 and 1862, under General John B. Magruder and the Army of the Peninsula, Ewell had the primary responsibility for developing and constructing the Williamsburg Line, a line of defensive fortifications across the Virginia Peninsula east of Williamsburg anchored by College Creek a tributary of the James River on the south and Queen's Creek, a tributary of the York River on the north. A series of 14 redoubts were built along the line, with the earthen Fort Magruder at the junction of the two main loads leading from the lower Peninsula to the east, the Williamsburg-Yorktown Road, and the Lee's Mill Road. Following the Battle of Williamsburg on May 5, 1862, during the Peninsula Campaign, with 3,800 Confederate and Union casualties, Williamsburg and the College of William and Mary were occupied by the Union Army. The Brafferton building of the college was used for a time as quarters for the commanding officer of the Union garrison occupying the town. On September 9, 1862, drunken soldiers of the 5th Pennsylvania Cavalry set fire to the college building, purportedly in an attempt