How to determine which webserver is installed with no information? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
I’ve recently taken over a project after a developer caused issues with the client. However, due to the lack of documentation (laugh) I have no idea where the website files are stored or what webserver has been installed. Questions: In Linux, how can I see what webserver has been installed? In Linux, how can I find where the webserver points to in the file directory? (aware that this will depend on the answer from the first question) ** Hosted on Linode
Does the system show a net interface on an IP address? A brute forse approach might be to analyze the files the server shows on the net and to search it with «find . -iname filename». If you find a file you may individuate the path where are the site file and then search such a path (or part of it) into the files into the /etc directory. I think the webserver nay be Apache or Tomcat. Both servers have configuration file where’re all info needing to start the server.
An important first step will be to find out what Linux distribution is running on the server. The next steps may depend quite strongly on that detail. We may be able to give you some hints, but as it stands your question seems to broad to generate a concise and useful answer. For step-by-step debugging, a chat room/IRC might be more useful.
4 Answers 4
A basic approach would be to use netstat -tnlp with an additional grep on the browser ports that it is supposed to be serving. Typically, that would then be:
netstat -tnlp | grep 80 netstat -tnlp | grep 443
That should list the process PID and name that owns these ports. That should give you a clue which server it is. Then, locate the configuration files for that server application, e.g. /etc/httpd .
There is no such things as the webserver in linux. Several different servers exist that could do the job. The most common are probably Apache httpd and nginx.
In general you should start by finding out which it is, and then look at it’s configuration.
One option to find out which webserver is installed is using netstat to see what is listening to the ports commonly used for HTTP traffic, 80 (for unencryted) and 443 (for encrypted/HTTPS) are the most common. But if there is some proxy in front, any port might be used, in that case 8080 and 8443 are common choices.
Another option would be to utilise your distribution’s package system. The tools to use depend a lot on which distribution you have, on Debian it would be something like dpkg -l | grep -i web , it probably outputs several packages, but the relevant should be aming, and easy to pick from the descriptions.
In this specific case it might make sense to just see if the two common choices have configuration on the system. In most cases apache httpd will have it’s configuration in /etc/apache (possibly /etc/apache2 ), nginx often in /etc/nginx .
For apache httpd, the relevant setting will often be DocumentRoot , for nginx it’s most commonly root , but both can be configured to do almost anything (Apache httpd supports ModRewrite that is said to be Turing complete, making it theoretically capable of doing absolutely anything), so it can be a bit difficult to find what you need.
The 8 Best Open Source Web Servers
It’s been a long journey since the first web server was released back in 1991. For quite a long time, Apache was the only mention-worthy webserver. Over time, however, other open-source web servers have gained traction.
In this guide, we look at some of the best opensource web servers.
1. Apache HTTP Server
Apache HTTP Server, colloquially known as Apache or httpd in Red Hat distributions is a free and opensource web server developed by Apache Software Foundation under Apache License version 2. Released in 1995, Apache has grown in leaps and bounds to become one of the most popular and widely used web servers, powering over 37% of all the websites.
Apache is written in C language and is a highly customizable webserver thanks to its tons of modules that extend the web server’s functionality. These include mod_file_cache for caching, mod_ftp to provide FTP support for file uploads and downloads, and mod_ssl that allows support for SSL / TLS encryption protocols, and many more.
Additionally, given its rich set of modules, Apache provides multi-protocol support such as both IPv4 and IPv6 support and the commonly used HTTP, HTTP/2, and HTTPS protocols.
Apache also offers virtual hosting support that allows you to host multiple domains or websites. Be configuring virtual hosts, a single server can host multiple domains with ease and without any complexities. You can have example.com, example.edu, example.info and so on.
Learn how to install the Apache webserver on Linux distributions using the following guides.
2. Nginx Web Server
Pronounced as Engine-X, Nginx is an opensource high-performance robust web server which also double-ups as a load balancer, reverse proxy, IMAP/POP3 proxy server, and API gateway. Initially developed by Igor Sysoev in 2004, Nginx has grown in popularity to edge out rivals and become one of the most stable and reliable web servers.
Nginx draws its prominence from its low resource utilization, scalability, and high concurrency. In fact, when properly tweaked, Nginx can handle up to 500,000 requests per second with low CPU utilization. For this reason, it’s the most ideal web server for hosting high-traffic websites and beats Apache hands down.
Popular sites running on Nginx include LinkedIn, Adobe, Xerox, Facebook, and Twitter to mention a few.
Nginx is lean on configurations making it easy to make tweaks and Just like Apache, it supports multiple protocols, SSL/TLS support, basic HTTP authentication, virtual hosting, load balancing, and URL rewriting to mention a few. Currently, Nginx commands a market share of 31% of all the websites hosted.
Learn how to install the Nginx web server on Linux distributions using the following guides.
3. Lighttpd Web Server
Lighttpd is a free and opensource web server that is specifically designed for speed-critical applications. Unlike Apache and Nginx, it has a very small footprint (less than 1 MB) and is very economical with the server’s resources such as CPU utilization.
Distributed under the BSD license, Lighttpd runs natively on Linux/Unix systems but can also be installed in Microsoft Windows. It’s popular for its simplicity, easy set-up, performance, and module support.
Lighttpd’s architecture is optimized to handle a large volume of parallel connections which is crucial for high-performance web applications. The web server supports FastCGI, CGI, and SCGI for interfacing programs with the webserver. It also supports web applications written in a myriad of programming languages with special attention given to PHP, Python, Perl, and Ruby.
Other features include SSL/TLS support, HTTP compression using the mod_compress module, virtual hosting, and support for various modules.
Learn how to install the Lighttpd web server on Linux distributions using the following guides.
4. Apache Tomcat
Apache Tomcat is an opensource implementation of Java servlet engine, Java Expression Language and Java Server web pages. It comes across as an ideal option for developers who are building and deploying Java-based applications.
Strictly speaking, Tomcat is not your ordinary web server like Nginx or Apache. It’s a Java servlet that comes with extended functionality for interacting with Java servlets while at the same time implementing technical specifications such as JavaServer Pages (JSP), and Java Expression Language (Java EL).
What sets Tomcat apart from other web servers it that it’s geared specifically to serve Java-based content. It was originally developed to provide JSP functionality which lacked in the Apache HTTP server.
You can run Apache Tomcat alongside Apache HTTP server in a scenario where you are handling projects with both PHP and Java content. Apache HTTP server can handle static & dynamic content as Tomcat handles the JSP functionality.
On its own, however, Apache Tomcat is not a fully-fledged webserver and not as efficient as traditional web servers like Nginx and Apache.
Learn how to install the Apache Tomcat on Linux distributions using the following guides.
5. Caddy Web Server
Written in Go, Caddy is a fast and powerful multiplatform web server that can also act as a reverse proxy, load balancer, and API gateway. Everything is built-in with no dependencies and this aspect makes Caddy easy to install and use.
By default, Caddy supports HTTPS and easily takes care of SSL/TLS certificate renewals. Lack of dependencies increases its portability across various distributions without any conflict in the libraries.
It’s an ideal web server for running applications written in GO and offers full support for IPv6 and HTTP/2 to enable fast HTTP requests. It also supports virtual hosting, advanced WebSockets technology, URL rewrites, and redirects, caching and static file serving with compression, and markdown rendering.
Caddy has a very small market share and according to W3techs, it accounts for only 0.05% of the market share.
Learn how to install the Caddy web server on Linux distributions using the following guides.
6. OpenLiteSpeed Web Server
OpenLiteSpeed is an open-source web server designed for speed, simplicity, security, and optimization. It’s based on the LiteSpeed Enterprise Web server edition and provides all the essential features in the Enterprise edition.
OpenLiteSpeed web server rides on an event-driven, resource-friendly architecture and features a user-friendly WebAdmin GUI that helps you manage your domains/websites and monitor an array of metrics. It’s optimized to execute a wide spectrum of scripts such as Perl, Python, Ruby, and Java. OPenLiteSpeed supports both IPv4 and IPv6 with SSL/TLS support. IT provides support for TLS 1.0, 1.1, 1.2, and 1.3.
You also get to enjoy bandwidth throttling, intelligent-cache acceleration, HTTP request validation, and IP-based access control. Additionally, you will benefit from high-performance page caching, and the web server’s ability to handle thousands of concurrent connections.
Apart from acting as a web server, OpenLiteSpeed can serve a load balancer and reverse proxy. It’s free to download and is available under the GPLv3 license.
Learn how to install the OpenLiteSpeed web server on Linux distributions using the following guides.
7. Hiawatha Web Server
Written in C, Hiawatha is a lightweight and secure web server built for speed, security, and ease of use. It’s code and features are highly secure and can ward off XSS and SQL injection attacks. Hiawatha also allows you to monitor your server using a special monitoring tool.
It’s also easy to install and comes with ample documentation to guide you through and give you all the information that you need. Hiawatha comes recommended for embedded systems or old servers that have low specifications.
8. NodeJS
This might come as a shocker. Yes, NodeJS is primarily an opensource and cross-platform server-side runtime environment used for building web applications in Javascript. However, it’s also bundled with an http module that provides a set of classes and functions that extend its functionality and enables it to play the role of a web server.
Learn how to install the NodeJS on Linux distributions using the following guides.
Conclusion
While we have covered some of the best opensource web servers, the list is by no means cast in stone. If you feel we have left one a web server that should be featured in this list, give us a shout out.