How to disable directory indexing from apache2 when going to the server’s root?

Edit your apache2 configuration file which normally is on the dir: “/etc/apache2/httpd.conf”. Add the following or edit if your already have some configurations for the default web server dir (/var/www): <Directory /var/www> Options -Indexes AllowOverride All Order allow,deny Allow from all </Directory> This will disable the indexing to all the public directories.

Is it possible to use port 80 for both HTTP and web socket traffic?

YES, by using node.js. Express or connect for the HTTP file serving and socket.io for the WebSocket stuff. Example: var express = require(“express”); var app = express.createServer(); app.get(“https://stackoverflow.com/”, function(req, res){ res.redirect(“/index.html”); }); app.configure(function(){ app.use(express.static(__dirname + ‘/public’)); }); app.listen(80); var io = require(‘socket.io’); var socket = io.listen(app); socket.on(‘connection’, function(client){ client.on(‘message’, function(){…}); })

Redirect to other domain but keep typed domain

It is possible to get it done via mod_rewrite but make sure mod_proxy is enabled in your Apache’s httpd.conf. Once that is done enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.be$ [NC] RewriteRule ^ http://www.mydomain.nl%{REQUEST_URI} [L,NE,P] … Read more

Apache rewrite based on subdomain

You should have a look at the URL Rewriting Guide from the apache documentation. The following is untested, but it should to the trick: RewriteCond %{HTTP_HOST} ^([^.]+)\.blah\.domain\.com$ RewriteRule ^/(.*)$ http://blah.domain.com/%1/$1 [L,R] This only works if the subdomain contains no dots. Otherwise, you’d have to alter the Regexp in RewriteCond to match any character which should … Read more

Apache + Node.js + mod_proxy. How to route one domain to :3000 and another to :80

Just make two <VirtualHost *:80> tags <VirtualHost *:80> ServerAdmin [email protected] ServerName www.node-example.com ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> <Location /> ProxyPass http://localhost:3000/ ProxyPassReverse http://localhost:3000/ </Location> </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName node-example.com ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> <Location /> ProxyPass http://localhost:80/ ProxyPassReverse http://localhost:80/ </Location> </VirtualHost> It … Read more

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