Re: Apache2 fails to listen on open port

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

 



Thanks for the info. However, I don’t believe any of the problems suggested in the wiki apply.

1. The output from both lsof and netstat -plant indicate no other process is using port 4443 either before or after apache2 is started

2. There does not seem to be conflicting Listen commands in the apache sites-available files.

3. The Listen in 000-default.conf is: Listen localhost:4443 ssl; and the Virtual Host entry is: <VirtualHost localhost:4443> ServerName coop.mountolive.com:4443 … localhost and coop.mountolive.com are both valid values as is port 4443.

4. I believe systemctl status apache2.service starts apache2 as root

5. SELinux is not active, i.e.,

semanage port -l|grep http
Command 'semanage' not found, but can be installed with:
sudo apt install policycoreutils-python-utils

I have attached output from the terminal commands that tests these hypotheses to this message, as it is fairly long and including it in the body of the message might make it hard to analyze.

By the way, the apache2 version is: Server version: Apache/2.4.29 (Ubuntu) Server built:   2022-06-23T12:51:37

On Dec 15, 2022, at 4:12 PM, Frank Gingras <thumbs@xxxxxxxxxx> wrote:



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


dnessett@Mount:~$ sudo lsof -i -P -n | grep LISTEN
[sudo] password for dnessett:
systemd-r  745 systemd-resolve   13u  IPv4  19057      0t0  TCP 127.0.0.53:53 (LISTEN)
cupsd      850            root    6u  IPv6  21927      0t0  TCP [::1]:631 (LISTEN)
cupsd      850            root    7u  IPv4  21928      0t0  TCP 127.0.0.1:631 (LISTEN)
vsftpd     964            root    3u  IPv6  23894      0t0  TCP *:21 (LISTEN)
sshd      1013            root    3u  IPv4  26012      0t0  TCP *:22 (LISTEN)
sshd      1013            root    4u  IPv6  26014      0t0  TCP *:22 (LISTEN)
mysqld    1544           mysql   17u  IPv6  30775      0t0  TCP *:3306 (LISTEN)
dnessett@Mount:~$ sudo systemctl start sslh
dnessett@Mount:~$ sudo lsof -i -P -n | grep LISTEN
systemd-r  745 systemd-resolve   13u  IPv4  19057      0t0  TCP 127.0.0.53:53 (LISTEN)
cupsd      850            root    6u  IPv6  21927      0t0  TCP [::1]:631 (LISTEN)
cupsd      850            root    7u  IPv4  21928      0t0  TCP 127.0.0.1:631 (LISTEN)
vsftpd     964            root    3u  IPv6  23894      0t0  TCP *:21 (LISTEN)
sshd      1013            root    3u  IPv4  26012      0t0  TCP *:22 (LISTEN)
sshd      1013            root    4u  IPv6  26014      0t0  TCP *:22 (LISTEN)
mysqld    1544           mysql   17u  IPv6  30775      0t0  TCP *:3306 (LISTEN)
sslh      1672            sslh    3u  IPv4  31557      0t0  TCP 98.127.182.220:443 (LISTEN)
sslh      1673            sslh    3u  IPv4  31557      0t0  TCP 98.127.182.220:443 (LISTEN)
dnessett@Mount:~$ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
dnessett@Mount:~$ netstat -plant
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -
tcp        0      0 98.127.182.220:443      0.0.0.0:*               LISTEN      -
tcp        0    396 192.168.1.27:22         192.168.1.106:51739     ESTABLISHED -
tcp        0      0 192.168.1.27:22         192.168.1.106:51741     ESTABLISHED -
tcp6       0      0 :::3306                 :::*                    LISTEN      -
tcp6       0      0 :::21                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:631                 :::*                    LISTEN      -
dnessett@Mount:~$ systemctl status apache2.service
â?? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled-runtime; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           â??â??apache2-systemd.conf
   Active: failed (Result: exit-code) since Thu 2022-12-15 16:58:49 MST; 1min 46s ago
  Process: 1680 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 15 16:58:49 Mount systemd[1]: Starting The Apache HTTP Server...
Dec 15 16:58:49 Mount apachectl[1680]: (98)Address already in use: AH00072: make_sock: could not bind to address 127.0.0.1:4443
Dec 15 16:58:49 Mount apachectl[1680]: no listening sockets available, shutting down
Dec 15 16:58:49 Mount apachectl[1680]: AH00015: Unable to open logs
Dec 15 16:58:49 Mount apachectl[1680]: Action 'start' failed.
Dec 15 16:58:49 Mount apachectl[1680]: The Apache error log may have more information.
Dec 15 16:58:49 Mount systemd[1]: apache2.service: Control process exited, code=exited status=1
Dec 15 16:58:49 Mount systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 15 16:58:49 Mount systemd[1]: Failed to start The Apache HTTP Server.
dnessett@Mount:~$ cd /lib/systemd/system/apache2.service.d
dnessett@Mount:/lib/systemd/system/apache2.service.d$ cd /etc/apache2
dnessett@Mount:/etc/apache2$ cd /etc/apache2/sites-available
dnessett@Mount:/etc/apache2/sites-available$ cat 000-default.conf
# Comment out the port 80 virtual host block

<IfDefine IgnoreBlockComment>
<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 /var/www/html

	# 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>
</IfDefine>

Listen localhost:4443 ssl;

# These defintions are in the main conf file

<IfDefine IgnoreBlockComment>
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
</IfDefine>

# Comment out the lampp phpadmin and htdocs Directory blocks

<IfDefine IgnoreBlockComment>
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

<Directory "/opt/lampp/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</IfDefine>

<VirtualHost localhost:4443>
        ServerName coop.mountolive.com:4443
        DocumentRoot /var/www/sites/coop-mountolive

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	SSLEngine on
	SSLCertificateFile /root/.acme.sh/*.mountolive.com/fullchain.cer
	SSLCertificateKeyFile /root/.acme.sh/*.mountolive.com/*.mountolive.com.key
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
dnessett@Mount:/etc/apache2/sites-available$

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux