Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
79
rated 0 times [  79] [ 0]  / answers: 1 / hits: 151681  / 1 Year ago, tue, january 3, 2023, 2:02:21

I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing.
I think that happened because Zend updated Apache.



Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser.


More From » apache2

 Answers
0

The apache2 version that was published when the Ubuntu 14.04 release was made is 2.4.7 and starting with this version it seems that, for security reasons, the new root directory for the server is:



/var/www/html


So, from now on, this is where you must place the files for your (local) website. You should not have this problem again with the future updates.






Anyway, if you want to change this directory with another one, you have to modify (as root) the following line from /etc/apache2/sites-available/000-default.conf file (sudo nano /etc/apache2/sites-available/000-default.conf):



DocumentRoot /var/www/html


to



DocumentRoot /path/to/another/directory


After this, for the new changes to take effect, you have to restart the apache server using the following command:



sudo service apache2 restart

[#25986] Tuesday, January 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fulerio

Total Points: 172
Total Questions: 124
Total Answers: 109

Location: Hungary
Member since Thu, Aug 6, 2020
4 Years ago
;