I am just starting to look at PHP and Apache servers (at the moment use Ruby on Rails). I am looking to get two simple index.php files rendering in the browser, but they will be two separate sites. I have installed everything I need to I believe.
So if I go to localhost
I get the Apache2 Ubuntu Default Page. This might be such a simple question but where do I store my files and directories? I have been looking in /var/www/
.
I would like to create 2 sample sites as previously said. Could anyone point out where I should be looking and how I differentiate the two sites?
/var/www/
is your root folder for apache so your localhost is pointing to www. To create 2 different website you will require to create 2 new folder in www
folder e.g web1 and web2 then localhost/web1
will point to /var/www/web1
same will goest for web2.
You can also set virtual host to make your web url like web1.com
and web2.com
check here on how to set virtual host in ubnuntu https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
First, I would like to welcome you in this beautiful world of PHP :)
Now look into this file : /etc/apache2/httpd.conf
and locate for this config DocumentRoot "THIS_IS_YOUR_DOC_ROOT_RICHLEWIS"
.
You can change it to your favorite document root an d restart Apache, or simply put your files here(php, html, images...