您的位置:首页 > 运维架构 > Nginx

UBUNTU下使用PostgreSql.和nginx安装postfixAdmin2.92版

2015-02-23 00:00 495 查看
<div id="main"><article class="hentry" role="article"><div class="entry-content">
<p>本文为在Ubuntu14.04中使用PostgreSql和Nginx安装PostfixAdmin2.92版的记录。</p>

<p><! –more– ></p>

<h2 id="section">需要安装的包</h2>

<p>记忆有些模糊,大概列一下:</p>

<p>postfix,PostgreSql,postfix-pgsql,php5-pgsql,nginx,php5-fpm,这些包可以通过Ubuntu的包管理安装。</p>

<h2 id="section-1">准备工作</h2>

<p>需要配置nginx支持php,方法见另外的文。</p>

<p>需要建立PostfixAdmi使用的PostgreSql数据库和数据库用户,并配置可以通过网络登录。</p>

<p>建数据库用户可以在psql中执行:</p>

<pre><code>create user postfix;
</code></pre>

<p>创建数据库可以用命令:</p>

<pre><code>createdb postfixdb -O postfix
</code></pre>

<h2 id="section-2">安装包下载</h2>

<p><a href="http://postfixadmin.sourceforge.net/">官方网站</a>上可以找到<a href="https://sourceforge.net/projects/postfixadmin/files/">下载链接</a>
由于是使用的ubuntu中的nginx,下载后把压缩包解压到/usr/share/nginx/html中,重命名为postfixadmin。并修改属主为www-data:</p>

<pre><code>sudo chown -R www-data postfixadmin
</code></pre>

<h2 id="section-3">初始化配置</h2>

<h3 id="section-4">初始化配置文件修改</h3>

<p>运行setup.php之前,需要修改config.ini.php。对这个文件修改项的diff结果(修改后的在前为:</p>

<pre><code>< $CONF['configured'] = false;
---
> $CONF['configured'] = true;
30c30
< $CONF['setup_password'] = 'changeme';
---
> $CONF['setup_password'] = '290c3045f1e273b6725835242ea7cf3d:87937c8fd844a8d4eac9b5cea48393224379663a';
34c34
< $CONF['default_language'] = 'en';
---
> $CONF['default_language'] = 'cn';
83c83
< $CONF['database_type'] = 'mysqli';
---
> $CONF['database_type'] = 'pgsql';
86,87c86,87
< $CONF['database_password'] = 'postfixadmin';
< $CONF['database_name'] = 'postfix';
---
> $CONF['database_password'] = 'yourpassword';
> $CONF['database_name'] = 'postfixdb';
</code></pre>

<p>setup_password一项与之后的设置有关,见下文,database_type一项如何设置配置文件中有说明,而configured需要改为true,才能进行初始化。</p>

<h3 id="section-5">初始化配置</h3>

<p>在浏览器中打开http://127.0.0.1/postfixadmin/setup.php/ 开始进行初始化配置。由于开始配置时没有截图,这里借用网上的其它图来说明一下,主要问题在设置管理员用户上,之前的环境检查问题不大。在设置管理员用户时,输入在config.ini.php中配置的setup_password报错,类似:</p>

<pre><code>if you want to use the password you entered as setup password, edit config.inc.php and set

$CONF['setup_password'] = '1a05f571012e9f14c0f80f764d516f80:ec41add25de301101bac12649f929bbcbea8575e';
</code></pre>

<p>把显示内容更新到config.ini.php,之后再进行配置就可以完成管理员用户的配置了:</p>

<p><img src="http://pangyi.github.io/images/postfixadmin-createadmin.png"></p>

<h2 id="section-6">使用</h2>

<p>打开http://127.0.0.1/postfixadmin/ ,进入登录页面,用之前建立的管理员用户登录就会进入管理界面:</p>

<p><img src="http://pangyi.github.io/images/postfixadmin.png"></p>

<h2 id="section-7">参考</h2>

<p>有关建立管理员时口令报错的问题:</p>

<p>http://www.tuicool.com/articles/yMfq22</p>

<p>一个比较老版本的配置,供参考一些思路吧:</p>

<p>http://blog.sina.com.cn/s/blog_57cf8eea0100aogd.html</p>

<p class="post-footer">
原文链接地址:
<a href="http://pangyi.github.io/blog/20010101/ubuntuxia-shi-yong-postgresql-dot-he-nginxan-zhuang-postfixadmin2-dot-92ban/">http://pangyi.github.io/blog/20010101/ubuntuxia-shi-yong-postgresql-dot-he-nginxan-zhuang-postfixadmin2-dot-92ban/</a><br>
written by <a href="http://pangyi.github.io">PangYi</a>
 posted at <a href="http://pangyi.github.io">http://pangyi.github.io</a>
</p>
</div></article></div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: