Page 1 of 1

Virtualhost and https

Posted: 2020/08/25 07:43:01
by hack3rcon
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.

Re: Virtualhost and https

Posted: 2020/08/25 11:19:42
by BShT
apachectl configtest

Re: Virtualhost and https

Posted: 2020/08/25 11:39:20
by hack3rcon
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

Re: Virtualhost and https

Posted: 2020/08/26 12:11:10
by BShT
look at apache logs, i guess your certificates as you did not set it

Re: Virtualhost and https

Posted: 2020/08/26 12:19:06
by TrevorH
And it would seem that you're trying to load reqtimeout_module and headers_module twice so it refuses.

Re: Virtualhost and https

Posted: 2020/08/27 10:39:49
by hack3rcon
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"?

Re: Virtualhost and https

Posted: 2020/08/27 10:41:37
by hack3rcon
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!?