I want to setup a local apache server with a lamp stack. I am using Ubuntu ( I use the last released version ). I followed a tutorial that I found on the french documentation so here is what I did :
I entered the following command in the terminal to install the essentials tools : sudo apt install apache2 php libapache2-mod-php mysql-server php-mysql Then I installed and setup phmyadmin ,it seems to work and I can access it via localhost/phpmyadmin so I think I have done it correctly ( localhost works, I land on the apache welcome page ).
The issue is to access to my project via the browser. As the tutorial said it, I created a configuration file to give the information to apache about my project location, the tutorial said to create the configuration file in /etc/apache2/sites-available/ my file is named location.com.conf ( the tutorial file is named example.com.conf )
Here is the content of this file that I filled following the tutorial :
<VirtualHost *:80>
ServerName location.com
ServerAlias www.location.com
DocumentRoot "/var/www/location/"
<Directory "/var/www/location/">
Options FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.location.com.log
CustomLog /var/log/apache2/access.location.com.log combined
</VirtualHost>
I put my project folder in /var/www/ ( and the project name is "location" so the full path of my project files is /var/www/location/ ) Here is a screenshoot if it can help :
I also ran the following commands after that : ( Because they said to do it in the tutorial, I figured out that it is used to activate the website project on apache after a little bit of research ) :
sudo a2ensite location.com sudo systemctl reload apache2
It seems to recnogize what location.com means because if I try to do it several times it tells me that it is already activated ( and if I try for instance sudo a2ensite thrkrthrth.com it tells me that he doesn't know what thrkrtf.. is )
The problem is that when I try to go on localhost/location or localhost/location.com or 127.0.0.1/location or 127.0.0.1/location.com it just does not works, here is a screenshoot if it can help :
I get this result everytime ( I also tried just location.com or www.location.com, I know it is dumb but maybe it could have work, I obviously just arrive on a random website named location.com )
Can you help me please ? Thank you EDIT : I just found out, by accident that if I go in the file called "000-default.conf" in apache2/sites-available there is a line that was : "DocumentRoot /var/www/html/" I changed it to "DocumentRoot /var/www/" just to try and now I can access to localhost/location but I have to type localhost/www/phpmyadmin, I guess it is a dirty way to do so I just add this as a new hint that may help to know where does the issue come from and how to solve it, I still need help please. I would like to be able to access to phpmyadmin by just typing localhost/phpmyadmin as usual and to access to my website using localhost/location
