Posts mit dem Label hosting werden angezeigt. Alle Posts anzeigen
Posts mit dem Label hosting werden angezeigt. Alle Posts anzeigen

Sonntag, 2. Januar 2011

Change domain IP address in ispCP

If you run multiple domains on ispCP and you want to run some domains on a different IP address, here’s how you do it.

Adding the IP in the admin console

Log in to your ispCP admin account. Navigate to

Settings –> Manage IPs

Add the new IP address and the domain you’re intending to use it for.

Mapping the IP to the domain

This must be done manually. Log in via SSH to your server. Connect as root user to your MySQL console using

mysql –u root –p

You need to enter your mysql root password now. If you don’t remember it, you might be able to recover it. Once logged in, list all your databases using

show databases;

Identify the ispcp database, mine was named “ispcp_database”. Then, select that database

use ispcp_database;

If your ispcp database is named differently, replace “ispcp_database” with your name. Next, list the domain / IP mapping

select domain_name, ip_number FROM domain d RIGHT JOIN server_ips ip ON d.domain_ip_id=ip.ip_id;

You’ll see a list of all domains now and their IP addresses. You should have the domain name NULL mapped to the newly added IP. This means, that there is no domain assigned to it, yet. To assign the domain, run the following query

update domain SET domain_ip_id=(select ip_id from server_ips WHERE ip_number="1.2.3.4"), domain_status="change" where domain_name="example.com";

Replace the red strings with the IP address and the domain name you’d like to assign. To double-check that it worked correctly, list all assignments with the following query

select domain_name, ip_number FROM domain d RIGHT JOIN server_ips ip ON d.domain_ip_id=ip.ip_id;

Exit MySQL.

The next step will overwrite the ispcp configuration and all custom changes it might include. Please backup your ispcp.conf before proceeding. When done, run the update script

cd /var/www/ispcp/engine/setup/
perl ispcp-update

Wordpress installation

Wordpress is a very comfortable, powerful and user-friendly blog system. It’s currently the best IMHO. Here’s a recommendation how to make the basic installation even more powerful using plugins.

Embedding Flash Videos

Embedding Flash videos with the Flash Video Player which is based on the famous JWPlayer. To embed a video in your Article, just insert

[flashvideo file=video/video.flv /]

Securing your Blog

Force Login

If you don’t want all blog posts to be public to everyone, the following plugins are for you. A 100% private blog needs the Force User Login plugin. This will give you the login dialog right after you enter the blog. Users need to register in order to see anything. The plugin comes with only one PHP file which can be edited to define the landing page after successful login.

Content Control

If you want the full control, you should install the Social Privacy for wordpress. It comes with a set of plugins to

  • restrict users to see only defined article categories
  • support permission-based RSS feeds
  • send out email notifications to subscribers based on their permissions

It gives you great control to allow users to read only posts they should be.

Single Sign On with OpenID

Some users might be annoyed to create a new account on your blog. The OpenID plugin helps. Users can login to your blog using any OpenID provider. Providers are for example Google Mail, Yahoo, MySpace and many more. After you installed the plugin, your login dialog is extended by the following line.

image

An OpenID is a URL. If you want to to login with your GMail account for example, put the following URL in the field

www.google.com/accounts/o8/id

During the login process, it will redirect you to the GMail login page and ask for confirmation.

Image Gallery

NextGEN Gallery is a great image gallery plugin. You can create galleries by uploding zip files or bulk-uploading images via Flash-Uploader. It automatically creates thumbnails and resizes the images if needed. Easily include slideshows, albums, image lists into your posts. Absolutely hassle-free.

Sending Welcome Emails

The SB Welcome Email Editor allows you to change the ugly default mail that wordpress sends out when a new user registers.

Mittwoch, 29. Dezember 2010

Using SSL with virtual hosts

SSL with virtual hosts

The 1st important thing to know is that SSL does not work well with virtual hosts. If you host multiple domains on one server, you need to have a seperate public IP address for every domain which should support SSL.

Reconfiguring non-SSL Virtual Hosts

As mentioned above, every SSL-Domain needs its own IP Address. The 1st thing you need to change is your Nameserver to point each domain to its unique IP. Secondly, edit the existing VirtualHost entries of the respective domains to listen to new IP addresses only.

Example: You are running example.com, example1.com and example2.com on your server with IP 1.2.3.4. The configuration so far looks like this.

<VirtualHost 1.2.3.4:80>
ServerName example.com

</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerName example1.com

</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerName example2.com

</VirtualHost>

All virtualhosts using the same IP Address. Now you want to have example2.com to support SSL and you got an additional IP 1.2.3.10. You need to modify your nameserver to map example2.com to 1.2.3.10 and modify the existing configration to

<VirtualHost 1.2.3.4:80>
ServerName example.com

</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerName example1.com

</VirtualHost>

<VirtualHost 1.2.3.10:80>
ServerName example2.com

</VirtualHost>

Configuring SSL Virtual Hosts

For the new SSL websites, I created a new site configuratino file in the apache sites-available directory which holds configuration for all SSL domains. I named it ssl-sites. Start the file with naming all IP-Addresses that should run a SSL supported domain. In our example, this is only 1.2.3.10

NameVirtualHost 1.2.3.10:443 # for example2.com

Then, the virtualhost definitions follows. You can just copy the virtualhost defintion for example2.com from your existing configu and modify it to listen to port 443.

<VirtualHost 1.2.3.10:443>
ServerName example2.com

</VirtualHost>

Additionally, you need to add the SSL configuration, especially to configure the certificates and key files.

<VirtualHost 1.2.3.10:443>
ServerName example2.com
# SSL DIrectives
SSLEngine On
SSLCipherSuite HIGH:MEDIUM
SSLCertificateFile /etc/apache2/ssl/example2.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/example2.com.key
SSLCertificateChainFile /etc/apache2/ssl/intermediate.pem
SSLCACertificateFile /etc/apache2/ssl/ca.pem
...
</VirtualHost>

Enable the site

If you did it like I did, you need only to enable the new configuration file by

a2ensite ssl-sites
/etc/init.d/apache2 restart

Done! Now you can reach your domain via SSL