logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Okay until Let's Encrypt inst - router not allow 443
Author
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Tue 06 Dec '22 5:53    Post subject: Okay until Let's Encrypt inst - router not allow 443 Reply with quote

Hello,

I have installed apache in VirtualBox on ubuntu 20.04 and it has been working fine with a domain name delegated to my hone IP address. Can't complain here until..

decided I need to change it to https.

Create the certifivale and all went well until https would not resolve at the site like ti did before with http. I couldn't change it as it auto took http to https.

I tried to port fwd 443 to make it all work but found the router Netcomm NF18 MESH said 443 was used by it and it couldn't be changed.

By this time I'm in a mess and tried many things suggested at forums, ytutube and on web but nothing worked.

Now apache will not start and I'm in a mess.

Let's Encrypt let me download the pm for my certificate in case I needed it but the problem is I can't use 443.

I feel like deleting the whole shibang and starting again. New apache, new .conf files, htmls, everything.

Is that my best bet or is there a quicker way for me to get this back on the rails ?

Thank you in anticipation.

oz

This is the apache2 status..

root@zorin162-VirtualBox:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-12-06 20:22:24 AEDT; 11h ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 585 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 06 20:22:20 zorin162-VirtualBox systemd[1]: Starting The Apache HTTP Server...
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/mysitemc-ssl.conf:
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: <Directory> directive requires additional arguments
Dec 06 20:22:24 zorin162-VirtualBox apachectl[585]: Action 'start' failed.
Dec 06 20:22:24 zorin162-VirtualBox apachectl[585]: The Apache error log may have more information.
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: Failed to start The Apache HTTP Server.
root@zorin162-VirtualBox:~#
Back to top
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Tue 06 Dec '22 23:32    Post subject: Reply with quote

As an extra to the previous post this is the mysite-ssl.conf file where is says line 12 is a problem.

On my editor line 12 is the first <Directory>
Code:

<VirtualHost *:443>
ServerName <VirtualHost *:443>
ServerName mysitemc.com
ServerAlias www.mysitemc.com

</VirtualHost>

<VirtualHost *:80>

ServerAdmin web@sydney.com
DocumentRoot /var/www/mysitemc

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

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

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

Back to top
mraddi



Joined: 27 Jun 2016
Posts: 149
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Wed 07 Dec '22 7:06    Post subject: Reply with quote

There is something wrong with this line 12 - the directory is missing which the following configuration should be used for.
I guess there should be slash added
Code:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
Back to top
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Wed 07 Dec '22 7:18    Post subject: Reply with quote

Thank you. I'll give that a shot.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 07 Dec '22 11:05    Post subject: Reply with quote

You may check the syntax after changes

Code:

source /etc/apache2/envvars
/usr/sbin/apachectl -S


The envvars file is an ubuntu thing...
Back to top
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Wed 07 Dec '22 23:55    Post subject: Reply with quote

WoW ! Smile

This this the result..

Quote:
root@zorin162-VirtualBox:/etc/apache2/sites-available# source /etc/apache2/envvars
root@zorin162-VirtualBox:/etc/apache2/sites-available# /usr/sbin/apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443 is a NameVirtualHost
default server celeb.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
port 443 namevhost celeb.com (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
port 443 namevhost celeb.com (/etc/apache2/sites-enabled/celeb-ssl.conf:1)
alias www.celeb.com
port 443 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/default-ssl.conf:2)
*:80 is a NameVirtualHost
default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/celeb-ssl.conf:7)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/celeb.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/johnny.conf:1)
port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/ozst.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error-celeb.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
root@zorin162-VirtualBox:/etc/apache2/sites-available#
Back to top
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Thu 08 Dec '22 0:27    Post subject: Reply with quote

After the previous post I did a systemctl status apache2 and this was the result..

Below it I have the lines around 12 of the -ssl file

Quote:
root@zorin162-VirtualBox:/etc/apache2/sites-enabled# systemctl status apache2
* apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-12-07 17:03:11 AEDT; 16h ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 595 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 07 17:03:08 zorin162-VirtualBox systemd[1]: Starting The Apache HTTP Server...
Dec 07 17:03:11 zorin162-VirtualBox apachectl[613]: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/celebritymc-ssl.conf:
Dec 07 17:03:11 zorin162-VirtualBox apachectl[613]: <Directory> directive requires additional arguments
Dec 07 17:03:11 zorin162-VirtualBox apachectl[595]: Action 'start' failed.
Dec 07 17:03:11 zorin162-VirtualBox apachectl[595]: The Apache error log may have more information.
Dec 07 17:03:11 zorin162-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 07 17:03:11 zorin162-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 07 17:03:11 zorin162-VirtualBox systemd[1]: Failed to start The Apache HTTP Server.
Dec 07 17:10:18 zorin162-VirtualBox systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.
Dec 07 17:13:41 zorin162-VirtualBox systemd[1]: apache2.service: Unit cannot be reloaded because it is inactive.
root@zorin162-VirtualBox:/etc/apache2/sites-enabled#


---------------
Quote:

<VirtualHost *:443>
ServerName celeb.com
ServerAlias www.celeb.com

</VirtualHost>

<VirtualHost *:80>

ServerAdmin web@sydney.com
DocumentRoot /var/www/celebc

<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
Back to top
ozstar



Joined: 04 Dec 2022
Posts: 9
Location: Sydney Oz

PostPosted: Thu 08 Dec '22 5:27    Post subject: Reply with quote

Well with thanks at last, with lots of help from the web I guess message shows apache is working Smile

Now just have to work out why all the sites change from http to https and why it lands at the front door of the router instead of going through to the site. Maybe I should start a new thread for this?

Quote:
root@zorin162-VirtualBox:/etc/apache2/sites-available# systemctl status apache2
* apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-12-08 14:00:06 AEDT; 28s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 16767 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 16771 (apache2)
Tasks: 55 (limit: 10660)
Memory: 5.6M
CGroup: /system.slice/apache2.service
|-16771 /usr/sbin/apache2 -k start
|-16773 /usr/sbin/apache2 -k start
`-16774 /usr/sbin/apache2 -k start

Dec 08 14:00:06 zorin162-VirtualBox systemd[1]: Starting The Apache HTTP Server...
Dec 08 14:00:06 zorin162-VirtualBox apachectl[16770]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.>
Dec 08 14:00:06 zorin162-VirtualBox systemd[1]: Started The Apache HTTP Server.
Back to top


Reply to topic   Topic: Okay until Let's Encrypt inst - router not allow 443 View previous topic :: View next topic
Post new topic   Forum Index -> Apache