I followed this tutorial to setup a static IP: http://www.circuitbasics.com/how-to-set-up-a-static-ip-on-the-raspberry-pi
As a result of the tutorial here is what my /etc/dhcpcd.conf looks like:
192.168.0.1 is my default gateway IP. I didn't use the RPi public IP in any of the steps.
I followed this tutorial for setting up Nextcloud: http://www.instructables.com/id/Personal-Cloud-for-Self-organization/
In this tutorial the Apache commands used are:
sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 php5-curl php5-gd -y
sudo apt-get install mysql-server php5-mysql -y
mysql -uroot -p
create database cloud;
sudo service apache2 restart
So didn't provide any IP while installing Apache.