The application server consists of the middleware and database. Regardless of the options you use in both cases, both components of the application server need to be able to talk to each other and to the Web server.
This means that you must have a Web server up and running first before you install any middleware or database software. It also means that after you get any middleware and database components working, you'll need to configure your Web server software to recognize and talk to these components.