Php List Tutorial
07.12Install and setup PHPList
PHPList is an open-source newsletter manager, free to download, install and use. Follow this link to know more...
http://www.phplist.com/details
Here I'm trying to document how to set up PHPlist on Ubuntu that should work for other distributions with little modifications.
Following NEW packages will be installed
Install MySQL that must be 3.23 or higher
The following NEW packages will be installed
You will be also prompted to enter an admin password
Get strong one.
To check whether these packages installed or not, just fire
To check whereabouts of MySQL
It will give you sth like this...
Enter the password you fed while installation.
Now you should be on mysql command line as seen like this
Create a database for PHPList namely myphplist
Grant privileges
Check that out
Now its time to look into PHP installation. Create file say test.php using your favorite editor having
Now fire root@moinhaidar:~# php test.php
Ooooo!!! You got an error like php not found! Okay lets install this package to get command line PHP.
So far so good!
Now its time to find php.ini and get it configured...
Output should sth like this
Open /etc/php5/cli/php.ini and search for extension_dir this should be sth like this
Uncomment if commented and set extension_dir what you find with root@moinhaidar:~# php test.php like
Copy to appropriate loation, usually /var/www/ and untar/unzip whatever...
Now its time to configure ./mylist/config/config.php
Lets create new site namely phplist
Now "vi /etc/apache2/sites-available/phplist" and get it configure...
+ indicates new addition
* indicates modified
Okay, Now enable mylists site and disable default one
Now Check "vi /etc/apache2/sites-enabled/mylists", that should be same as sites-availabe one.
Installed IMAP module for PHP bcoz phpList bounce processing connects to your mail server via a PHP module called IMAP.
Create tmp dir to ./var/www/mylists/ if not there.
root@moinhaidar:~#
#Change permission
root@moinhaidar:~# chmod -R 777 /var/www/mylists
#Restart server
root@moinhaidar:~# /etc/init.d/apache2 restart
Done Hit http://yourdomain.com/admin/
Got uninitialized database?
Hit initialized database link. It will populate your database(myphplist).
Cross check the database
Done! Go to http://yourdomain.com/admin/?page=setup and setup remaining thing and enjoy!
Option 1 - internet site : Mail will be get read/delivered directly via SMTP
Option 2 - mail.youdomain.com : FQDN
Configure /etc/postfix/main.cf adding followings
Edit /etc/mailname and /etc/hostname having
Edit /etc/hosts having
Reboot the system
Add a user namely noreply
Setup Reverse DNS
Quick Test
No confirmation is given that the email has been sent but the logs will show the details.
Check the receiving email address and I hope you got expected!!! :)
Sumber : http://moinhaidar.blogspot.com/2010/08/install-and-setup-phplist.html
http://www.phplist.com/details
Here I'm trying to document how to set up PHPlist on Ubuntu that should work for other distributions with little modifications.
Setup Apache, PHP & MySQL:
Install Apache2 and PHP51 | apt-get install apache2 php5 |
1 | apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libexpat1 libmagic1 libpq5 libxml2 php5 php5-common ucf |
1 | aptitude install mysql-server mysql-client libmysqlclient15-dev libapache2-mod-auth-mysql php5-mysql |
1 | apparmor apparmor-profiles libapache2-mod-auth-mysql libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient15-dev libmysqlclient15off libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 php5-mysql zlib1g-dev |
Get strong one.
To check whether these packages installed or not, just fire
1 | dpkg --get-selections |
2 | dpkg -L php5|apache2|mysql-client-5.0 |
1 | root@moinhaidar:~# find / -type d -name "mysql" |
1 | /var/lib/mysql |
2 | /var/lib/mysql/mysql |
3 | /var/log/mysql |
4 | /usr/lib/mysql |
5 | /usr/lib/perl5/DBD/mysql |
6 | /usr/lib/perl5/auto/DBD/mysql |
7 | /usr/include/mysql |
8 | /usr/share/mysql |
9 | /etc/mysql |
Setup Database
Lets login to mysql we just installed1 | root@moinhaidar:~# mysql -uroot -p |
Now you should be on mysql command line as seen like this
1 | Welcome to the MySQL monitor. Commands end with ; or \g. |
2 | Your MySQL connection id is 1 |
3 | Type 'help;' or '\h' for help. Type '\c' to clear the buffer. |
4 | mysql> |
1 | mysql> create database myphplist; |
2 | Query OK, 1 row affected (0.00 sec) |
1 | mysql> GRANT ALL PRIVILEGES ON myphplist.* TO 'root'@'localhost' IDENTIFIEDBY 'password' WITH GRANT OPTION; |
2 | Query OK, 0 rows affected (0.00 sec) |
1 | mysql> show databases; |
2 | +--------------------+ |
3 | | Database | |
4 | +--------------------+ |
5 | | information_schema | |
6 | | myphplist | |
7 | | mysql | |
8 | +--------------------+ |
9 | 3 rows in set (0.00 sec) |
1 | <?php |
2 | phpinfo(); |
3 | ?> |
Ooooo!!! You got an error like php not found! Okay lets install this package to get command line PHP.
1 | apt-get install php5-cli |
Configuring PHP to Work With MYSQL
Again fire root@moinhaidar:~# php test.php and look for extension_dir something like below.1 | extension_dir => /usr/lib/php5/20060613 => /usr/lib/php5/20060613 |
1 | find / -name php.ini |
1 | /etc/php5/cli/php.ini |
2 | /etc/php5/apache2/php.ini |
1 | ; Directory in which the loadable extensions (modules) reside. |
2 | ;extension_dir = |
1 | extension_dir = "/usr/lib/php5/20060613" |
Setup PHPList
Get the latest version of PHPList1 | wget http://sourceforge.net/projects/phplist/files/phplist-development/2.11.5/phplist-2.11.5.tgz/download |
1 | root@moinhaidar:~# mv phplist-2.11.5.tgz /var/www |
2 | root@moinhaidar:~# tar -xvzf phplist-2.11.5.tgz |
3 | root@moinhaidar:~# mv phplist-2.11.5 mylists |
01 | [General settings for language and database] |
02 | $database_host = "localhost"; |
03 | $database_name = "myphplist"; |
04 | $database_user = "root"; |
05 | $database_password = "dbpassword"; |
06 | $installation_name = 'Whatever'; |
07 |
08 |
09 | [Settings for handling bounces] |
10 | $message_envelope = 'noreply@yourdomain.com'; |
11 | $bounce_mailbox_user = 'noreply'; |
12 | $bounce_protocol = 'mbox'; |
13 | $bounce_mailbox = '/var/mail/noreply'; |
14 |
15 |
16 | [Security related settings] |
17 | $require_login = 1; |
18 |
19 |
20 | [Debugging and informational] |
21 | define ("TEST",0); |
22 | define('SEND_ONE_TESTMAIL',1); |
1 | root@moinhaidar:~# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/phplist |
+ indicates new addition
* indicates modified
01 | + ServerName yourdomain.com |
02 | * ServerAdmin admin@yourdomain.com |
03 | + ServerAlias *.yourdomain.com yourdomain.com |
04 | * DocumentRoot /var/www/mylists |
05 | #*Setting Off PHP safe mode in order to acheive bounce processing - site wise |
06 | php_admin_flag safe_mode Off |
07 | <directory> |
08 | Options FollowSymLinks |
09 | AllowOverride None |
10 | </directory> |
11 | <directory var="" www="" mylists=""> |
12 | Options Indexes FollowSymLinks MultiViews |
13 | AllowOverride None |
14 | Order allow,deny |
15 | allow from all |
16 | + DirectoryIndex index.php index.html |
17 | </directory> |
1 | sudo a2dissite default |
2 | sudo a2ensite lists |
Installed IMAP module for PHP bcoz phpList bounce processing connects to your mail server via a PHP module called IMAP.
1 | apt-get install php5-imap |
Checklist
#Create a temp dirCreate tmp dir to ./var/www/mylists/ if not there.
root@moinhaidar:~#
#Change permission
root@moinhaidar:~# chmod -R 777 /var/www/mylists
#Restart server
root@moinhaidar:~# /etc/init.d/apache2 restart
Done Hit http://yourdomain.com/admin/
Got uninitialized database?
Hit initialized database link. It will populate your database(myphplist).
Cross check the database
01 | root@mail:~# mysql -uroot -p |
02 | Enter password: |
03 | Welcome to the MySQL monitor. Commands end with ; or \g. |
04 | Your MySQL connection id is 15 |
05 | Server version: 5.0.51a-3ubuntu5.5 (Ubuntu) |
06 | Type 'help;' or '\h' for help. Type '\c' to clear the buffer. |
07 | mysql> use myphplist; |
08 | mysql> show tables; |
09 | +----------------------+ |
10 | | Tables_in_myphplist | |
11 | +----------------------+ |
12 | | admin | |
13 | | admin_attribute | |
14 | | admin_task | |
Basic Mail Server Setup
Install follwing package choosing options...Option 1 - internet site : Mail will be get read/delivered directly via SMTP
Option 2 - mail.youdomain.com : FQDN
1 | root@moinhaidar:~# aptitude install postfix telnet mailx postfix-mysql |
1 | myhostname = mail.yourdomain.com |
2 | myorigin = $mydomain |
3 | mydestination = $mydomain, localhost.$mydomain, localhost |
1 | mail.yourdomain.com |
1 | 127.0.0.1 localhost localhost.localdomain |
2 | server-ip mail.yourdomain.com |
1 | sudo reboot |
Setup Reverse DNS
Quick Test
1 | mail email@yourdomain.com |
2 | Subject: test email from yourdomain.com |
3 | test body of the email. |
4 | . |
5 | Cc: |
Check the receiving email address and I hope you got expected!!! :)
Sumber : http://moinhaidar.blogspot.com/2010/08/install-and-setup-phplist.html
0 komentar: