How to Troubleshoot Common Apache Issues on Linux Server?
May 10, · Check the Logs Before blindly trying to track down a problem, try to check the logs of your web server and any related components. These will usually be in /var/log in a subdirectory specific to the service. For instance, if you have an Apache server running on an Ubuntu server, by default the logs will be kept in /var/log/lovemedat.com: Justin Ellingwood. Sep 24, · Start with the application, and then gradually troubleshoot each lower layer until you’ve isolated the problem. With that background out of the way, let’s jump to the command line and start troubleshooting. Layer 1: The physical layer.
Your question has been posted! Share it with others to increase its visibility and to get it answered quickly. Get the latest tutorials on SysAdmin and open source topics. A question can only have one accepted answer. Are you sure you want to replace the current answer with this one? Hub for Good Supporting each other to make an impact.
Write for DigitalOcean You get paid, we donate to tech non-profits. I have been seeing this question quite a lot recently, so I decided to put together a few steps on what to do in case that your website is not loading. These answers are provided by our Community. If you find them useful, show some how to troubleshoot linux servers by clicking the heart.
If you run into issues leave a comment, or add your own answer to help others. You can type! I would recommend following these steps in case that you are having any problems with your Apache server and you are unsure about what the problem is:.
With the -f argument, you would see the output of the log in real team, so you could visit your website via your browser, and you would be able to see the errors populating the log if there are any. If you are using Ubuntu, the user should be www-dataso you would need to make sure that your files and folders are owned by that user, so Apache could read and write to those files:. If this is the case, you can follow the steps from this article here on how to configure your ufw :. That is pretty much it, with all of the above information you should be able to narrow down the problem.
Why give ownership of the directory to the user that apache process is running as? It really depends on the application itself. For example if you try to upgrade your WordPress core files, Apache will not be able to write to the wp-admin and wp-includes folders and the upgrade will fail, as when you hit the Upgrade button via your WordPress admin area, this triggers a process using the Apache user.
Of course, how to be an effective esl teacher you have a static website that does not expect any user input, you could do it as you mentioned. Do I need to downgrade to PHP how to troubleshoot linux servers. I use PHP 7. Hi there midowu. It sounds like that you already have another service listing on port 80, note that you can not have more than 1 service listening on one port.
That way will find which service exactly is listening on that port. Then you can stop it, for example, if it is Nginx listening on that port you can stop it with:. Note that if what happens when you run out of oil are already using Nginx for other services, you should move Nignx to another port for example rather than just stopping how to sketch fashion designs. I was able to restart apache, but my application stopped running.
I am unable to restart nginx. And some commands begin how to make gravestones for halloween fail.
In this case you need to choose which webserver you would like to you. I have hosted application on Digital Ocean. If you only stoped Nginx, all you would need to do is to stop apache and start Nginx again. You will not have to reconfigure it. If you have already been using Nginx, then there is no need to add apache unless you have a specific plan and reason on why you need both. Also, which one is preferable for Laravel and Mysql Project Deployment.
And also to be used as https. I think I mix up the initial configuration with both apache and Nginx. How do I now focus on Apache? If you already have configured some services on your existing Droplet and you do not want to affect them I would recommend spinning up a new Droplet for your Laravel project and following this tutorial on how to deploy Laravel with LEMP:. I had initially done this. I am not using Nginx but Apache2. So far I have setup Apache2 and I am seeing this:.
Thanks everything is resolved now. Hi midowu. You can follow the steps from this tutorial here on how to install and secure phpMyAdmin with Nginx:. I was logging in to make a backup and had to reset root password. When I did the server would not accept it. I clicked the console access and it is stuck in recovery mode with No kernel. I opened a ticket and it has been over 8 hours we are down I have a website it's the only site hosted on the droplet and sometimes about 1 time each month, but not on the same day the CPU usage goes through the roof.
I have absolutely no idea what's causing it, but in 1 minute the CPU usage goes from Hello there. Am new in Digital Ocean.
I need someone to copie my principal website to a new sub domain with a new database, new SFTP account. Can you please help me? Where would you like to share this to? Twitter Reddit Hacker News Facebook. Share link Question share link. Sign Up. Yes, I'm sure. You previously marked this answer as accepted.
Are you sure you want to unaccept it? DigitalOcean home. Community Control Panel. Hub for Good Supporting each other to make an impact Write for DigitalOcean You get paid, we donate to tech non-profits. Hacktoberfest Contribute to Open Source. Posted November 22, Add a comment. Subscribe Subscribed. Submit an Answer Submit an answer. Regards, Bobby. Everybody runs into issues with their website at one point or another.
This guide will help you troubleshoot some common issues and get your site running again. Reply Report. Spectrum7glr May 16, Hey there, It really depends on the application itself. The same goes for other functionality like uploading files or storing cache in WordPress.
This will also be true for other CMSs and some frameworks. MAit2 January 21, Hi MAit2Yes indeed, this could also be the case. Thank you for sharing this with the community. What do I do? Hi there midowuIt sounds like that you already have another service listing on port 80, note that you can not have more than 1 service listening on one port.
What you could do is: sudo netstat -plant grep 80 That way will find which service exactly is listening on that port. Then you can stop it, for example, if it is Nginx listening on that port you can stop it with: sudo systemctl stop nginx Then you can go ahead and start Apache as normal: sudo systemctl start apache2 Note that if you are already using Nginx for other services, you should move Nignx to another port for example rather than just stopping it.
Hope that this helps! When I stopped nginx using sudo systemctl stop nginx I was able to restart apache, but my application stopped running. And some commands begin to fail Also, when I ran some of the commands working before they failed. Hi there midowuIn this case you need to choose which webserver you would like to you. If your application already uses Nginx. Then stop Apache and start Nginx. Will Nginx work instead of Apache. Do it mean I will need re-configure the whole thing again?
Hello, If you only stoped Nginx, all you would need to do is to stop apache and start Nginx again. Hello, The rest of the changes really depend on your setup. But even if you need both, you should never configure them on the same port. In this guide, you'll install and configure a new Laravel application on an Ubuntu
Where would you like to share this to?
Use GRUB to fix Linux boot problems GRUB is a handy tool to help admins solve any Linux booting issues. Reinstalling or manually implementing GRUB are two main approaches to getting your system back up and running. Log in to your UpCloud control panel, browse to the Server Listing and open your server’s details by clicking on its description. In the Server General Settings tab, there is a section on the right name CPU and Memory Settings. Mar 21, · In this post, we will use the Apache server for several reasons: Stable. Flexible. Secure. We’ll install and configure Apache server on Linux, but at first, let’s review some of the basics of HTTP protocol basics. Understanding HTTP. When you request a file or a page from a web server, the client at first connects to the server on port Reviews:
DNS resolution is an important service, without it functioning properly domain names will not be correctly resolved to IP addresses preventing other network services from working correctly. Therefore it is equally important to know how to troubleshoot DNS issues on a Linux client and fix any problems to reduce disruption.
There are multiple potential points of failure during the DNS lookup process such as at the system performing the lookup, at the DNS cache , or on an external DNS server. Here we will cover how to check these and perform various tests to identify where exactly the problem lies.
Studying for your RHCE certification? Essentially this means that host name resolution will be performed in the order specified, left to right. First files will be checked, followed by DNS. This file takes priority over any DNS resolution, any changes to the file will be placed straight into the DNS cache of that local server. As this entry is in our host file locally, if we try to reach google.
This is demonstrated below by trying to ping google. Other secondary and tertiary DNS servers can also be specified here as backups. For DNS resolution to succeed to A port scanner such as the nmap tool can be used to confirm if the DNS server is available on port 53 as shown below. We can clearly see that TCP 53 is definitely open and responding which is a good sign, if the state was reported as filtered the next thing to investigate would be the connectivity to the DNS server, in particular any firewall running on the DNS server would need to be configured to allow TCP and UDP port 53 traffic in.
By running a packet capture we can view any DNS queries over the network, in this example we are running tcpdump to our local DNS server at We are again querying for google. Response codes can help you in the troubleshooting process, for a full list of them refer to RFC With dig we can also directly query the authoritative name servers for a domain, these are the DNS servers that hold the authoritative records for the domains DNS zone — the source of truth.
If a correct response is received from the authoritative DNS server but not when querying against your own DNS server then you should investigate why your local DNS server is not able to resolve the record. As shown google. In the below example we have run our query against ns1.
If we run this same dig command again, the second TTL that was returned in the answer section will continually state that the TTL is seconds as the response is authoritative. However if we were to run this dig without specifying ns1. This can be confirmed by running the dig command again, as the TTL value will drop down until it reaches 0 and is removed from the cache completely.
By querying the authoritative name server directly we ensure that we are getting the most up to date response rather than a potential old cached response from our own local DNS server or local DNS cache.
As DNS is an important service being able to troubleshoot it is a useful skill. DNS queries can be checked with the dig command, either against the local DNS server or against the authoritative name server for the domain which will provide an up to date non cached result.
Website URL. Notify me of follow-up comments by email. Notify me of new posts by email. Email Address. RootUsers Guides, tutorials, reviews and news for System Administrators. Test Authoritive DNS Server With dig we can also directly query the authoritative name servers for a domain, these are the DNS servers that hold the authoritative records for the domains DNS zone — the source of truth.
COM As shown google. COM google. Summary As DNS is an important service being able to troubleshoot it is a useful skill. Leave a comment? Incognito May 30, at am. Facebook Follow me on twitter. Subscribe Receive new post notifications by email for free! Unsubscribe any time.