Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Service `apache2' needs non existent service `net.*:8442'
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
TinoHd
n00b
n00b


Joined: 26 Jul 2021
Posts: 5

PostPosted: Mon Jul 26, 2021 11:13 am    Post subject: Service `apache2' needs non existent service `net.*:8442' Reply with quote

Hi there!

Due to firewall related things I'm running an apache2 service on Port 8442.
Where do I need to enter this to make these messages go away?

Thank you very much?

Tino
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon Jul 26, 2021 5:58 pm    Post subject: Reply with quote

How did you configure apache to listen on 8442?
The way i would do it is--if i wanted it to be a global config--i would edit
Code:

/etc/apache2/vhosts.d/00_default_vhost.conf   

like this
Code:

<IfDefine DEFAULT_VHOST>
Listen 8442
<VirtualHost *:8442>
       
        Include /etc/apache2/vhosts.d/default_vhost.include

        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>
</VirtualHost>
</IfDefine>



OR i would create anothe <some-other-vhost>.conf in the same directory just for the particular domain apache needs to serve on port 8442.
Is your
net.<my-iface>
properly configured and enabled?

Welcome to Gentoo!
_________________
:)
Back to top
View user's profile Send private message
TinoHd
n00b
n00b


Joined: 26 Jul 2021
Posts: 5

PostPosted: Tue Jul 27, 2021 9:22 am    Post subject: Reply with quote

Hi alamahant,

thanks for answering!

