logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: You don't have permission to access / on this server
Author
jcobban



Joined: 10 May 2015
Posts: 17
Location: canada, ottawa

PostPosted: Mon 11 May '15 18:28    Post subject: You don't have permission to access / on this server Reply with quote

I do not understand this message. Of course Apache does not have permission to access the root directory on Ubuntu Linux, but why is Apache even trying to when I have not asked it to?

All I am trying to do is change the DocumentRoot from the /var/www/html that it is set to by the default version of /etc/apache2/sites-available/000-default.conf to /home/jcobban/public_html. This is so the directory structure on my test system will exactly match the directory structure on the production site at www.jamescobban.net. I tried just changing the DocumentRoot value in the conf file, but that didn't work. I searched through the web for examples of conf files that supposedly worked but everything I copied and tried did not work. I do not understand the Apache2 documentation description of configuration commands and I cannot find a decent tutorial on what I feel should be a trivial operation.

I know the permissions on the relevant directories are appropriate because the site worked until I upgraded to the latest version of Ubuntu and Apache2.

If someone can point me at a relevant tutorial on how to change the DocumentRoot I would appreciate it. I want to know WHY Apache is behaving this way so I can stop wasting time every time I have to upgrade the operating system release. I am a programmer not a system administrator and I should not be required to understand all of the arcana of Apache administration just in order to get my work done.

My latest attempt at a conf file, based upon searching the web is:
Code:
<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 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 /home/jcobban/public_html
    <Directory /home/jcobban/public_html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </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
Back to top
jcobban



Joined: 10 May 2015
Posts: 17
Location: canada, ottawa

PostPosted: Mon 11 May '15 18:47    Post subject: Re: You don't have permission to access / on this server Reply with quote

jcobban wrote:
I do not understand this message. Of course Apache does not have permission to access the root directory on Ubuntu Linux, but why is Apache even trying to when I have not asked it to?


I have solved the problem. By looking at the instances of <Directory> in the apache2.conf file and copying exactly what is there for the default /var/www directory I got it to work. But I still do not understand why it works, and I need to know that to prevent this problem happening in the future. There needs to be an authoritative tutorial on this issue, since following the advice given on the tutorials that pop up when I google the question "Apache change documentroot" is NOT helpful. These posts obviously apply to an obsolete release of Apache and the developers have chosen to make the current release not backwards compatible to config files created for the old version. I know there is no way to get rid of these misleading posts, since nothing ever dies on the web including this rant, but there does need to be a way to get an accurate tutorial to the top of the google search results. Also either the authors of Apache2 need to replace this GIBBERISH with an error message that accurately describes what is going wrong, or else the documentation of this GIBBERISH has to be improved on the web. An error message which does not accurately describe what is wrong and intuitively lead users to a resolution is a complete waste of time, and that waste of time is repeated by every user who is mislead by this GIBBERISH!
Back to top


Reply to topic   Topic: You don't have permission to access / on this server View previous topic :: View next topic
Post new topic   Forum Index -> Apache