172

Try SimpleHTTPServer: python -m SimpleHTTPServer # or the Python 3 equivalent python3 -m http.server It should will serve whatever's in the CWD (e.g. index.html) at http://0.0.0.0:8000.


47

There is a Big list of http static server one-liners: To get on this list, a solution must: serve static files using your current directory (or a specified directory) as the server root be able to be run with a single, one line command (dependencies are fine if they're a one-time thing) serve basic file types (html, css, js, images) with ...


45

Use node.js , fast and lightweight. Or just use simple nc netcat command to start a quick webserver on a port and serve the content of a file including the server response headers. Reference from Wikipedia: http://en.wikipedia.org/wiki/Netcat#Setting_up_a_one-shot_webserver_on_port_8080_to_present_the_content_of_a_file { echo -ne "HTTP/1.0 200 OK\r\n\...


37

man unzip: -q perform operations quietly (-qq = even quieter). Ordinarily unzip prints the names of the files it's extracting or testing, the extraction methods, any file or zipfile comments that may be stored in the archive, and possibly a summary when finished with each archive. The -q[q] options ...


33

Yes, nweb. Can be found here: nweb.c (previously at ibm.com) To compile nweb.c: gcc -O -DLINUX nweb.c -o nweb


31

Since version 5.4.0 PHP also has a built-in web server: php -S localhost:8000 You can Specify the web server's documents directory with -t, for example: php -S localhost:8000 -t /var/lib/www If you want to be able to access the server over the network then: php -S 0.0.0.0:8000 -t /var/lib/www


28

Most people run their httpd (Apache, Nginx, etc) through an init system. That's almost certainly the case if you've installed from a package. Almost all of these init systems have a method work working out if it's running. In my case I'm using nginx which ships a SysV-style init script and that accepts a status argument, like so: $ /etc/init.d/nginx status ...


25

You can use the services command universally on most Linux distros. $ service <service> status Example $ service httpd status httpd (pid 23569) is running... This same command can be used for all services that are running on an individual basis or to find all the services' status. $ service --status-all python is stopped automount (pid 22457) is ...


19

Download the netinstall iso, boot it and select non-graphical install. I actually made a video once for it: http://www.youtube.com/watch?v=JOGSupJury4 The difference between ubuntu and debian is the way they are doing package testing. Debian is all about stability and ubuntu is more about all the new things (less stability).


18

This may be more heavy weight than you're looking for, but you might consider using fail2ban (https://www.fail2ban.org). That's a tool that can monitor your log files and automatically ban addresses that generate logs that match a set of customizable patterns.


16

I had the same problem, fixed it by: giving tomcat user ownership of the whole tomcat directory: cd /opt && sudo chown -R tomcat tomcat/ and commenting out below line in /etc/systemd/system/tomcat.service: Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'


15

Node has a simple, fast, light HTTP server module. To install: sudo npm install http-server -g (Assuming you have node and npm already installed.) To run it, using the current directory as the website root: http-server This creates a server on http://0.0.0.0:8080/.


15

Any local user can read the definition of any systemd system unit through the DBus interface (for example using systemctl show), unless you have a custom DBus policy in place to prevent this. Making the unit file not world-readable thus makes no sense and systemd will print a warning if applicable. Similarly, it will also warn if the unit file is marked ...


14

(to summarise my comments on the OP) The three-way handshake that they are refering to is part of the TCP connection establishment, the option in question doesn't relate specifically to this. Also note that data exchange is not part of the three way handshake, this just creates the TCP connection in the open/established state. Regarding the existance ...


14

If you can not find the log file or the log file is empty you can run the apache configuration test that will print out any problems with configuration files: apachectl configtest


14

Nginx does not have the right to read the users files. And it's a very bad idea to put all your users files available on the Web. A better idea is to only serve a dedicated directory in users home directory. To serve the www folder in each user folder when accessing /<USER>, use the following location: location ~ ^/(.+?)(/.*)?$ { alias /home/$1/...


13

The basic answer is that yes, you need to do more. You need to close the hole that allowed the attacker in in the first place. In addition, you need to remove any back doors, etc. the attacker added once he/she was in. By far the most reliable way to remove the back doors is to wipe the system and restore from backup (making sure it's a backup from before ...


11

ntop is probably your best solution for doing this. It is designed to run long term and capture exactly what youre looking for. It can show you what remote destinations are being used the most, how much traffic sent to/from, what protocols and ports were being used etc. It can do the same for the source hosts if you run it on a router so you can see the same ...


11

cat /tmp/file: ERROR 1 1234 ERROR 2 1234 ERROR 3 1234 ERROR 4 1234 ERROR 4 1234 ERROR 3 1234 ERROR 2 1234 ERROR 5 1234 ERROR 1 1234 ERROR 4 1234 ERROR 1 1234 ERROR 1 1234 ERROR 1 1234 ERROR 3 1234 ERROR 2 1234 ERROR 1 1234 ERROR 4 1234 ERROR 1 1234 ERROR 4 1234 ERROR 1 1234 ERROR 2 1234 grep "ERROR" /tmp/file | sort | uniq -c | sort -r: 8 ERROR 1 1234 ...


10

You have to deselect desktop environment from software selection during the install in order to get a non-GUI Debian install.


9

If you have root, you could just use tcpdump and grab everything. You can then pull it up in Wireshark and analyze to your heart's content. $ sudo tcpdump -i <interface> -w mycapture.tcpdump ... and then hit ctrl-c when you've had enough. Run in a screen session if you need to detatch, etc. By default, it'll only capture the first part of each ...


9

I always run services with a dedicated user. So I would create these users: nginx mongo apache mysql redis You should never run the actual services as root! Often when installing these applications using your distributions package manager, as part of the installation, a user will be automatically created for each of these services. I typically use CentOS/...


9

You can see where httpd is configured to look for it's configuration files using the -V switch: $ httpd -V Server version: Apache/2.2.15 (Unix) Server built: Feb 13 2012 22:31:42 Server's Module Magic Number: 20051115:24 Server loaded: APR 1.3.9, APR-Util 1.3.9 Compiled using: APR 1.3.9, APR-Util 1.3.9 Architecture: 64-bit Server MPM: Prefork ...


9

Your goal is to completely separate your "regular" web files from your phpMyAdmin installation. It should be stressed that each server configuration in Nginx can (and should) have only one webroot. That being said, these are your options: Install phpMyAdmin in a directory under your webroot, which in your case is /var/www/phpmyadmin. It can be accessed ...


9

Okay, I noticed that this post is viewed quite often recently and so it seems that a lot of people are facing the same issue that I did. If so then this might help you. I have followed a simple step-by-step tutorial to create a SSL-certification for my webserver. Like so many tutorials out there the outcome of the tutorial I followed was a self-signed ...


8

If you want a machine for local development (a desktop machine), and you want to learn a lot - then go with Arch. It will kind of force you to learn about some under-the-hood things about GNU/Linux because you have to assemble everything from command line, so be prepared, quite a lot of reading will be required although it's not actually that hard as people ...


8

Assuming this isn't a typo, the install section in your typo service file contains a typo. It should be, multi-user.target instead of mulit-user.target (mulit vs. multi), e.g: [Install] WantedBy=multi-user.target


8

This is a big topic, but I'll try to keep it short. You could try DevStack, which will get you up and running with less configuration work. If you want to really understand the inner workings of the platform, and since you have the hardware, I would go ahead and install it from scratch on your distro of choice (CentOS and Fedora are fully supported ...


8

Although POSIX has a standard for capabilities which I think includes CAP_NET_BIND_SERVICE, these are not required for conformance and may in some ways be incompatible with the implementation on, e.g., linux. Since webservers like apache are not written for only one platform, using root privileges is the most portable method. I suppose it could do this ...


8

Two options (both carried out as root): First If you're happy to have me be a member of the www-data group: Add the user me to the www-data group: # usermod -a -G www-data me Set the SetGID flag on the invoices directory: # chmod g+s /<path>/<to>/invoices Now, any files created in the invoices directory will have their group set to www-...


Only top voted, non community-wiki answers of a minimum length are eligible