[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I *think* I found the apache2 docs, but it's in .html and Icannot getfirefox to access it using "file:"+ /path/to/filedir



On Tue 21 Jun 2022, at 20:16, gene heskett <gheskett@shentel.net> wrote:
> On 6/21/22 14:09, Gareth Evans wrote:
>> On Tue 21 Jun 2022, at 18:06, gene heskett <gheskett@shentel.net> wrote:
>>> On 6/21/22 12:11, Andrew M.A. Cater wrote:
>>>> On Tue, Jun 21, 2022 at 11:55:56AM -0400, gene heskett wrote:
>>>>> Greetings all;
>>>>>
>>>>> So how am I supposed to read these installed docs?
>>>>>
>>>>> Thanks all.
>>>>>
>>>>> Cheers, Gene Heskett.
>>>>> -- 
>>>>> "There are four boxes to be used in defense of liberty:
>>>>>    soap, ballot, jury, and ammo. Please use in that order."
>>>>> -Ed Howdershelt (Author, 1940)
>>>>> If we desire respect for the law, we must first make the law respectable.
>>>>>    - Louis D. Brandeis
>>>>>
>>>> >From a web browser?
>>>>
>>>> file:///usr/share/doc/apache2-doc
>>>>
>>>> That's three slashes - file:// - two slashes - and then the filesystem path.
>>>>
>>>> Hope this helps, with every good wish, as ever,
>>>>
>>>> Andy Cater
>>> And that works, the third slash is new to me.
>>>
>>> So now the only thing I've changed from the default install is in
>>> /etc/apache2/envvars
>>> for usr and grp to be www-data. But now it won't restart.
>>> journalctl -xe reports:
>>> Jun 21 12:46:16 coyote apachectl[286443]: AH00526: Syntax error on line
>>> 63 of /etc/apache2/conf-enabled/security.conf:
>>> Jun 21 12:46:16 coyote apachectl[286443]: Invalid command 'Header', [...]
>> In my (unedited) version of that file:
>>
>> [...]
>> 61 # Requires mod_headers to be enabled.
>> 62 #
>> 63 #Header set X-Content-Type-Options: "nosniff"
>>
>> If line 63 is required un-commented, then
>>
>> $ sudo a2enmod headers
>> $ sudo systemctl restart apache2
>>
>> should do the trick.
> After I found it with locate/ /usr/sbin is not in su's $PATH
> That fixed the error, and I uncommented the stanza in apache2.conf
> that points to the directory I want the server to access, and
> localhost:port# displays the default startup page ok.
>
> dig "my-site-name" returns the proper ipv4 address.

>   I just used the address:6309 and it worked. So I edited the
> address bar to use the registered name:6309 and hit F5,
> a couple times, and that works.

Do you see a page titled "Apache2 Debian Default Page" with the Debian logo?

If so it's probably configured in

/etc/apache2/sites-available/000-default.conf

or 

/etc/apache2/sites-available/default-ssl.conf for https version

as Debian uses name-based virtual hosts with a config file structure which does not correspond to the Apache docs afaics, and I can't find any Debian docs on the subject.

https://httpd.apache.org/docs/2.4/configuring.html
https://httpd.apache.org/docs/2.4/vhosts/

000-default is already enabled (though the other for https may not be) if you're seeing the page I referred to above.

$ sudo a2ensite filename (without .conf)

is the command you would use to enable an "available" configuration (which creates a symlink in ../sites-enabled), but you may find it easier just to edit the existing 000-default.conf file.  You can create another (or iirc just extend it) if you want to add other (domain-)name-based sites in future.

* in the virtualhost tag as in "*:portNo" means "all domains", so these would need to be specified if >1.

This tutorial (amongst others I'm sure) explains the Debian approach:

https://vitux.com/debian-apache/

You may find that putting a suitable <VirtualHost> stanza around your directory stanza in apache2.conf works (eg. copy the relevant parts from 000-default), though I think you would at least need to disable 000-default if you do. For that:

$ sudo a2dissite 000-default

I think the most pain-free method is likely to be to edit or add to the files in 
/etc/apache2/sites-available/

Hope that helps.
Gareth


>
> So now I need a <Directory /path/to/dir> stanza in apache2.conf that works.
> This one doesn't:
> <Directory /opt/www/geneslinuxbox>
>      Options Indexes FollowSymLinks
>      AllowOverride None
>      Require all granted
> </Directory>
>
> Do I need to comment out the default page to expose mine?
> I have constructed that path, made a subdir for buster armhf
> stuff in it and placed an preempt-rt kernel file in it. 
> The intent
> is to let anybody download it. If the bots insist on wasting my
> upload bw, I may OTP passwd protect the subdirs, but that's a
> future option & howto question.
>
> Making progress, I think, Thanks Gareth.
>
> Take care & stay well.
>
> Cheers, Gene Heskett.
> -- 
> "There are four boxes to be used in defense of liberty:
>   soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author, 1940)
> If we desire respect for the law, we must first make the law respectable.
>   - Louis D. Brandeis


Reply to: