Posts Tagged ‘apache’

How to remove the NameVirtualHost *:80 has no VirtualHosts warning

Monday, February 17th, 2014

I had a debian squeeze webserver showing me this strange warning at statrup

root@web:/etc/apache2# /etc/init.d/apache2 restart
Restarting web server: apache2[Mon Feb 17 10:27:43 2014] [warn] NameVirtualHost *:443 has no VirtualHosts
[Mon Feb 17 10:27:43 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
 … waiting [Mon Feb 17 10:27:44 2014] [warn] NameVirtualHost *:443 has no VirtualHosts
[Mon Feb 17 10:27:44 2014] [warn] NameVirtualHost *:80 has no VirtualHosts

This was due to a duplicated couple of lines in configuration.

NameVirtualHost *:80
NameVirtualHost *:443

in the /etc/apache2/port.conf and in /etc/apache2/conf.d/virtual.conf too. Commenting out the last file I removed the warning.

URL redirection at freeshell.de

Monday, November 22nd, 2010

This blog is hosted by freeshell.de – Nic Nac Project server. Great! 🙂

Since the same page of this server can be reached by several URL, I decided to add a little trick for redirecting my blog visitor to the same address. This may be useful to help web spiders in indexing my pages.

For this reason if  You try to reach

http://www.freeshell.de/~jose
http://nic-nac-project.de/~jose
or any other equivalent URL, Your browser will be redirected to
http://www.nic-nac-project.de/~jose/

Since my blog is a WordPress one, a .htaccess file has been made by my software configuration. I set up the redirection by adding two lines to the .htaccess file created by WordPress in my public_html directory:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~jose/
RewriteCond %{HTTP_HOST}    !^www\.nic-nac-project\.de [NC]
RewriteRule ^(.*)$    http://www.nic-nac-project.de/~jose/$1 [L,R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~jose/index.php [L]
</IfModule>