Virtualhost and https

Issues related to configuring your network
Post Reply
hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Virtualhost and https

Post by hack3rcon » 2020/08/25 07:43:01

Hello,
I want to create a HTTPS with Let’s Encrypt. https://www.tecmint.com/secure-apache-w ... -centos-8/
I created a wp.conf file under "/etc/httpd/conf.d/" and filled like below:

Code: Select all

<VirtualHost *:80>
ServerAdmin root@localhost
ServerAlias www.mymy.net
DocumentRoot /var/www/wordpress
<Directory "/var/www/wordpress">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/httpd/wordpress_error.log
CustomLog /var/log/httpd/wordpress_access.log common
</VirtualHost>

<VirtualHost *:443>
   SSLEngine On
    ServerName mymy.net
    ServerAlias www.mymy.net
    DocumentRoot /var/www/wordpress
<Directory "/var/www/wordpress">
      Options Indexes FollowSymLinks
      AllowOverride All
  </Directory>
  ErrorLog /var/log/httpd/wordpress_error.log
  CustomLog /var/log/httpd/wordpress_access.log combined
</VirtualHost>
When I restart Apache service then it show me an error:

Code: Select all

# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
And:

Code: Select all

# journalctl -xe
Aug 25 12:00:46 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:46 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:46 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:46 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:47 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:48 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:48 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:48 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:49 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:50 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Aug 25 12:00:50 localhost.localdomain kernel: FINAL_REJECT: IN=ens192 OUT= MAC=>
Which part of my file is wrong?

Thank you.

BShT
Posts: 278
Joined: 2019/10/09 12:31:40

Re: Virtualhost and https

Post by BShT » 2020/08/25 11:19:42

apachectl configtest

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: Virtualhost and https

Post by hack3rcon » 2020/08/25 11:39:20

BShT wrote:
2020/08/25 11:19:42
apachectl configtest

Code: Select all

# apachectl configtest
[Tue Aug 25 16:11:03.731449 2020] [so:warn] [pid 1247210:tid 139823896279360] AH01574: module reqtimeout_module is already loaded, skipping
[Tue Aug 25 16:11:03.731577 2020] [so:warn] [pid 1247210:tid 139823896279360] AH01574: module headers_module is already loaded, skipping
Syntax OK

BShT
Posts: 278
Joined: 2019/10/09 12:31:40

Re: Virtualhost and https

Post by BShT » 2020/08/26 12:11:10

look at apache logs, i guess your certificates as you did not set it

User avatar
TrevorH
Forum Moderator
Posts: 29493
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Virtualhost and https

Post by TrevorH » 2020/08/26 12:19:06

And it would seem that you're trying to load reqtimeout_module and headers_module twice so it refuses.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: Virtualhost and https

Post by hack3rcon » 2020/08/27 10:39:49

TrevorH wrote:
2020/08/26 12:19:06
And it would seem that you're trying to load reqtimeout_module and headers_module twice so it refuses.
How to check it? "httpd.conf"?

hack3rcon
Posts: 663
Joined: 2014/11/24 11:04:37

Re: Virtualhost and https

Post by hack3rcon » 2020/08/27 10:41:37

BShT wrote:
2020/08/26 12:11:10
look at apache logs, i guess your certificates as you did not set it
Without a certificates, I can't create "<VirtualHost *:443>" section? Maybe, someone like to create "<VirtualHost *:443>" section but forward it to http protocol!?

Post Reply

Return to “CentOS 8 - Networking Support”