I made the virtual host setup in Ubuntu 20.04 for accessing virtually to my web projects. I have followed the necessary steps properly, but since I wanted to work more portable and access my web projects from outside rather than default document root, so I set my own media device path (/media/akin/7114-BB32/htdocs/) instead of the default document root (/var/www/html/).
But when I wanted to access the my domain (htdocs.com) from the browser, it did not work, I could not view my own index page. It opened the index of a different web page. I could not find exactly what I was doing wrong or missing.
What should I do for it?
And here is my domain.conf(htdocs.conf):
<VirtualHost *:80>
ServerAdmin webmaster@htdocs.com
ServerName www.htdocs.com
ServerAlias www.htdocs.com
DocumentRoot /media/akin/7114-BB32/htdocs
<Directory /media/akin/7114-BB32/htdocs>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
apache2.conf:
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
Options +MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /media/akin/7114-BB32/htdocs/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
Also my document root permission list:
ls -la /media/akin/7114-BB32/htdocs
drwxr-xr-x 2 akin akin 8192 May 17 22:38 .
drwxr-xr-x 11 akin akin 8192 Jan 1 1970 ..
-rw-r--r-- 1 akin akin 1319 May 17 22:38 index.html