Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Setting Up PHPlist (Open-Source Newsletter Manager)


This document describes how to set up PHPlist on Fedora, CentOS, Ubuntu and Debian. This howto should also work for other distributions with little modifications. Taken from the phplist page: “phplist is an open-source newsletter manager. phplist is free to download, install and use, and is easy to integrate with any website. phplist is downloaded more than 10 000 times per month and is listed in the top open source projects for vitality score on Freshmeat. phplist is sponsored by tincan.”

PHPlist has a great many features – please have a look at http://www.phplist.com/details.

This howto is a practical guide without any warranty – it doesn’t cover the theoretical backgrounds. There are many ways to set up such a system – this is the way I chose.

 

1 Preliminary Note

I asume that you’ve at least set up a standard LAMP system and a mailserver. If not, you should first take a look at our “Virtual Users And Domains” howtos. Additionally you have to install the PHP imap package (“php-imap” on Fedora/CentOS; “php5-imap” on Debian/Ubuntu).

 

2 Apache Vhost

2.1 Fedora/CentOS

We’ll create a standard vhost for phplist.

vi /etc/httpd/conf.d/vhosts.conf

It could look like this:

NameVirtualHost 192.168.0.100:80

<VirtualHost 192.168.0.100:80>
    ServerName www.example.com
    ServerAdmin admin@example.com
    DocumentRoot /var/www/www/web

    LogLevel warn
    ErrorLog logs/www_error.log
    CustomLog logs/www_access.log combined

</VirtualHost>

Next create the document root for this vhost.

mkdir -p /var/www/www/web/

After that restart the webserver.

service httpd restart

 

2.2 Ubuntu/Debian

We’ll create a standard vhost for phplist.

vi /etc/apache2/sites-available/phplist

It could look like this:

NameVirtualHost 192.168.0.100:80

<VirtualHost 192.168.0.100:80>

    ServerName www.example.com
    ServerAdmin admin@example.com
    DocumentRoot /var/www/www/web

    LogLevel warn
    ErrorLog /var/log/apache2/www_error.log
    CustomLog /var/log/apache2/www_access.log combined

</VirtualHost>

Next create the document root for this vhost.

mkdir -p /var/www/www/web/

After that enable the vhost and restart the webserver.

a2ensite phplist
/etc/init.d/apache2 restart

 

3 MySQL User & Database

Now we have to create a database for PHPlist …

mysqladmin -u root -p create phplist

… and a user for this database.

mysql -u root -p
%sql_root_password%

GRANT CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES, SELECT, INSERT, UPDATE, DELETE ON phplist.* TO ‘phplist_admin’@’localhost’ IDENTIFIED BY ‘%phplist_admin_password%’;
GRANT CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES, SELECT, INSERT, UPDATE, DELETE ON phplist.* TO ‘phplist_admin’@’localhost.localdomain’ IDENTIFIED BY ‘%phplist_admin_password%’;
FLUSH PRIVILEGES;

quit;

 

4 PHPlist

4.1 Note

In step 4.3 you’ll need a vaild email address that will be used by PHPlist to catch all bounced mails – in this example I’ll use “listbounces@example.com“. So create an email address for this special purpose and proceed.

4.2 Get It

Please have a look at http://www.phplist.com/download to find out which is the latest stable version – when I was writing this howto it was version 2.10.5.

cd /tmp/
wget http://mesh.dl.sourceforge.net/sourceforge/phplist/phplist-2.10.5.tgz
tar xvfz phplist-2.10.5.tgz
cp -R /tmp/phplist-2.10.5/public_html/* /var/www/www/web/

Please note that the main page (e.g.: http://www.example.com) contains a dummy page that redirects to the phplist page – you might want to replace it with your own website.

 

4.3 Basic Configuration

vi /var/www/www/web/lists/config/config.php

 

4.3.1 Database Settings

Adjust the following variables so that they fit to your setup (step 3).

E.g.:

$database_name = “phplist”;
$database_user = “phplist_admin”;
$database_password = “Kreationnext”;

 

4.3.2 Bounces

Adjust the following variables so that they fit to your setup (step 4.1).

E.g.:

$message_envelope = “listbounces@example.com”;
$bounce_mailbox_user = “listbounces@example.com”;
$bounce_mailbox_password = “Kreationnext”;

 

4.3.3 Security

Adjust the following variable.

$check_for_host = 1;

 

4.3.4 Debug

The test-mode is enabled by default which means that no emails will be sent, but the system pretends to do so. You have to disable this later, when you tested your setup:

define(“TEST”,0);

 

4.3.5 Other Settings

Please have a look at all the other settings. They are well explained – maybe you want to change some settings.

4.4 Installation

At this point we’re ready for the installation. Open http://%vhost_domain%/lists/admin (e.g.: http://www.example.com/lists/admin) within your preferred browser. Click on “initialise database” to create the needed database structure.

phplist1

The database structure is being created.

phplist2

At the end of the page click on “phplist setup” to proceed with the setup.

phplist3

Log in with the username “admin” and the password “phplist”.

phplist4

This is the checklist that we have to work off. First we should change the admin password – so click on “go there” next to the corresponding line.

phplist5

Enter an email address and choose a new password. Afterwards click on “Save Changes” to apply the settings.

phplist6

You’ll get a notice that the settings have been saved.

phplist7

Now click on “main page” in the menu on the right side and after that on “setup” in the section “System Functions”.

phplist8

The remaining points of the checklist require individual, extensive configuration. Please have a look at the documentation if you have problems with the configuration and to find out how to use phplist.

phplist9

  • PHPlist: http://www.phplist.com/

Comments

comments