To start I would like to change the folder destination, in case it is in: /var/www/html, I would like to put a directory in the documents for example
1) Open the configuration file for Apache:
/etc/apache2/apache2.conf
2) Find the settings DocumentRoot
and change to the directory you want:
By default, it should look like this: DocumentRoot "/var/www/html"
3) Browse the directory configuration and change the path as well:
<Directory "/var/www/public_html">
...
</Directory>
I need that instead of this localhost home screen, a simple index would appear with the folders of my projects and nothing more.
4) In the directory configuration, look for the line Options
and make sure you have Indexes
:
Options Indexes FollowSymLinks
5) In the archive .htaccess
there can be no option -Indexes
, or will overwrite the directive in step "4)".
6) When you access the directories of Apache, automatically it fetches some default files in order to display to the user. So, you should "take" these files from the root directory since you want to list the contents of the folder. Usually these are the files:
index.php index2.php default.php index.html index.htm
You can configure this in the same file Apache that we changed earlier. Just look up the settings:
<IfModule dir_module>
DirectoryIndex index.php index2.php default.php index.html index.htm
</IfModule>
I don’t recommend changing that, but if you like, it’s there!