What is the difference between the ‘sites-enabled’ and ‘sites-available’ directory? [closed]

The difference is that virtual sites listed in the sites-enabled directory are served by Apache. In the sites-available directory there are the virtual sites that exist on your server, but people can’t access them because they are not enabled yet. sites-available: this directory has configuration files for Apache 2 Virtual Hosts. Virtual Hosts allow Apache 2 to … Read more

Minimal web server using netcat

Try this: while true ; do nc -l -p 1500 -c ‘echo -e “HTTP/1.1 200 OK\n\n $(date)”‘; done The -cmakes netcat execute the given command in a shell, so you can use echo. If you don’t need echo, use -e. For further information on this, try man nc. Note, that when using echo there is … Read more

nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size

This is most likely happening because of the long domain name. You can fix this by adding server_names_hash_bucket_size 64; at the top of your http block (probably located in /etc/nginx/nginx.conf). I quote from the nginx documentation what to do when this error appears: In this case, the directive value should be increased to the next … Read more

Tomcat VS Jetty [closed]

I love Jetty for its low maintenance cost. It’s just unpack and it’s ready to roll. Tomcat is a bit high maintenance, requires more configuration and it’s heavier. Besides, Jetty’s continuations are very cool. EDIT: In 2013, there are reports that Tomcat has gotten easier. See comments. I haven’t verified that.

When to use Tornado, when to use Twisted / Cyclone / GEvent / other [closed]

“Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design”. If you are building something that is similar to a e-commerce site, then you should probably go with Django. It will get your work done quick. You dont have to worry about too many technology choices. It provides everything thing … Read more

Have nginx access_log and error_log log to STDOUT and STDERR of master process

Edit: it seems nginx now supports error_log stderr; as mentioned in Anon’s answer. You can send the logs to /dev/stdout. In nginx.conf: daemon off; error_log /dev/stdout info; http { access_log /dev/stdout; … } edit: May need to run ln -sf /proc/self/fd /dev/ if using running certain docker containers, then use /dev/fd/1 or /dev/fd/2

Best lightweight web server (only static content) for Windows [closed]

You can use Python as a quick way to host static content. On Windows, there are many options for running Python, I’ve personally used CygWin and ActivePython. To use Python as a simple HTTP server just change your working directory to the folder with your static content and type python -m SimpleHTTPServer 8000, everything in … Read more

How to automatically redirect HTTP to HTTPS on Apache servers?

I have actually followed this example and it worked for me 🙂 NameVirtualHost *:80 <VirtualHost *:80> ServerName mysite.example.com Redirect permanent / https://mysite.example.com/ </VirtualHost> <VirtualHost _default_:443> ServerName mysite.example.com DocumentRoot /usr/local/apache2/htdocs SSLEngine On # etc… </VirtualHost> Then do: /etc/init.d/httpd restart

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)