Apache2 Problems after updating OSX to High Sierra - apache

For the week I have had major issues with Apache. My development environment on my mac stopped working after I updated to High Sierra. I tried for hours fixing this myself but couldn't find a solution.
Server version: Apache/2.4.29 (Unix)
Basically what is happening, whenever I try to restart apache I get this message:
AH00558: httpd: Could not reliably determine the server's fully
qualified domain name, using 10.0.0.50. Set the 'ServerName' directive
globally to suppress this message
I have tried a ton of different ways of configuring my vhosts file as well as my httpd config but have seen no improvement.
The document root path was not pointed where my website existed before. After finding that out and pointing it at the correct location the "It Works!" message I was getting every-time disappeared and now I am only greeted with a message that says
Not Found
The requested URL / was not found on this server.
This message happens no matter what path I put for the DocumentRoot section so I'm not sure what the real problem is.
Also, I have my apache set up to use localhost, however it continues to use 10.0.0.50 as it's IP of choice. I have never seen this IP before and I am confused on where it came from.
TLDR: I am having tons of problems with apache after updating to High Sierra, have tried to uninstall/reinstall. Apache is using 10.0.0.50 as the IP, DocumentRoot seems to have problems, config seems to be messed up.

Check configuration:
httpd -t
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.79. Set the 'ServerName' directive globally to suppress this message
Syntax OK
To fix that:
sudo vi /etc/apache2/httpd.conf
Before:
ServerName www.example.com:80
After:
ServerName localhost
Check configuration again:
httpd -t
Syntax OK

Related

Error installing and starting Apache Web Server using Gzip Compression

I tried to install the Apache 2.4 web server on my local machine and I got the error below.
**
Errors reported here must be corrected before the service can be started.
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using fe80::7908:85c9:d022:6dbc. Set the 'ServerName' directive globally to suppress this message**
I ran the command httpd.exe -k install to install the Apache and httpd.exe -k start to start the server and see if I could bypass error.
You need to set a Server Name in the httpd.conf :
List item C:\Apache24\conf\httpd.conf or /usr/local/apache2/conf/httpd.conf with notepad or any other text editor.
Search for this line in config file #ServerName www.example.com:80
Uncomment this line by removing # from the first of line and edit to ServerName 127.0.0.1
Save the file, exit and try restarting the server
Source : Could not reliably determine the server's fully qualified domain name
So, I came across a doc online that fixed the error.
All that was needed to find the line with #ServerName www.example.com:80 in C:\Apache24\conf\httpd.conf, uncomment it, and maybe replace the URL with 127.0.0.1 or as it suits.
Link to the document:
https://monovm.com/blog/apache-could-not-determine-the-server-qualified-domain-name/

Apache 2 - AH02311: Fatal error initialising mod_ssl

