apache 2.4 configuration

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

apache 2.4 configuration

Russell L. Harris-2
I am searching for a guide for configuration of Apache 2.4 on Debian
10.  Thus far, my web searches have found guides for Debian 9 and
guides for Apache 2.2.

I am aware of "https://httpd.apache.org/docs/2.4/" and am digesting it
as rapidly as I can.

I have been working my way through the Chapter 11 tutorial of the
O'Reilly Perl Template Toolkit.  I am about halfway through the
chapter, starting to create a menu.  I can see the topmost page,
"index.html" and the menu, but when I click on any of the menu items,
the browser complains that the page cannot be found.  For example,
"index.html" and "about.html" are in the same directory, but the
browser cannot display "about.html".

After carefully checking my code against the example code published by
O'Reilly, I conclude that I must have an error in my Apache 2.4
configuration.  

The HTML generated by the toolkit is placed in the directory
"/home/rlh/web/ttbook/html/", while images are placed in
"/home/rlh/web/ttbook/images/".  The tutorial, written for Apache
2.2, recommends:

Alias /ttbook/images/  /home/rlh/web/ttbook/images/
Alias /ttbook/         /home/rlh/web/ttbook/html/
Directory /home/rlh/web/ttbook/

Supposedly, the result is:

= The root document URL is "/ttbook/".
= The root images   URL is "/ttbook/images/".
= The default host is "http://localhost/".

With my current mis-configuration, the generated HTML is visible at
"file:///home/rlh/web/ttbook/html/index.html" but not at
"http://localhost/index.html".  

I think that, to begin with, I need to find a good explanation of the
concept of "localhost".  Hopefully that is somewhere in the Apache 2.4
official documentation.

RLH

Reply | Threaded
Open this post in threaded view
|

Re: apache 2.4 configuration

john doe-6
On 4/6/2020 8:26 AM, Russell L. Harris wrote:

> I am searching for a guide for configuration of Apache 2.4 on Debian
> 10.  Thus far, my web searches have found guides for Debian 9 and
> guides for Apache 2.2.
>
> I am aware of "https://httpd.apache.org/docs/2.4/" and am digesting it
> as rapidly as I can.
>
> I have been working my way through the Chapter 11 tutorial of the
> O'Reilly Perl Template Toolkit.  I am about halfway through the
> chapter, starting to create a menu.  I can see the topmost page,
> "index.html" and the menu, but when I click on any of the menu items,
> the browser complains that the page cannot be found.  For example,
> "index.html" and "about.html" are in the same directory, but the
> browser cannot display "about.html".
>
> After carefully checking my code against the example code published by
> O'Reilly, I conclude that I must have an error in my Apache 2.4
> configuration. 
> The HTML generated by the toolkit is placed in the directory
> "/home/rlh/web/ttbook/html/", while images are placed in
> "/home/rlh/web/ttbook/images/".  The tutorial, written for Apache
> 2.2, recommends:
>
> Alias /ttbook/images/  /home/rlh/web/ttbook/images/
> Alias /ttbook/         /home/rlh/web/ttbook/html/
> Directory /home/rlh/web/ttbook/
>
> Supposedly, the result is:
>
> = The root document URL is "/ttbook/".
> = The root images   URL is "/ttbook/images/".
> = The default host is "http://localhost/".
>
> With my current mis-configuration, the generated HTML is visible at
> "file:///home/rlh/web/ttbook/html/index.html" but not at
> "http://localhost/index.html".

If you don't specify 'index.html', do you get it?

Looking in apache's log should give a clue of what's going rong.

> I think that, to begin with, I need to find a good explanation of the
> concept of "localhost".  Hopefully that is somewhere in the Apache 2.4

localhost is simply a name to specify 127.0.0.1 or ::1.

> official documentation.
>
> RLH
>


--
John Doe

Reply | Threaded
Open this post in threaded view
|

Re: apache 2.4 configuration

Andrei POPESCU-2
On Lu, 06 apr 20, 10:51:06, john doe wrote:
> On 4/6/2020 8:26 AM, Russell L. Harris wrote:
>
> > I think that, to begin with, I need to find a good explanation of the
> > concept of "localhost".  Hopefully that is somewhere in the Apache 2.4
>
> localhost is simply a name to specify 127.0.0.1 or ::1.

Typically yes, though any other address in the 127.0.0.0/8 block is
possible.

> > official documentation.

https://en.wikipedia.org/wiki/Localhost

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: apache 2.4 configuration

Joe Rowan
In reply to this post by Russell L. Harris-2
On Mon, 6 Apr 2020 06:26:21 +0000
"Russell L. Harris" <[hidden email]> wrote:

> I am searching for a guide for configuration of Apache 2.4 on Debian
> 10.  Thus far, my web searches have found guides for Debian 9 and
> guides for Apache 2.2.
>
> I am aware of "https://httpd.apache.org/docs/2.4/" and am digesting it
> as rapidly as I can.
>
> I have been working my way through the Chapter 11 tutorial of the
> O'Reilly Perl Template Toolkit.  I am about halfway through the
> chapter, starting to create a menu.  I can see the topmost page,
> "index.html" and the menu, but when I click on any of the menu items,
> the browser complains that the page cannot be found.  For example,
> "index.html" and "about.html" are in the same directory, but the
> browser cannot display "about.html".
>
> After carefully checking my code against the example code published by
> O'Reilly, I conclude that I must have an error in my Apache 2.4
> configuration.  
>
> The HTML generated by the toolkit is placed in the directory
> "/home/rlh/web/ttbook/html/", while images are placed in
> "/home/rlh/web/ttbook/images/".  The tutorial, written for Apache
> 2.2, recommends:
>
> Alias /ttbook/images/  /home/rlh/web/ttbook/images/
> Alias /ttbook/         /home/rlh/web/ttbook/html/
> Directory /home/rlh/web/ttbook/
>
> Supposedly, the result is:
>
> = The root document URL is "/ttbook/".
> = The root images   URL is "/ttbook/images/".
> = The default host is "http://localhost/".
>
> With my current mis-configuration, the generated HTML is visible at
> "file:///home/rlh/web/ttbook/html/index.html" but not at
> "http://localhost/index.html".  

