Re: [users@httpd] NameVirtualHost fails
I've tried several variations but basically the error message is that the certificate and the key for example2.com <http://example2.com/> don't match. I thought I had set up the certificate with the proper keys so something must be screwed up with the certificate. I'm working on that. Jack > On 2 Jul 2022, at 1:21, Frank Gingras wrote: > > What does the error log say, exactly? Note that TLS failures can be almost > silent in the logs, so if a single vhost causes the startup error, then check > the certificate. > > On Fri, 1 Jul 2022 at 17:24, jnil...@jala.com <mailto:jnil...@jala.com> > mailto:jnil...@jala.com>> wrote: > Here's an example version of my vhosts.conf file: > > # http redirect > > ServerName central.com <http://central.com/> > ServerAlias www.example1.com <http://www.example1.com/> *.example1.com > <http://example1.com/> > Redirect / https://www.example1.com/ <https://www.example1.com/> > ErrorLog /var/log/apache2/example1.com <http://example1.com/>-error80_log > CustomLog /var/log/apache2/example1.com <http://example1.com/>-access80_log > combined > > > > ServerName example2.com <http://example2.com/> > ServerAlias www.example2.com <http://www.example2.com/> *.example2.com > <http://example2.com/> > Redirect / https://www.example2.com/ <https://www.example2.com/> > ErrorLog /var/log/apache2/example2.com <http://example2.com/>-error80_log > CustomLog /var/log/apache2/example2.com <http://example2.com/>-access80_log > combined > > > # https version > > ServerAdmin webmas...@central.com <mailto:webmas...@central.com> > ServerName example1.com <http://example1.com/> > ServerAlias www.example1.com <http://www.example1.com/> *.example1.com > <http://example1.com/> > DocumentRoot "/home/data/hqwww/htdocs" > SSLEngine on > SSLProtocol all -SSLv2 > SSLCertificateFile /etc/apache2/ssl.crt/example.crt > SSLCertificateKeyFile /etc/apache2/ssl.key/www.example1.com.key > <http://www.example1.com.key/> > SSLCertificateChainFile /etc/apache2/ssl.crt/example1.ca > <http://example1.ca/>-bundle > RewriteEngine On > RewriteOptions Inherit > > > > AllowOverride None > Options FollowSymlinks > Require all granted > > > > AccessFileName .htaccess > > ErrorLog /var/log/apache2/example1.com <http://example1.com/>-error_log > CustomLog /var/log/apache2/example1.com <http://example1.com/>-access_log > combined > > > Include /etc/apache2/conf.d/*.conf > > > > > ServerAdmin webmas...@central.com <mailto:webmas...@central.com> > ServerName example2.com <http://example2.com/> > ServerAlias www.example2.com <http://www.example2.com/> *.example2.com > <http://example2.com/> > DocumentRoot "/home/data/jmnwww/htdocs" > SSLEngine on > SSLProtocol all -SSLv2 > SSLCertificateFile /etc/apache2/ssl.crt/example2.crt > SSLCertificateKeyFile /etc/apache2/ssl.key/www.example2.com.key > <http://www.example2.com.key/> > SSLCertificateChainFile /etc/apache2/ssl.crt/example2.ca > <http://example2.ca/>-bundle > RewriteEngine On > RewriteOptions Inherit > > > ## To make the site work with pretty permalinks use the next 2 uncommented > lines. > ## Otherwise use 'Options None' and 'AllowOverride None' > AllowOverride all > Options FollowSymlinks > Require all granted > > > AccessFileName .htaccess > > ErrorLog /var/log/apache2/example2.com <http://example2.com/>-error_log > CustomLog /var/log/apache2/example2.com <http://example2.com/>-access_log > combined > > Include /etc/apache2/conf.d/*.conf > > > If I drop the second host (example2), leaving just example1 it works; with > both hosts apache crashes on restart. Here is the failure message output for > that case. > > systemctl status apache2.service > ● apache2.service - The Apache Webserver > Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor > preset: disabled) > Active: failed (Result: exit-code) since Fri 2022-07-01 14:12:39 PDT; > 6min ago > Process: 29193 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND > -k start (code=exited, status=1/> >Main PID: 29193 (code=exited, status=1/FAILURE) > Status: "Reading configuration..." > > Jul 01 14:12:39 donner systemd[1]: Starting The Apache Webserver... > Jul 01 14:12:39 donner start_apache2[29193]: AH00548: NameVirtualHost has no > effect and will be removed in t> > Jul 01 14:12:39 do
Re: [users@httpd] NameVirtualHost fails
Here's an example version of my vhosts.conf file: # http redirect ServerName central.com ServerAlias www.example1.com *.example1.com Redirect / https://www.example1.com/ ErrorLog /var/log/apache2/example1.com-error80_log CustomLog /var/log/apache2/example1.com-access80_log combined ServerName example2.com ServerAlias www.example2.com *.example2.com Redirect / https://www.example2.com/ ErrorLog /var/log/apache2/example2.com-error80_log CustomLog /var/log/apache2/example2.com-access80_log combined # https version ServerAdmin webmas...@central.com ServerName example1.com ServerAlias www.example1.com *.example1.com DocumentRoot "/home/data/hqwww/htdocs" SSLEngine on SSLProtocol all -SSLv2 SSLCertificateFile /etc/apache2/ssl.crt/example.crt SSLCertificateKeyFile /etc/apache2/ssl.key/www.example1.com.key SSLCertificateChainFile /etc/apache2/ssl.crt/example1.ca-bundle RewriteEngine On RewriteOptions Inherit AllowOverride None Options FollowSymlinks Require all granted AccessFileName .htaccess ErrorLog /var/log/apache2/example1.com-error_log CustomLog /var/log/apache2/example1.com-access_log combined Include /etc/apache2/conf.d/*.conf ServerAdmin webmas...@central.com ServerName example2.com ServerAlias www.example2.com *.example2.com DocumentRoot "/home/data/jmnwww/htdocs" SSLEngine on SSLProtocol all -SSLv2 SSLCertificateFile /etc/apache2/ssl.crt/example2.crt SSLCertificateKeyFile /etc/apache2/ssl.key/www.example2.com.key SSLCertificateChainFile /etc/apache2/ssl.crt/example2.ca-bundle RewriteEngine On RewriteOptions Inherit ## To make the site work with pretty permalinks use the next 2 uncommented lines. ## Otherwise use 'Options None' and 'AllowOverride None' AllowOverride all Options FollowSymlinks Require all granted AccessFileName .htaccess ErrorLog /var/log/apache2/example2.com-error_log CustomLog /var/log/apache2/example2.com-access_log combined Include /etc/apache2/conf.d/*.conf If I drop the second host (example2), leaving just example1 it works; with both hosts apache crashes on restart. Here is the failure message output for that case. systemctl status apache2.service ● apache2.service - The Apache Webserver Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-07-01 14:12:39 PDT; 6min ago Process: 29193 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/> Main PID: 29193 (code=exited, status=1/FAILURE) Status: "Reading configuration..." Jul 01 14:12:39 donner systemd[1]: Starting The Apache Webserver... Jul 01 14:12:39 donner start_apache2[29193]: AH00548: NameVirtualHost has no effect and will be removed in t> Jul 01 14:12:39 donner systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE Jul 01 14:12:39 donner systemd[1]: apache2.service: Failed with result 'exit-code'. Jul 01 14:12:39 donner systemd[1]: Failed to start The Apache Webserver. > On 30 Jun 2022, at 16:24, Frank Gingras wrote: > > That is one assumption, sure. Best to have the user run apachectl -S to > confirm. For all we know, they could have defined invalid vhosts. > > On Thu, 30 Jun 2022 at 16:54, <mailto:free...@videotron.eu>> wrote: > You are missing something called virtual hosts. You are allowed one host but > you can have many virtual hosts. Secondly, you should be using Leap 15.4, it > sounds like you are out of date, sorry to say. > > > > If you go to your httpd.conf file then you will notice that there is a > enable virtual hosts #include virtual hosts.conf httpd-vhosts.conf so > uncomment it remove the # > > > > De : jnil...@jala.com <mailto:jnil...@jala.com> <mailto:jnil...@jala.com>> > Envoyé : jeudi 30 juin 2022 16:28 > À : users@httpd.apache.org <mailto:users@httpd.apache.org> > Objet : [users@httpd] NameVirtualHost fails > > > > I'm using SUSE Leap 15.3 and apache2. I'm trying to get SSL to work on two > hosts with the same IP address. My vhosts.config is set for the two hosts but > only one actually runs. When I run systemctl status apache2.service I get a > message that NameVirtualHost has no effect and will be removed. So the > configuration only works if I have just one host. > > > > What key detail am I missing in the network configuration? > > > > Thanks, > > > > Jack Nilles > > >
[users@httpd] NameVirtualHost fails
I'm using SUSE Leap 15.3 and apache2. I'm trying to get SSL to work on two hosts with the same IP address. My vhosts.config is set for the two hosts but only one actually runs. When I run systemctl status apache2.service I get a message that NameVirtualHost has no effect and will be removed. So the configuration only works if I have just one host. What key detail am I missing in the network configuration? Thanks, Jack Nilles
Re: [users@httpd] Mystifying start failure
That solved it! Apache has successfully started. Thanks Yehuda and Frank! > On 30 May 2022, at 8:51, Yehuda Katz wrote: > > Then something is probably wrong with the contents of one of your SSL > certificates. Make sure they are formatted correctly. > Check if any virtualhost has a separate error log. > > - Y > > On Mon, May 30, 2022 at 11:03 AM jnil...@jala.com <mailto:jnil...@jala.com> > mailto:jnil...@jala.com>> wrote: > The tail end of /var/log/apache2/error_log gives: > > [Fri May 27 00:02:10.914649 2022] [ssl:warn] [pid 1562] AH01873: Init: > Session Cache is not configured [hint: SSLSessionCache] > [Fri May 27 00:02:10.939405 2022] [:emerg] [pid 1562] AH00020: Configuration > Failed, exiting > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > AH00016: Configuration Failed > > There's nothing for May 30. I have updated ssl certificates recently. > > JMN > >> On 30 May 2022, at 7:01, Yehuda Katz > <mailto:yeh...@ymkatz.net>> wrote: >> >> systemd doesn't know to look in the HTTPD log file. What does that log say? >> Likely located in /var/log/apache2/ >> >> - Y >> >> On Mon, May 30, 2022 at 9:58 AM jnil...@jala.com <mailto:jnil...@jala.com> >> mailto:jnil...@jala.com>> wrote: >> I recently rebooted the server and started apache only to get a failure. >> Here's the diagnosis; I'm not sure what to make of it. >> >> systemctl status apache2.service >> ● apache2.service - The Apache Webserver >> Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; >> vendor preset: disabled) >> Active: failed (Result: exit-code) since Mon 2022-05-30 06:53:28 PDT; >> 23s ago >> Process: 23499 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND >> -k start (code=exited, status=1/> >>Main PID: 23499 (code=exited, status=1/FAILURE) >> Status: "Reading configuration..." >> >> May 30 06:53:28 server systemd[1]: Starting The Apache Webserver... >> May 30 06:53:28 server systemd[1]: apache2.service: Main process exited, >> code=exited, status=1/FAILURE >> May 30 06:53:28 server systemd[1]: apache2.service: Failed with result >> 'exit-code'. >> May 30 06:53:28 server systemd[1]: Failed to start The Apache Webserver. >
Re: [users@httpd] Mystifying start failure
Yep! One of the virtual hosts has a private key/certificate mismatch. I'll try shutting it down temporarily to see if that fixes the apache2 start problem. > On 30 May 2022, at 8:51, Yehuda Katz wrote: > > Then something is probably wrong with the contents of one of your SSL > certificates. Make sure they are formatted correctly. > Check if any virtualhost has a separate error log. > > - Y > - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Mystifying start failure
The tail end of /var/log/apache2/error_log gives: [Fri May 27 00:02:10.914649 2022] [ssl:warn] [pid 1562] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache] [Fri May 27 00:02:10.939405 2022] [:emerg] [pid 1562] AH00020: Configuration Failed, exiting AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed AH00016: Configuration Failed There's nothing for May 30. I have updated ssl certificates recently. JMN > On 30 May 2022, at 7:01, Yehuda Katz wrote: > > systemd doesn't know to look in the HTTPD log file. What does that log say? > Likely located in /var/log/apache2/ > > - Y > > On Mon, May 30, 2022 at 9:58 AM jnil...@jala.com <mailto:jnil...@jala.com> > mailto:jnil...@jala.com>> wrote: > I recently rebooted the server and started apache only to get a failure. > Here's the diagnosis; I'm not sure what to make of it. > > systemctl status apache2.service > ● apache2.service - The Apache Webserver > Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor > preset: disabled) > Active: failed (Result: exit-code) since Mon 2022-05-30 06:53:28 PDT; > 23s ago > Process: 23499 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND > -k start (code=exited, status=1/> >Main PID: 23499 (code=exited, status=1/FAILURE) > Status: "Reading configuration..." > > May 30 06:53:28 server systemd[1]: Starting The Apache Webserver... > May 30 06:53:28 server systemd[1]: apache2.service: Main process exited, > code=exited, status=1/FAILURE > May 30 06:53:28 server systemd[1]: apache2.service: Failed with result > 'exit-code'. > May 30 06:53:28 server systemd[1]: Failed to start The Apache Webserver.
[users@httpd] Mystifying start failure
I recently rebooted the server and started apache only to get a failure. Here's the diagnosis; I'm not sure what to make of it. systemctl status apache2.service ● apache2.service - The Apache Webserver Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2022-05-30 06:53:28 PDT; 23s ago Process: 23499 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/> Main PID: 23499 (code=exited, status=1/FAILURE) Status: "Reading configuration..." May 30 06:53:28 server systemd[1]: Starting The Apache Webserver... May 30 06:53:28 server systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE May 30 06:53:28 server systemd[1]: apache2.service: Failed with result 'exit-code'. May 30 06:53:28 server systemd[1]: Failed to start The Apache Webserver.