Archive for the ‘ISPConfig 2’ Category

If all your visitors shall access your website with a URL like www.domain.com and not without www, use the following apache rewrite rule for redirecting them.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}$1 [L,R]

The apache rewrite rule can be added in a .htaccess file in the website root directory or if you use ISPConfig 2 or 3, you can also add the rwrite rule into the apache directives field of the website.

How to redirect an HTTP connection to HTTPS in apache webserver

Tuesday, October 6, 2009 posted by Till

Http connections can be redirected to https with the apache mod_rewrite module, which should be available in every apache installation. Create a file with the name .htaccess in the website root directory which contains the following lines:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

If you use ISPConfig 2 or 3, you can add these lines also in the apache directives field of  the website settings form instead of adding them to a .htaccess file. But the approach with the .htaccess file will work on ISPConfig as well.

How to add a root SSL certificate in ISPConfig 2

Wednesday, September 23, 2009 posted by Till

Most SSL authorities (like godaddy or instantssl) send you a root certificate which has to be installed beside the SSL certificate to proove that the SSL cert is signed from a trusted authority. To add such a root SSL certificate in ISPConfig, copy the file to the ssl subfolder of the website and then add this line into the apache directives field of the website in ISPConfig:

SSLCACertificateFile /var/www/www.yourdomain.tld/ssl/ca.txt

The path to the root certificate file has to be changed to match the path on your system.

The language of the generated webslizer statistics is statically compiled into the webalizer binary. To change the language, webalizer has to be recompiled. In the following example, I will recompile webalizer to change the language to german.

Uninstall webalizer and install the GD library:

apt-get remove webalizer
apt-get install libgd2-xpm-dev

Download the latest webalizer sources and uncompress the tar archive:

cd /tmp
wget http://archive.mgm51.com/mirrors/webalizer-files/webalizer-2.01-10-src.tgz
tar xzf webalizer-2.01-10-src.tgz
cd webalizer-2.01-10

Reconfigure and compile webalizer

./configure –with-language=german
make
make install

Create a symlink so that other applications find the webalizer binary in the common place

ln -s /usr/local/bin/webalizer /usr/bin/webalizer

Cleanup

rm -f /tmp/webalizer-2.01-10-src.tgz
rm -rf /tmp/webalizer-2.01-10

Thanks to planet_fox for this FAQ.

How to access a namebased website without a DNS record

Monday, August 31, 2009 posted by admin

If you want to access a namebased website that you created e.g. in ISPConfig before the DNS records are setup, edit the hosts file on your workstation computer and add a line like this:

192.168.0.100        www.mydomain.com

Replace the IP address with the IP of your server and www.mydomain.com with the domain name of the website.

The hosts file on linux and MAC systems is /etc/hosts, on Windows systems the hosts file is C:\Windows\system32\drivers\etc\hosts

The above trick also works if you want to run a website in your internal network (intranet) without having a DNS server availalble for local dns resolving.

ISPConfig 2: External mailserver setting does not work

Friday, August 21, 2009 posted by admin

Problem: I have set the website to external mailserver in ISPConfig but emails get still delivered to the local server.

Solution: Set all co-domains of this website to external mailserver too. You find the external mailserver setting on the options tab of every co-domain.

Postfix: “queue file write error”

Friday, August 21, 2009 posted by admin

If you get an error like:

Aug 21 12:41:03 webb4 postfix/sendmail[11234]: fatal: web1_user(12967): queue file write error

in your mail log, then the vale for message_size_limit in postfix main.cf is too low. Edit postfix main.cf:

vi /etc/postfix/main.cf

and set the message size limit to a higher value. E.g.

mesage_size_limit = 900000000

and restart postfix:

/etc/init.d/postfix restart

If there is no message_size_limit set in main.cf, just add the line.

If you run a joomla or wordpress installation with mod_php, the following settings in the vhost configuration file or the “Apache directives” field in ISPConfig can be used to set stricter securitypolicys. This helps limit the impact of a possible hack to this websiteand protect the other sites on the server.

php_admin_value disable_functions “show_source system shell_exec passthru exec phpinfo popen proc_open”
php_admin_flag allow_url_fopen Off
php_admin_value session.save_path “/var/www/webXXX/phptmp/”
php_admin_value open_basedir “/var/www/webXXX/:/tmp”

Explanation

disable_functions disables functions that have a potential security impact e.g. because they allow the execution of external applications.

allow_url_fopen disables the ablity to open files via an URL.

session.save_path sets the path were php stores its session files. For ISPConfig 2, the path is e.g. “/var/www/webXXX/phptmp/” and for ISPConfig 3 the path is like “/var/www/clients/client1/web1/tmp/” If you dont use ISPConfig, set this path to a directory which is writable for the webserver user. the directory should be unique for every website.

open_basedir sets the path were php scripts are allowed to open files. For ISPConfig 2, the path is like  “/var/www/webXXX/” and for ISPConfig 3 the path is like “/var/www/clients/client1/web1/” If you dont use ISPConfig, set this path to a the root directory of this vhost. With :/tmp we allow php scripts to use also the /tmp directory of the server.

Webalizer stats only showing 1 or 2 days?

Monday, August 17, 2009 posted by admin

If webalizer statistics of your website are only showing the last 1 or two days instead of all days since the website has been created, you have to activate incremental processing in the webalizer configuration file (/etc/webalizer.conf or /etc/webalizer/webalizer.conf depending on the Linux distribution).

vi /etc/webalizer/webalizer.conf

Change the line:

# Incremental     yes

to:

Incremental     yes