It’s easy to get from Rome to Naples and Salerno, trains just about every hour. Honestly, there’s so much to do in this region you’re going to have to think carefully about what you want to see or do. This will help you decide where to stay and for how long. Picking the right home base for ease of travel can make all the difference. It’s an amazing area though, you can’t really go too wrong here.
If you’re interested in Naples/Pompeii/Herculaneum then you should base yourself for a few nights in either Naples or Sorrento. I thought Naples was great, and deserves at least a full day of sightseeing. Sorrento is a much more laid back, relaxing place, but has superb transportation connections to just about anywhere in the region. Not sure what the ferry schedules look like at that time of year. You can day trip to Capri and onto the Amalfi Coast From here, but if you’re more inclined to enjoy the Amalfi Coast’s sublime charms then you should consider staying a couple nights there.
There’s a lot of options on the AC. Ravello is great, but not great if you want to get out to some other towns. It would take several bus connections. Amalfi has easy transport options, but not as pretty as say, Positano. I stayed in Atrani, a little beach town a short walk from Amalfi, and would recommend highly.
With that early flight out, you’ll definitely need to spend that previous night in Rome.