Warehouse is installed on any server with the "pypi" role in chef. Right now the database server is managed by OSUOL and the connection details are stored in the chef database (which isn't publicly available, you need to have a PSF chef account to see it).

Both the Elasticsearch and the Warehouse configuration are automatically generated by Chef and is controlled by the chef cookbooks for those pieces.

Specifically the Warehouse configuration file is rendered using https://github.com/python/psf-chef/blob/master/cookbooks/psf-pypi/recipes/warehouse.rb#L65-L126 while the Elasticsearch is using an open source cookbooks so it's configuration file is inside of that cookbook. The elasticsearch cookbook is available from https://github.com/elasticsearch/cookbook-elasticsearch and specfically the configuration file is rendered at https://github.com/elasticsearch/cookbook-elasticsearch/blob/master/recipes/default.rb#L126-L144.