Here’s a good Instructable on getting your Pi set-up to act as a web server. It uses Python and a library called Flask in a script which creates the server on-the-fly. This is an excellent introduction to Flask which can be used, for example, to create a web interface to control a robot or other Pi-based project. Take a look here.