We can set up a simple web server from any directory in mac OS by using the following command.
python -m SimpleHTTPServer 9001
Go to the directory from which we want to run the web server in terminal. Type the above line and the web server will start to run. We can change the port number(9001) as required.