Virtual hosts not serving php files in Ubuntu 14.04 LAMP droplet.
I was trying to install prestashop 184.108.40.206 with the help of following tutorial
Everything went fine and I was able to view to store on <my IP address>/<foldername>
where the folder name was in /var/www .
Now I wanted to configure my domain name to the droplet IP and hence I then changed my name servers to digital ocean nameservers and added a domain to the droplet. Then I added the ’@’ Record and a CNAME record for the www
Next step was to change the virtual host file. So I created a backup of 000-default.conf file Then changed it which is as follows
<VirtualHost *:80> ServerAdmin email@example.com ServerName 2dayhiker.com DocumentRoot /var/www/2dayhiker </VirtualHost>
I saved the file as 2dayhiker.com.conf in /etc/apache2/sites-available/
Then I ran
- a2dissite 000-default.conf
- a2ensite 2dayhiker.com.conf
- sudo service apache2 restart
Everything was fine until now but now when I open 2dayhiker.com in my browser
- It changes the addressbar to <my-ip>/2dayhiker.com/index.php?
- It shows error that the index.php is not found.
What can be the problem for this type of error.
Is there any permission problem because I have tried giving all the permissions (777) and it s still not serving.
I also ran the following command
- chown -R root:www-data /var/www/2dayhiker
just to test but no success?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.