Unless you have changed the DocumentRoot directive in the site you are
using (by default, 000-default.conf in /etc/apache2/sites-available)
then http://localhost/index.html will show you the file
/var/www/html/index.html. If you've placed your alias correctly, then
you will need to use http://localhost/ttbook to see your own index.html
file. If you use a filename other than 'index.html' (or other defaults
like index.php) then you'll need to specify it after '..../ttbook/'.

>
> I think that, to begin with, I need to find a good explanation of the
> concept of "localhost".  Hopefully that is somewhere in the Apache 2.4
> official documentation.
>
>
Localhost is the machine running Apache. The normal IP address for it
is 127.0.0.1, though there are others. It isn't an Apache thing, it's a
networking thing. It's referred to in network configuration as 'lo'.

If you install Apache2.X on Debian, do nothing else at all, and enter
just 'localhost' in a web browser address window (running on the same
machine as Apache) then you will see the Apache 2 Debian Default Page,
at /var/www/html/index.html which basically shows that Apache is
running, and gives a few details about configuration.

If you can see this page, or whatever you may have replaced it with,
then Apache is running, which is half the problem solved. Always check
this first if you have problems (I leave this page in place, despite the
encouragement to replace it) as Apache is quite fussy, and will refuse
to run under some conditions. If it's not running, check
/var/log/apache2/error.log for the reason.
 
--
Joe

Reply | Threaded
Open this post in threaded view
|

Re: apache 2.4 configuration

Russell L. Harris-2
On Mon, Apr 06, 2020 at 12:43:58PM +0100, Joe wrote:

>Localhost is the machine running Apache. The normal IP address for it
>is 127.0.0.1, though there are others. It isn't an Apache thing, it's a
>networking thing. It's referred to in network configuration as 'lo'.
>
>If you install Apache2.X on Debian, do nothing else at all, and enter
>just 'localhost' in a web browser address window (running on the same
>machine as Apache) then you will see the Apache 2 Debian Default Page,
>at /var/www/html/index.html which basically shows that Apache is
>running, and gives a few details about configuration.
>
>If you can see this page, or whatever you may have replaced it with,
>then Apache is running, which is half the problem solved. Always check
>this first if you have problems (I leave this page in place, despite the
>encouragement to replace it) as Apache is quite fussy, and will refuse
>to run under some conditions. If it's not running, check
>/var/log/apache2/error.log for the reason.

Joe, I thank you for the explanation.  Because "localhost" did not
display the Apache2 Debian default page, I began by reinstalling
Apache, whereupon the page was displayed.

Next, I checked the local file with my alias declarations, and in it I
found an error.  Then I checked the configuration file in
"/etc/apache2/conf-available" which points to the local file.

After enabling the pointer file, "systemctl reload apache2" failed to
restart Apache.  But systemctl suggested I run "journalctl -xe", and
journalctl pinpointed the line number with the error.  I also looked
at "/var/log/apache2/error.log", but it was not as helpful.

I quickly found the remaining problem (a dot rather than a hyphen in a
file name), and now things are running right.  So at last I can return
to the tutorial.  Again, thanks.

RLH

Reply | Threaded
Open this post in threaded view
|

Re: apache 2.4 configuration

Joe Rowan
On Sat, 11 Apr 2020 07:34:20 +0000
"Russell L. Harris" <[hidden email]> wrote:

> On Mon, Apr 06, 2020 at 12:43:58PM +0100, Joe wrote:
> >Localhost is the machine running Apache. The normal IP address for it
> >is 127.0.0.1, though there are others. It isn't an Apache thing,
> >it's a networking thing. It's referred to in network configuration
> >as 'lo'.
> >
> >If you install Apache2.X on Debian, do nothing else at all, and enter
> >just 'localhost' in a web browser address window (running on the same
> >machine as Apache) then you will see the Apache 2 Debian Default
> >Page, at /var/www/html/index.html which basically shows that Apache
> >is running, and gives a few details about configuration.
> >
> >If you can see this page, or whatever you may have replaced it with,
> >then Apache is running, which is half the problem solved. Always
> >check this first if you have problems (I leave this page in place,
> >despite the encouragement to replace it) as Apache is quite fussy,
> >and will refuse to run under some conditions. If it's not running,
> >check /var/log/apache2/error.log for the reason.  
>
> Joe, I thank you for the explanation.  Because "localhost" did not
> display the Apache2 Debian default page, I began by reinstalling
> Apache, whereupon the page was displayed.
>
> Next, I checked the local file with my alias declarations, and in it I
> found an error.  Then I checked the configuration file in
> "/etc/apache2/conf-available" which points to the local file.
>
> After enabling the pointer file, "systemctl reload apache2" failed to
> restart Apache.  But systemctl suggested I run "journalctl -xe", and
> journalctl pinpointed the line number with the error.  I also looked
> at "/var/log/apache2/error.log", but it was not as helpful.
>
> I quickly found the remaining problem (a dot rather than a hyphen in a
> file name), and now things are running right.  So at last I can return
> to the tutorial.  Again, thanks.
>
> RLH
>

You're welcome.

--
Joe