I created a dedicated "01_...8442.conf" for apache which goes like this (some parts xxx'ed out):
Code:
Listen 8442

<VirtualHost *:8442>
   ServerName xxx.xxx..xxxx

   DocumentRoot /home/xxxxx
   ErrorLog /var/log/apache2/ssl_error_log

   <IfModule log_config_module>
      TransferLog /var/log/apache2/ssl_access_log
   </IfModule>
        # Enable/Disable SSL for this virtual host.
        SSLEngine on
.....
<Directory /usr/share/webapps/xxxxxx/>
  DirectoryIndex index.php
  AllowOverride None
   Require all granted
 </Directory>

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Redirect /.well-known URLs
  RewriteRule ^/\.well-known/(.*)$ /xxxxxx/.well-known/$1 [NC,L]
  RewriteRule ^/xxxx/xxxx/(.*)$ /xxxx/xxxxx/$1 [NC,L]

  </IfModule>

</VirtualHost>


My "net.eth0" is a link to "net.lo", the way I learned it:
Code:
 ls -l /etc/init.d/net.eth0
lrwxrwxrwx 1 root root 6  3. Apr 2019  /etc/init.d/net.eth0 -> net.lo


Everything works fine, even after apache restart/HUP, just the message is annoying.

Thank you again!
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Tue Jul 27, 2021 9:32 am    Post subject: Reply with quote

Quote:

DocumentRoot /home/xxxxx

Have you included a <Directory /home/xxxx> definition also?
You might need it because this is not the default already defined "/var/www/localhost/htdocs"
I see
/usr/share/webapps/xxxxxx/
but not
<Directory /home/xxxx>
.
.
</Directory>
There is a userdir module 00_mod_userdir.conf but it defines
<Directory /home/*/public_html>
NOT
<Directory /home/xxxx>
_________________
:)
Back to top
View user's profile Send private message
TinoHd
n00b
n00b


Joined: 26 Jul 2021
Posts: 5

PostPosted: Tue Jul 27, 2021 9:40 am    Post subject: Reply with quote

There is an alias "redirecting" to /usr/share/webapps/xxxxxx/
Sorry for obfuscating that out.

I don't think the Directory helps with the net-thing but of course I added one and we'll see if it helps.

I keep U posted.

Thank you very much!
Back to top
View user's profile Send private message
hdcg
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2013
Posts: 120

PostPosted: Wed Jul 28, 2021 3:42 am    Post subject: Reply with quote

Hi TinoHD,

looking at the apache2 init script I see a check for non standard ports (anything except 80 and 443).

Code:

depend() {
        use dns entropy logger mysql netmount postgresql
        after sshd
        if ! echo ${rc_need} | grep -Fq "net." ; then
                local x warn_addr
                for x in $(virtualhosts 2>/dev/null | grep '^\(\[\|\*:\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do
                        case "${x}" in
                                \*:80|\*:443) ;;
                                *) warn_addr="${warn_addr} ${x}" ;;
                        esac
                done
                if [ -n "${warn_addr}" ] ; then
                        need net
                        ewarn "You are binding an interface in you virtual hosts."
                        ewarn "You must add rc_need=\"net.FOO\" to your ${RC_PREFIX%/}/etc/conf.d/apache2"
                        ewarn "where FOO is the interface(s) providing the following address(es):"
                        ewarn "${warn_addr}"
                fi
        fi
}


Did you receive this check's warning and add the mentioned rc_need line to /etc/conf.d/apache2 ?

Best Regards,
Holger
Back to top
View user's profile Send private message
TinoHd
n00b
n00b


Joined: 26 Jul 2021
Posts: 5

PostPosted: Wed Jul 28, 2021 6:53 am    Post subject: Reply with quote

Holger, thank you for your input.

2 things:
  1. I had to change from 8444 to 8442 a few weeks ago and with 8444 there were no complaints.
  2. I already added a line to /etc/conf.d/apache2:
    Code:
    rc_need="net.*:8442"
    What would the correct format?


Thanks,

Tino
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Jul 28, 2021 7:07 am    Post subject: Reply with quote

I modified my default_vhost to listen to 8442 like i suggested above and I get no warnings whatsoever when starting apache or accessing the site at
http://localhost:8442
I think this is a net problem for you or something else.
_________________
:)
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Wed Jul 28, 2021 8:50 am    Post subject: Reply with quote

TinoHd wrote:
Holger, thank you for your input.

2 things:
  1. I had to change from 8444 to 8442 a few weeks ago and with 8444 there were no complaints.
  2. I already added a line to /etc/conf.d/apache2:
    Code:
    rc_need="net.*:8442"
    What would the correct format?


Thanks,

Tino

Shouldn't it *just* be
Code:
rc_need=net.eth0
assuming it's net.eth0 that's providing connectivity for that host?
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 534
Location: France

PostPosted: Wed Jul 28, 2021 5:48 pm    Post subject: Reply with quote

Hi, not sure this would solve problem, but you may also try and change
Code:
Listen 80
line in your global apache config.

++
Gi)
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Jul 28, 2021 6:25 pm    Post subject: Reply with quote

Quote:

Hi, not sure this would solve problem, but you may also try and change
Code:
Listen 80
line in your global apache config.


There is no "Listen" directive in httpd.conf.
Just module definitions.
Mostly.......
I suppose you could add one if you really wanted,
Because the implementation seems to be totally vhost oriented.
Only
in
00_default_vhost.conf etc you can see Listen directives.
_________________
:)
Back to top
View user's profile Send private message
hdcg
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2013
Posts: 120

PostPosted: Wed Jul 28, 2021 7:20 pm    Post subject: Reply with quote

Hi TinoHd,

the rc_need line should only contain the network interface (e.g. net.eth0 as mentioned above). No port should be appended and * is not an interface name. This rc_need line is actually causing the warning in the subject.
However the apache init script should not complain at all, because the check is intended for statements like

Code:
Listen 192.0.2.5:8000


where apache should bind to a specific interface. I am wondering why changing port 8444 to 8442 triggers this check.

If you willing to investigate further you may invoke

Code:
/etc/init.d/apache2 virtualhosts


(like the script's check code) to see what virtualhosts apache sees in your config. May be this gives you a clue.

For my config (only using standard ports) it reports:
Code:

VirtualHost configuration:
*:80                   xxx.yyy.zzz (/etc/apache2/vhosts.d/00_default_vhost.conf:35)
*:443                  is a NameVirtualHost
         default server www.yyy.zzz (/etc/apache2/vhosts.d/00_default_ssl_vhost.conf:13)
         port 443 namevhost www.yyy.zzz (/etc/apache2/vhosts.d/00_default_ssl_vhost.conf:13)
                 alias yyy.zzz
         port 443 namevhost xxx.yyy.zzz (/etc/apache2/vhosts.d/01_login_ssl_vhost.conf:4)
ServerRoot: "/usr/lib64/apache2"
Main DocumentRoot: "/usr/htdocs"
Main ErrorLog: "/var/log/apache2/error_log"
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: dir="/run/apache_ssl_mutex" mechanism=fcntl
Mutex default: dir="/var/run/" mechanism=default
Mutex cache-socache: using_defaults
PidFile: "/run/apache2.pid"
Define: CACHE
Define: DAV
Define: DEFAULT_VHOST
Define: ERRORDOCS
Define: HTTP2
Define: INFO
Define: LANGUAGE
Define: MEM_CACHEx
Define: OPENIDC
Define: PHP
Define: PROXY
Define: SSL
Define: SSL_DEFAULT_VHOST
Define: STATUS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=81
Group: name="apache" id=81


Best Regards,
Holger
Back to top
View user's profile Send private message
TinoHd
n00b
n00b


Joined: 26 Jul 2021
Posts: 5

PostPosted: Tue Aug 03, 2021 9:49 am    Post subject: Reply with quote

Guys, somehow I missed the notification of your kind replies, I'm sorry.


hdcg wrote:
I am wondering why changing port 8444 to 8442 triggers this check.

That's what puzzle me, too.

However, I changed the line in /etc/conf.d/apache2 to
Code:
rc_need=net.eth0
as suggested by freke (Thank you!) and will see how it will go on.

Again, no clue why this wasn't necessary for Port 8444.

Thanks to everyone who contributed!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum