I've done several hours of research. I am running Ubuntu 22.04, I am on the latest release and I am not doing anything special or fancy to my computer. I've gotten to the point where I successfully am able to get my pages to display PHP properly, so, that isn't an issue. I would think that it would be easy to find out documentation to successfully create aliases. I notice there are some courses from LinkedIn Learning in their library, however, they are from 2018. I wary of about Apache especially when I've read elsewhere that there have been changes between versions 2.2 and 2.4 for Apache. This is my code so far. When I type in test1, it does not link to the file. These are the permissions for my files so far
4-rw-r--r-- 1 jake jake 19 Jun 13 02:30 index.
4-rw-rw-r-- 1 jake jake 19 Jun 13 02:46 test.html.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is/home/jake/Documents/coding
#used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Alias "/test1" "file:///home/jake/Documents/coding"
<Directory "file:///home/jake/Documents/coding/home/jake/Documents/coding">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
vim: syntax=apache ts=4 sw=4 sts=4 sr noet
# value is not decisive as it is/home/jake/Documents/coding
. Or more importantly<Directory "file:///home/jake/Documents/coding/home/jake/Documents/coding">
which contains an obvious problem you haven't noticed aside from the fact that using URIs instead of plain absolute paths isn't going to work. – Martin Thornton Jun 13 '22 at 12:59/home/jake/Documents/coding/home/jake/Documents/coding
. – Martin Thornton Jun 13 '22 at 17:01<a href="https://askubuntu.com/questions/767504/permissions-problems-with-var-www-html-and-my-own-home-directory-for-a-website">this correct</a>
? Should you never even think about trying to make your folder point somewhere else in the first place? I have seen other people try to do this and they have not been successful. What's interesting is anything by default outside of the Apache 2 does not seem to work. At first glance and after my research, I get the impression that it is actually hard to access by default. While they let you change a whole lot, – Jake Jun 13 '22 at 07:38<Directory "file:///home/jake/Documents/coding/home/jake/Documents/coding">
<-- Nonexistent Directory, so your Alias 403ing is because you don't define it in your config. You shouldn't need to have double entry for your directory paths here - I guarantee you 100% that/home/jake/Documents/coding/home/jake/Documents/coding
does not exist on your system. Your alias may be right, but your Directory configuration is wrong. – Thomas Ward Jun 13 '22 at 18:57file://
is a URI, NOT a directory path, so your Apache configuration will not work in the Directory declaration because it needs the actual paths on disk not yourfile://
URL. – Thomas Ward Jun 13 '22 at 18:57