The error can be detected using apachectl configtest before an invalid configuration is loaded. It can also be found using the systemctl and journalctl commands. In the latter two cases, Apache will be unable to run because of the error. If you have detected the error using apachectl then skip to the Troubleshooting Using the Built in apachectl Command section of this tutorial. Otherwise, the next section will explain how to use systemctl to troubleshoot the error.
It is important to understand if the error affects the running process, or if it is preventing Apache from starting up. The -l flag will ensure that systemctl outputs the entire contents of a line, instead of substituting in ellipses … for long lines.
The --no-pager flag will output the entire log to your screen without invoking a tool like less that only shows a screen of content at a time. Since you are troubleshooting an AH Syntax error message, you should receive output that is similar to the following:. In this case, Apache is not running because of the syntax error. The correct directive should be SSLCertificateFile , so editing the file to fix the directive name in this example would resolve the error and allow Apache to start.
The systemctl output in this example also includes some lines from the systemd journal. If your output indicates a specific line in your configuration file is generating the syntax error, you can skip the journalctl and apachectl configtest troubleshooting steps. Instead, you can go directly to the file to inspect and edit the erroneous line to resolve the error. The following section explains how to use journalctl to troubleshoot an AH error. If your systemctl output does not include specifics about an AH syntax error, you can proceed with using the journalctl command to examine systemd logs for Apache.
If you have an AH error in your Apache configuration, look through the journalctl command output for lines like the following:. The first line of output is the AH error. Since this error is a general error related to an invalid setting or a typo in a configuration file, the next line explains what caused the error.
In this case it is a directive called SSLCertificateFile , which will only be valid if the ssl module is enabled. If you encounter an AH error that is related to an invalid SSLCertificateFile directive, you can resolve it by enabling the ssl module and then restarting Apache to make the error go away. Once the module is referenced by Apache and you restart it using the command that is appropriate to your Linux distribution, the server will start up if there are no more errors in the configuration.
However, if there are more errors, Apache and systemctl status will continue to report them and attempt to explain why the server cannot be started. When Apache will still not start because of errors, using the apachectl configtest command can be the most efficient and effective way to diagnose issues. The next section will explain how to use the utility to resolve an AH error that is again related to an invalid SSLCertificateFile directive. The apachectl configtest command is useful for catching syntax errors before reloading apache with a new configuration.
This test can help you to avoid service outages in the event of a misconfigured setting in your Apache files. The following example configuration test command will return an AH Syntax error message, and explains that the likely problem is that Apache is referencing an empty SSLCertificateFile :.
In this tutorial you learned how to troubleshoot an Apache AH syntax error. From there, you can determine whether Apache is running correctly, or if it is unable to start because of the error. You can also use the apachectl configtest command to check the configuration files for errors directly. However, any port conflict with another process can cause an AH error.
The issue is that only a single process can be bound to a port at any given time. If another web server like Nginx is configured to listen on port 80 and it is running, then Apache will not be able to claim the port for itself. To detect a port conflict with Apache, you will need to examine systemctl and journalctl output to determine the IP address and port that are causing the error.
Then you can decide how to resolve the issue, whether it is by switching web servers, changing the IP address that Apache uses, the port, or any combination of these options. If systemctl does not include output that describes the problem, then the last section of this tutorial, Troubleshooting Using journalctl Logs explains how to examine the systemd logs to find the conflicting port.
The output from systemctl status will in many cases contain all the diagnostic information that you need to resolve the error. It will include the IP address that Apache is using, as well as the port that it is attempting to bind to. The output will also indicate how long Apache has been unable to start so that you can determine how long the issue has been affecting Apache.
Note that your output may be slightly different if you are using an Ubuntu or Debian-derived distribution, where the name of the Apache process is not httpd but is apache2. This example systemctl output includes some highlighted lines from the systemd journal that describes the AH error. If your systemctl output does not give specific information about the IP address and port or ports that are causing the AH error, you will need to examine journalctl output from the systemd logs.
If your systemctl output does not include specifics about an AH error, you should proceed with using the journalctl command to examine systemd logs for Apache. If Apache is unable to bind to a port that is in use, search through the output for lines that are similar to the following log entries, specifically lines that contain the AH error code as highlighted in this example:. This output indicates two AH errors. The first of these explains that Apache cannot bind to the [::] address, which is port 80 on all available IPv6 interfaces.
The next line, with the address 0. Even though your own system may have different conflicting interfaces and ports, the errors will be similar to the output shown here. With output from journalctl you will be able to diagnose the issue using ss in the following section of this tutorial. To troubleshoot an AH error you need to determine what other process is listening on the IP address and port that Apache is attempting to use.
In the previous journalctl section, something was already bound to the IPv4 and IPv6 addresses on port The following command will determine the name of the process that is already bound to an IPv4 interface on port Ensure that you substitute the port from the error message if it is different from 80 in the following command:.
The first three fields are not important when troubleshooting an AH error so they can be ignored. The important fields are the fourth 0. If you have an AH error that is related to an IPv6 interface, repeat the ss invocation, this time using the -6 flag to restrict the interfaces to the IPv6 network stack like this:. Again, substitute the port number in question from your journalctl output if it is different from the highlighted 80 given here.
This process is preventing Apache from starting since it already owns the port. To determine the name of the program, use the ps utility like this, substituting the process ID from your output in place of the highlighted 40 value in this example:.
The highlighted nginx in the output is the name of the process that is listening on the interfaces. Now that you have the name of the program that is preventing Apache from starting, you can decide how to resolve the error.
You could stop the nginx process, reconfigure nginx to listen on a different interface and port, or reconfigure Apache to avoid the port collision. It is important to note that the process may be different from nginx and the port and IP addresses may not always be 0.
Oftentimes, different web servers and proxies will be in use on the same server. Each may be attempting to bind to different IPv4 ports and IPv6 interfaces to handle different web traffic. For example, a server that is configured with HAProxy listening on the IPv4 loopback address also referred to as localhost on port will show ss output like this:.
It is important to combine systemctl output, or journalctl output that indicates specific IP addresses and ports, with diagnostic data from ss , and then ps to narrow down the process that is causing Apache to fail to start. You learned how to use systemctl to examine the status of the Apache server and try to find error messages. If you run tomcat as a service, you might have to right click on the tomcat icon and open java tab and change java virtual machine path or just set "use default".
If you run into errors, please send the text output. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Tomcat - The system cannot find the file specified Ask Question.
Asked 9 years, 10 months ago. Active 6 years, 4 months ago. Viewed 22k times. Improve this question. Add a comment. Improve this question. Eric Leschinski k 87 87 gold badges silver badges bronze badges. Madde Madde 1 1 gold badge 7 7 silver badges 17 17 bronze badges. Usually skype uses the free ports 80 for incoming connections. Follow this tutorial on how to overcome this issue.
Simply disable it in skype. Follow this tutorial for mor info feelzdroid. I have the same issue, Just check my answer here; stackoverflow. Add a comment. Active Oldest Votes. Select 'Apache httpd. Improve this answer. AfromanJ AfromanJ 3, 3 3 gold badges 16 16 silver badges 32 32 bronze badges.
I don't have skype and port 80 is still tied up. Although this worked I would like to get it back to port Does anyone know what else could be using port 80? Find out which other service uses port Or disable iis. It has been known to use port 80 by default. Open up cmd and type "netstat -aon" without the quotes. This will list out all the servies with their pid. Find out the service the one using port 80 and list its pid.
Then open task manager, go to the services tab and kill the process with the corresponding pid. Must be a system process. Try disabling or uninstalling iis. Oh and edit the htaccess or the conf file to change the port.
Its in there as far as I know. Show 7 more comments. There are 2 ways to solving this problem. After that even it may not work. Then replace Listen 0.
Then follow this. Muhammad Ashikuzzaman Muhammad Ashikuzzaman 2, 5 5 gold badges 27 27 silver badges 49 49 bronze badges. In my case skype blocked the port 80 : Thank you for the hint — Tobias Oberrauch. Many thanks! I stopped Apache and the MySql server.
Then started Apache. Then started MySql. Then it worked!!!
0コメント