Archive | Apache RSS feed for this section

Insert Varnish Cache With NAT Rule

Here’s a simple nat rule for iptables that will route incoming web traffic to your varnish cache. This allows you to implement varnish without reconfiguring apache. In the varnish config, set the backing do be 127.0.0.1:80. iptables -D PREROUTING -s ! 127.0.0.1 -d 192.168.100.16 \ -p tcp -m tcp –dport 80 -j DNAT \ –to-destination [...]

Here’s a simple nat rule for iptables that will route incoming web traffic to your varnish cache. This allows you to implement varnish without reconfiguring apache. In the varnish config, set the backing do be 127.0.0.1:80.

iptables -D PREROUTING -s ! 127.0.0.1 -d 192.168.100.16 \
   -p tcp -m tcp --dport 80 -j DNAT \
   --to-destination 192.168.100.16:6081 -t nat

Here’s a different rule that also seems to work:

/sbin/iptables  -t nat -A PREROUTING \
   -i eth0 -d 46.105.124.96 -p tcp -m tcp \
   --dport 80 -j REDIRECT 6081
View Comments Continue Reading →

Manage Apache Modules On Ubuntu

Configuration for enable modules is stored in: /etc/apache2/mods-enabled Available but inactive modules are stored in: /etc/apache2/mods-available A module can be enabled with: a2enmod [modulename] Where [modulename] is the module to be enabled. For example: a2enmod rewrite will enable the rewrite module. A module can be disabled in a similar fashion with: a2dismod [modulename] Don’t forget [...]

Configuration for enable modules is stored in:

/etc/apache2/mods-enabled

Available but inactive modules are stored in:

/etc/apache2/mods-available

A module can be enabled with:

a2enmod [modulename]

Where [modulename] is the module to be enabled.

For example:

a2enmod rewrite

will enable the rewrite module.

A module can be disabled in a similar fashion with:

a2dismod [modulename]

Don’t forget to restart apache after making changes with:

service apache2 restart
View Comments Continue Reading →

Install WordPress on Ubuntu virtual server at Media Temple

Server is a MediaTemple “ve” server which is a Parallels Virtuozzo container with Ubuntu 10.04 LTS Lucid installed as the operating system. The first step is to install packages: apt-get update apt-get install mysql-server apt-get install apache2 apt-get install php5 apt-get install php5-mysql Now set mysql service to start automatically: update-rc.d mysql defaults service mysql [...]

Server is a MediaTemple “ve” server which is a Parallels Virtuozzo container with Ubuntu 10.04 LTS Lucid installed as the operating system.

The first step is to install packages:

apt-get update
apt-get install mysql-server
apt-get install apache2
apt-get install php5
apt-get install php5-mysql

Now set mysql service to start automatically:

update-rc.d mysql defaults
service mysql start

Next create a database for wordpress:

mysql -p -u root
create database wordpress;
grant all privileges on wordpress.* to 'wordpress'@'localhost' identified by 'YOURNEWPASS';
flush privileges;
exit;

Next we’ll download and install wordpress:

cd /root
wget http://wordpress.org/latest.tar.gz
tar -xvzf /root/latest.tar.gz
rsync -avz wordpress/ /var/www/
rm /var/www/index.html
cp /var/www/wp-config-sample.php /var/www/wp-config.php

Now set the database credentials in /var/www/wp-config.php:

replace 'database_name_here' 'wordpress' -- /var/www/wp-config.php
replace 'username_here' 'wordpress' -- /var/www/wp-config.php
replace 'password_here' 'YOURNEWPASS' -- /var/www/wp-config.php

Finally point your web browser to the site and run the WordPress installer.

View Comments Continue Reading →

How to verify SSL cert from command line

When I need to verify an SSL certificate and the corresponding CA intermediate certs a good tool is openssl like this: openssl verify -CAfile cabundle.crt www.domain.com.crt Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post Print for later Bookmark [...]

When I need to verify an SSL certificate and the corresponding CA intermediate certs a good tool is openssl like this:

openssl verify -CAfile cabundle.crt www.domain.com.crt
View Comments Continue Reading →

Generate CSR with single command

Here’s a single command to generate a new key and CSR: openssl req -nodes -newkey rsa:2048 -keyout mydomain.key -out mydomain.csr Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post Print for later Bookmark in Browser Tell a friend

Here’s a single command to generate a new key and CSR:

openssl req -nodes -newkey rsa:2048 -keyout mydomain.key -out mydomain.csr
View Comments Continue Reading →