I'm trying to set up a Godaddy SSL certificate on a DigitalOcean droplet running Ubuntu with Apache 2. After I've configured the certificates correctly (to the best I can see & according to the following articles:
https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-16-04#step-2-configure-apache-to-use-ssl
https://www.digicert.com/ssl-certificate-installation-ubuntu-server-with-apache2.htm
https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04
I cannot run Apache and I'm getting the following error:
AH02311: Fatal error initialising mod_ssl
I've also seen this error:
SSL Library Error: error:0B080074:x509 certificate routine
both of these are in the error.log file.
Looks like private key is not matching certificate check on that (Not sure as i do not see full console logs). I hope the cert order is correct it should be
SSLCertificateFile /etc/apache2/ssl/certificate.crt
SSLCertificateKeyFile /etc/apache2/ssl/private.key
SSLCACertificateFile /etc/apache2/ssl/intermediate.crt
Usually this is an apache.conf configuration error or any other configuration file. do this:
purge ApacheUninstall/Purge Apache
reload modules
reboot server
do apachectl configtest
sudo systemctl restart apache2.service
sudo systemctl status apache2.service
That should fix the problem.
I was able to reproduce this exact error condition by simply enabling SSL under apache (by uncommenting the line in httpd.conf that loads mod_ssl and mod_socache_shmcb.so). The default httpd-ssl.conf file contains example lines of configuration with dummy values. Specifically there is a virtual host block at the bottom of this file that is provided as a template. It contains uncommented lines with dummy values. Apache won't accept these values as they are.
To test this, uncomment the above modules in httpd.conf open a console window, go to the apache\bin folder (the apache folder will have the appropriate version appended like apache2.37)
and type
httpd -t
And apache will validate your .conf files and report fatal errors. The first one you will see will report that it is unable to find server.crt. If you fill in the entire section with the values for the website that you are trying to secure apache should stop throwing these errors.
for more detail when troubleshooting use
httpd -e warn
or
httpd -e debug
To set up a secure virtual host for a site example.com you need two blocks.
One insecure block, and one insecure block. The insecure block uses port 80 or whatever port you choose if 80 is in use elsewhere. This is usually set up in the httpd-vhosts.conf file. The secure block is copy of the insecure block with the added commands for configuring SSL and uses port 443. This block is usually placed in httpd-ssl.conf Https-ssl.conf is automatically included in httpd.conf which is the master configuration file. It contains a conditional clause which detects the mod_ssl module and loads httpd-ssl.conf if the module is loaded. This is why the error occurs as soon as mod_ssl is enabled.
I was also having the same problem.
While checking, I found it was due to wrong passphrase in pass.out file.
It was solved after correcting that, so I suggest you to check that as well.

Apache localhost already used?! Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName"

I have a problem, I had apache Solr installed and it uses localhost for access on webserver...
now I have installed Apache and startet httpd.exe and I get the warning / error:
Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName"
when I stop solr, I can start and use localhost for apache httpd...
but I want to have the possibility to use both webservices, how can I configure Apache to do that? and get access to service not with localhost, but with another domain name or some configuration in httpd.conf
I tried to change the line "ServerName www.example.com:80" in httpd.conf file but no effect,
sorry but I'm pretty new to webservers and Apache, how should I configure that?
You have several things mixed here:
Installing Solr should in no way be related to other questions, unless it is configured to run on port 80. If that is the case, you simply can not run two services on the same port so you have to pick, or just move Solr to 8080 or whatever.
Could not reliably determine... is just a friendly warning and will not prevent any functionality, and it should disappear when you add ServerName www.example.com:80 in httpd.conf
With default settings, Apache will respond to any http request that comes to port 80, so you don't have to configure anything there (and if you want to modify that, use VirtualHost). You can achieve reaching your webserver by other hostnames by editing hosts file on your machine. If you want others to be able to do that, you have to configure DNS (which is separate issue)

I am not able to Start Apache on XAMPP on my system windows 7 32 bit

I am not able to run/start Apache through XAMPP on my system windows 7 32 bit. The problem is after installing everything is working okay but Apache is not running or starting.
Getting the following error message:-
Initializing Control Panel Windows Version: Windows 7 Ultimate 32-bit
Initializing module...
Checking for module existence...
Checking for required tools...
Checking for service (name="Apache2.4"): Service installed
error message : Apache Service detected with wrong path
Change XAMPP Apache and Control Panel settings or
Uninstall/disable the other service manually first
Found Path: "C:\Apache24\bin\httpd.exe" -k runservice
Expected Path: "c:\xampp\apache\bin\httpd.exe" -k
Checking default ports...
Executing "net start "Apache2.4""
Return code: 0
I think my system is missing Port 80 which is used by Apache server to run - even I checked it on my system but there is no such port 80 on my system.
How to resolve this issue?
Terminate/exit the programs like skype and other programs that are using the port 80 then start the appache server hope this will start the server. Once appache server start then you can start the skype or other programs. Or even you can change the port of appache server. You can follow this link for changing the server port.
How to change XAMPP apache server port?
Hop this will help you.
port 80 is a virtual port. It is being used by some other Program. Try executing netsh on command prompt.
The most common issue is skype. Refer this question to resolve it.
Apache Service detected with wrong path Change XAMPP Apache and Control Panel settings or Uninstall/disable the other service manually first Found Path: "C:\Apache24\bin\httpd.exe" -k runservice Expected Path: "c:\xampp\apache\bin\httpd.exe" -k
Your answer is on error message. The installed apache loaction is not inside the xampp folder. Try to reinstall or change the configuration.
I've encountered this issue on my Windows 10 environment. I've found that I've configured C:\xampp\apache\conf\extra\httpd-xampp.conf with a new SSLCertificateFile or SSLCertificateKeyFile in one of my virtual hosts that was not existing.
So in my httpd-xampp.conf I have the following:
## mywebsite.local config
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mywebsite.local"
ServerName mywebsite.local
ServerAlias *.mywebsite.local
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/mywebsite.local"
ServerName mywebsite.local
ServerAlias *.mywebsite.local
## these lines are for my local SSL, here is the issue
SSLEngine on
SSLCertificateFile "crt/mywebsite.local/server.crt" ## this path may not exist
SSLCertificateKeyFile "crt/mywebsite.local/server.key" ## or even this line may not exist
</VirtualHost>
I've found that the path from SSLCertificateFile and SSLCertificateKeyFile doesn't exist.
I've fixed it and not it's working.
All the best!
I had the exact same issue on my system, Windows 10 64bit. I realized that I had edited the httpd.conf file in accordance with a security course I was taking and it rendered my configuration erroneous.
My fix was to uninstall XAMPP from the XAMPP uninstaller located in the XAMPP folder to completely erase all associated files as well as registry files! This was important because I had to do this once before but the uninstaller did not function properly for some reason.
Anyways, completely uninstalling it and reinstalling it leaving all the default settings made it work again. I know how it sounds... delete and re-install, but it finally got my server running, so it might serve as a solution for you and anyone who finds this post. Image of the Apache and my SQL server running without throwing errors.
Also, I found this out recently:
If you are learning to use XAMPP through a website like stackskills, the modules may not alert you to common issues. For example, if you need to change a directory, from C:/XAMPP/Apache to C:/Hacking Software/XAMPP/Apache, (notice the space and lack of underscore in the first part of the directory "HackingSoftware", XAMPP will read the first "space" as the end of an argument, and so you need to have the entire directory written in quotes like this: "C:/Hacking Software/XAMPP/Apache" or write it with underscores C:/Hacking_Software/XAMPP/Apache.
This syntax also applies to the use of the "Alias" command. See this link for more info: http://httpd.apache.org/docs/2.4/mod/core.html#directory.
Use this as a resource for other issues: http://httpd.apache.org/docs/2.4/mod/directives.html

ssl_error_rx_record_too_long and Apache SSL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long
They're getting this error on all browsers, all platforms. I can't reproduce the problem at all.
My server and myself are located in the USA, the customer is located in India.
I googled on the problem, and the main source seems to be that the SSL port is speaking in HTTP. I checked my server, and this is not happening. I tried the solution mentioned here, but the customer has stated it did not fix the issue.
Can anyone tell me how I can fix this, or how I can reproduce this???
THE SOLUTION
Turns out the customer had a misconfigured local proxy!
The link mentioned by Subimage was right on the money for me. It suggested changing the virtual host tag, ie, from <VirtualHost myserver.example.com:443> to <VirtualHost _default_:443>
Error code: ssl_error_rx_record_too_long
This usually means the implementation of SSL on your server is not correct. The error is usually caused by a server side problem which the server administrator will need to investigate.
Below are some things we recommend trying.
Ensure that port 443 is open and enabled on your server. This is the standard port for https communications.
If SSL is using a non-standard port then FireFox 3 can sometimes give this error. Ensure SSL is running on port 443.
If using Apache2 check that you are using port 443 for SSL. This can be done by setting the ports.conf file as follows
Listen 80
Listen 443 https
Make sure you do not have more than one SSL certificate sharing the same IP. Please ensure that all SSL certificates utilise their own dedicated IP.
If using Apache2 check your vhost config. Some users have reported changing <VirtualHost> to _default_ resolved the error.
That fixed my problem. It's rare that I google an error message and get the first hit with the right answer! :-)
In addition to the above, these are some other solutions that other folks have found were causing the issue:
Make sure that your SSL certificate is not expired
Try to specify the Cipher:
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM:+SSLv3
The solution for me was that default-ssl was not enabled in apache 2.... just putting SSLEngine On
I had to execute a2ensite default-ssl and everything worked.
In my case I had to change the <VirtualHost *> back to <VirtualHost *:80> (which is the default on Ubuntu). Otherwise, the port 443 wasn't using SSL and was sending plain HTML back to the browser.
You can check whether this is your case quite easily: just connect to your server http://www.example.com:443. If you see plain HTML, your Apache is not using SSL on port 443 at all, most probably due to a VirtualHost misconfiguration.
Cheers!
In my case I had forgot to set SSLEngine On in the configuration. Like so,
<VirtualHost _default_:443>
SSLEngine On
...
</VirtualHost>
http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslengine
If you have the error after setup a new https vhost and the config seems to be right, remember to link in sites-enabled too.
Old question, but first result in Google for me, so here's what I had to do.
Ubuntu 12.04 Desktop with Apache installed
All the configuration and mod_ssl was installed when I installed Apache, but it just wasn't linked in the right spots yet. Note: all paths below are relative to /etc/apache2/
mod_ssl is stored in ./mods-available, and the SSL site configuration is in ./sites-available, you just have to link these to their correct places in ./mods-enabled and ./sites-enabled
cd /etc/apache2
cd ./mods-enabled
sudo ln -s ../mods-available/ssl.* ./
cd ../sites-enabled
sudo ln -s ../sites-available/default-ssl ./
Restart Apache and it should work. I was trying to access https://localhost, so your results may vary for external access, but this worked for me.
Ask the user for the exact URL they're using in their browser. If they're entering https://your.site:80, they may receive the ssl_error_rx_record_too_long error.
In my case, I had the wrong IP Address in the virtual host file. The listen was 443, and the stanza was <VirtualHost 192.168.0.1:443> but the server did not have the 192.168.0.1 address!
My problem was due to a LOW MTU over a VPN connection.
netsh interface ipv4 show inter
Idx Met MTU State Name
--- --- ----- ----------- -------------------
1 4275 4294967295 connected Loopback Pseudo-Interface 1
10 4250 **1300** connected Wireless Network Connection
31 25 1400 connected Remote Access to XYZ Network
Fix:
netsh interface ipv4 set interface "Wireless Network Connection" mtu=1400
It may be an issue over a non-VPN connection also...
You might also try fixing the hosts file.
Keep the vhost file with the fully qualified domain and add the hostname in the hosts file /etc/hosts (debian)
ip.ip.ip.ip name name.domain.com
After restarting apache2, the error should be gone.
Please see this link.
I looked in all my apache log files until I found the actual error (I had changed the <VirtualHost> from _default_ to my fqdn). When I fixed this error, everything worked fine.
I had a messed up virtual host config. Remember you need one virtual host without SSL for port 80, and another one with SSL for port 443. You cannot have both in one virtual host, as the webmin-generated config tried to do.
In my case the problem was that https was unable to start correctly because Listen 443 was in "IfDefine SSL" derective, but my apache didnt start with -DSSL option. The fix was to change my apachectl script in:
$HTTPD -k $ARGV
to:
$HTTPD -k $ARGV -DSSL
Hope that helps somebody.
I had the same problem in some browser to access to my SSL site.
I have found that I had to give to fireFox the right proxy (FireFox was accessing directly to internet).
Depending of the lan configuration (Tunneling, filtering, proxy redirection), the "direct access to internet" mode for FireFox throws this error.
For me the solution was that my ddclient was not cronning properly...