楼主: 一生有你llx

[原创] Linux服务器配置

[复制链接]
论坛徽章:
0
51#
 楼主| 发表于 2019-1-30 07:32 | 只看该作者

配置openwebmail

  通 过 修改配置文件 openwebmail.conf ,实现个性化邮箱定制。用户可以自由的更改邮箱logo、域名、容量 、签名等信息。

1 、重定向index,快速打开邮箱。将下面的内容复制到“/var/www/html/index.html”,这样就可以直接通过“127.0.0.1”打开邮箱

[root@localhost openwebmail]#  gedit /var/www/html/index.html

<html>

<head><meta http-equiv="Refresh" content="0;URL=/cgi-bin/openwebmail/openwebmail.pl">

</head>

<body>

</body>

</html>

2 、修改登录logo。将“/var/www/html/openwebmail/images/openwebmail.gif”替换成自己的logo,注意名字不要变

3 、更改logo链接。登录框上方的logo有一个默认的链接地址,我们可以通过修改配置文件中的参数“logo_link”来使它重定向到我们自己的网站

[root@localhost openwebmail]#  gedit /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

logo_link  http://www.baidu.com

4 、修改发件人的域名。在配置文件中有一个参数domainnames,我们可以将它改为自己的邮箱域名。这样在发件的时候,就会显示出正确的邮箱域名。

[root@localhost openwebmail]#  gedit /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

domainnames    mailsrv.david.cn

修改前

修改后

5 、修改附件大小限制。附件太大会降低服务器的效率,因此我们必须合理的设置附件的大小,可以通过参数attlimit来设置。

[root@localhost openwebmail]#  gedit /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

attlimit    10

修改之后,发送一个邮件,结果如下

6 、允许root登录。由于root用户的权利太大,因此默认不允许root登录。我们可以通过参数allowed_rootloginip来设置允许某个ip地址使用root登录,这样相对来说安全一些

[root@localhost openwebmail]#  gedit /var/www/cgi-bin/openwebmail/etc/openwebmail.conf

allowed_loginip   192.168.0.112    // 只允许指定的 ip 登录 root

#allowed_loginip   all      // 允许所有的 ip 地址使用 root 登录

修改前


修改后

7 、修改身份认证文件,这个文件需要从defaults目录拷贝,然后修改两个参数“passwdfile_enctypted“和”passwdmkdb“

[root@localhost openwebmail]#  cp etc/defaults/auth_unix.conf etc/

[root@localhost openwebmail]#  gedit etc/auth_unix.conf

passwdfile_encrypted/etc/shadow

passwdmkdb    none

8 、修改dbm文件,首先从defaults目录下拷贝,然后改变参数“dbmopen_ext“和”dbmopen_haslock“

[root@localhost openwebmail]#  cp etc/defaults/dbm.conf etc/

dbm_ext           .pag

dbmopen_ext       none

dbmopen_haslock      no

9 、初始化openwebmail服务

[root@localhost openwebmail]#  ./openwebmail-tool.pl --init

creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.

...done.

Welcome to the OpenWebMail!

Send the site report?(Y/n) yes     // 这里必须输入 yes

sending report...

Thank you.

10 、重启Apache

[root@localhost openwebmail]#  service httpd restart

停止  httpd :                                               [ 确定 ]

正在启动  httpd : httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

                                                          [ 确定 ]

11 、在浏览器输入“127.0.0.1/cgi-bin/openwebmail/openwebmail.pl“,可以看到下面的登录窗口

12 、在登录窗口输入一个已经存在的用户名和密码,由于是第一次登录,我们需要做一些设置

13 、设置个人模板


使用道具 举报

回复
论坛徽章:
0
52#
 楼主| 发表于 2019-2-9 19:45 | 只看该作者
安装postfix
        postfix是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。
1、安装postfix
[root@localhost ~]# rpm -qa | grep postfix
[root@localhost ]# yum install -y postfix
Loaded plugins: fastestmirror, refresh-packagekit, security                                                
Complete!
[root@localhost]#

2、配置postfix,编辑配置文件“/etc/postfix/main.cf”
[root@localhost ~]# gedit /etc/postfix/main.cf
mydomain = david.cn      //dns中的域名
myhostname = mailsrv.david.cn  //dns中的域名
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
inet_interfaces = all   //允许处理所有网路信息
inet_protocols = all    //允许ipv4ipv6
mynetworks = 192.168.0.0/24, 127.0.0.0/8     //允许接入的ip

3、设置防火墙,postfix使用25端口
[root@localhost ~]# gedit /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
[root@localhost ~]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter nat                [确定]
iptables:清除防火墙规则:                                 [确定]
iptables:正在卸载模块:                                   [确定]
iptables:应用防火墙规则:                                 [确定]
iptables:载入额外模块:nf_conntrack_ftp                   [确定]

4、启动服务
[root@localhost ~]# service postfix start
启动postfix:                                             [确定]
[root@localhost ~]#

5、连接测试
[root@localhost ~]# telnet 192.168.0.113 25    //ip是本机地址,25是端口号
Trying 192.168.0.113...
Connected to 192.168.0.113.
Escape character is '^]'.
220 mailsrv.david.cn ESMTP Postfix

6、发信
[root@localhost ~]# mail david     //david发信,确保此用户存在Linux系统中。发信人是当前登录的用户root
Subject: test04       //标题
hello david           //内容
.                       //结束
EOT
[root@localhost ~]# mail -u david      //查看用户david的信件
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/mail/david": 5 messages 1 new
    1 root                  Thu Aug 16 17:07  21/692   "test"
    2 root                  Thu Aug 16 17:08  20/631   "test"
    3 root                  Thu Aug 16 17:10  20/602   "test"
    4 root                  Fri Aug 17 08:15  20/570   "test3"
>N  5 root                  Fri Aug 17 09:46  18/539   "test04"    //此信件是刚才收到的,由root用户发出
&




使用道具 举报

回复
论坛徽章:
0
53#
 楼主| 发表于 2019-2-22 08:39 | 只看该作者
安装spam
      spam(SpamAssassin)利用perl来进行文字分析,他会检测邮件的标题、内容、送信人,这样就可以过滤出垃圾邮件
1、安装spam。由于spam的依赖太多,用户一定要使用yum源来安装,这样减少不必要的麻烦
[root@localhost ~]# rpm -qa | grep spamassassin
[root@localhost openwebmail]# yum install -y spamassassin
Complete!

2、配置postfix使用spam功能,修改配置文件“/etc/postfix/master.cf”
[root@localhost ~]# gedit /etc/postfix/master.cf
smtp      inet  n      -       n       -      -       smtpd  -o content_filter=spamassassin
spamassassin unix - n n  - - pipe user=nobody argv=/usr/bin/spamc -f /usr/sbin/sendmail -oi -f $(sender) -- $(recipient)  //追加到最后一行

3、重启postfix
[root@localhost openwebmail]# service postfix restart
关闭postfix:                                            [确定]
启动postfix:                                            [确定]
[root@localhost openwebmail]#

4、启动spam服务
[root@localhost ~]# service spamassassin start
启动spamassassin:                                            [确定]
[root@localhost ~]#

5、测试垃圾邮件。
1)spamassassin为我们提供了一个垃圾邮件的模板“sample-spam.txt”,我们可以使用此模板的内容来发送
[root@localhost openwebmail]# cat /usr/share/doc/spamassassin-3.3.1/sample-spam.txt
Subject: Test spam mail (GTUBE)
Date: Wed, 23 Jul 2003 23:30:00 +0200
From: Sender <sender@example.net>
To: Recipient <recipient@example.net>
Precedence: junk
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
This is the GTUBE, the
    Generic
    Test for
    Unsolicited
    Bulk
    Email
If your spam filter supports it, the GTUBE provides a test by which you
can verify that the filter is installed correctly and is detecting incoming
spam. You can send yourself a test mail containing the following string of
characters (in upper case and with no white spaces and line breaks):
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X      //这就是垃圾邮件的内容
You should send this test mail from an account outside of your network.
2)使用openwebmail发信
        
3)查看邮箱的日志文件。Spam采用积分制,默认超过5分就是垃圾邮件,而我们看到下面识别出的邮件是999分,很明显是垃圾邮件
[root@localhost openwebmail]# cat /var/log/maillog
Aug 21 08:44:14 localhost spamd[6401]: spamd: failed to create readable default_prefs: //.spamassassin/user_prefs
Aug 21 08:44:14 localhost spamd[6401]: spamd: processing message <20180821004332.M42441@mailsrv.david.cn> for nobody:99
Aug 21 08:44:26 localhost spamd[6401]: spamd: identified spam (999.0/5.0) for nobody:99 in 12.5 seconds, 603 bytes.
Aug 21 08:44:26 localhost spamd[6401]: spamd:
result: Y 999 –
ALL_TRUSTED,GTUBE,TVD_SPACE_RATIO scantime=12.5,size=603,user=nobody,uid=99,required_score=5.0,rhost=localhost,raddr=127.0.0.1,
rport=33149,mid=<20180821004332.M42441@mailsrv.david.cn>,autolearn=no
Aug 21 08:44:26 localhost postfix/pipe[6443]: 3F2FD14141A: to=<david@mailsrv.david.cn>,
relay=spamassassin, delay=13, delays=0.06/0.03/0/12, dsn=2.0.0, status=sent (delivered via spamassassin service)
Aug 21 08:44:26 localhost postfix/qmgr[6368]: 3F2FD14141A: removed
Aug 21 08:44:26 localhost spamd[6399]: prefork: child states: II




使用道具 举报

回复
论坛徽章:
0
54#
 楼主| 发表于 2019-3-17 18:07 | 只看该作者
Mediawiki
        Mediawiki是一个强大的维基软件,可以实现页面编辑、图像和多媒体管理。  
1、下载mediawiki软件(“https://www.mediawiki.org/wiki/News”)

2、为mediawiki-1.22创建一个自己的数据库,我们起名为“mediawiki-1.22”

3、将mediawiki安装包解压到apache的网页根目录“/var/www/html/”
[root@localhost html]# cp /wj/mediawiki-1.22.tar /var/www/html/      //拷贝压缩包
[root@localhost html]# tar xvf mediawiki-1.22.tar      //解压
[root@localhost html]# mv mediawiki-1.22 mediawiki-1.22          //重命令,这样方便从浏览器打开

4、安装。在浏览器输入地址“127.0.0.1/mediawiki”,开始安装
1)提示“localsetting.php not found”,点击“set up the wiki”
2)选择语言
3)检测环境,如果有严重问题,那么需要提前解决。可以看到下图中,缺少pecl扩展。
4)设置数据库
5)设置管理员
6)安装完成。最后会生成一个“localsettings.php”这是mediawiki的配置文件,我们要将这个文件保存到mediawiki的工作目录
[root@localhost ~]# cp /wj/LocalSettings.php /var/www/html/mediawiki/
7)在浏览器输入“127.0.0.1/mediawiki”,就可以访问mediawiki主页

使用道具 举报

回复
论坛徽章:
0
55#
 楼主| 发表于 2019-4-22 08:51 | 只看该作者
Wordpress
        Wordpress是一个开源的博客平台,是搭建个人博客的首选,用户可以去wordpress中文网站寻找帮助资料  
1、下载wordpress软件(https://cn.wordpress.org/download/releases/

2、为wordpress创建一个自己的数据库,我们起名为“wordpress”

3、将wordpress安装包解压到apache的网页根目录“/var/www/html/”
[root@localhost html]# cp /wj/wordpress-4.1.tar /var/www/html/      //拷贝压缩包
[root@localhost html]# tar xvf wordpress-4.1.tar      //解压
[root@localhost html]# mv wordpress-4.1 wordpress          //重命令,这样方便从浏览器打开

4、修改wordpress配置文件。Wordpress提供了一个样板文件“wp-config-sample.php”,我们要将其拷贝一份,命名为“wp-config.php”
[root@localhost wordpress]# cp wp-config-sample.php wp-config.php
[root@localhost wordpress]# gedit wp-config.php
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名*/
define('DB_USER', 'root');
/** MySQL数据库密码 */
define('DB_PASSWORD', '543092');
/** MySQL主机 */
define('DB_HOST', 'localhost');
/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');
/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', 'utf8_unicode_ci');
/** 数据库语言设置*/
define('WPLANG', 'zh_CN');

5、重启apache
[root@localhost wordpress]# service httpd restart
停止 httpd:                                              [确定]
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                          [确定]

6、安装。在浏览器输入地址“127.0.0.1/wordpress”,开始安装
       1)输入基本信息
        
       2)安装成功
        
       3)登录。可以使用开始填写的用户名和密码登录,地址是“127.0.0.1/wordpress/wp-login.php”
        
       4)管理界面”127.0.0.1/wordpress/wp-admin”
        
       5)主页“127.0.0.1/wordpress”
      


使用道具 举报

回复
论坛徽章:
0
56#
 楼主| 发表于 2019-5-11 08:10 | 只看该作者
Discus
        Discuz是一款免费的论坛管理系统,大量的使用了AJAX,内部有丰富的模板风格。     
1、下载discuz软件(https://cn.wordpress.org/download/releases/")

2、为discuz创建一个自己的数据库,我们起名为“discuz”

3、将discuz安装包解压,将其中的upload目录拷贝到apache的网页根目录“/var/www/html/”
[root@localhost html]# tar xvf discus-3.1.tar      //解压
[root@localhost html]# cp -r discus-3.1/upload/ discus/          //重命令,这样方便从浏览器打开

4、修改discuz中config和data两个目录的权限为777,将config中的两个配置文件复制一份,名字去掉default
[root@localhost html]# chmod -R 777 discuz/data/
[root@localhost html]# chmod -R 777 discuz/config
[root@localhost html]# cd discuz/
[root@localhost discuz]# cp config/config_global_default.php config/config_global.php
[root@localhost discuz]# cp config/config_ucenter_default.php config/config_ucenter_.php

5、开始安装
       1)在浏览器输入“127.0.0.1/discus/install”
        
[root@localhost wordpress]# service httpd restart
停止 httpd:                                              [确定]
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                          [确定]
       2)环境检查。安装程序会检测所需要的环境,主要是php和mysql版本号,以及各个目录的读写权限。安装之前必须要把所有的“x”都解决掉,例如下图中文件读写权限就有问题,需要修改
        
       3)安装全部discuz
      
       4)设置数据库、管理员
      
       5)安装成功
        
       6)在浏览器输入”127.0.0.1/discuz”就可以访问论坛,使用管理员的账户可以登录
        

做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk   

使用道具 举报

回复
论坛徽章:
0
57#
 楼主| 发表于 2019-6-3 07:49 | 只看该作者
Drupal
        Drupal为用户提供各种工具来管理网站,它可以帮助用户入门,建立自己的网站   

2、为drupal创建自己的数据库,我们起名为“drupal”

3、将drupal安装包解压到apache的网页根目录“/var/www/html/”,将汉化包放在drupal中
[root@localhost html]# cp /wj/drupal-7.59.tar /var/www/html/      //拷贝压缩包
[root@localhost html]# tar xvf drupal-7.59.tar      //解压
[root@localhost html]# mv drupal-7.59 drupal          //重命令,这样方便从浏览器打开
[root@localhost html]# cp /wj/drupal-7.59.zh-hans-po drupal/profiles/standard/translations/          //将汉化包拷贝到指定地方

4、安装。在浏览器输入“127.0.0.1/drupal”,进入安装界面
       1)选择普通安装
        
       2)选择语言,如果没有拷贝汉化包,那么就无法选择汉语
        
       3)这一步看到有几个错误
        
            3-1)如果出现“php扩展”错误,那么就安装php-xml包
            3-2)文件系统错误。我们需要在drupal目录下创建指定的文件,设置权限为777
[root@localhost html]# cd drupal
[root@localhost drupal]# mkdir sites/default/files
[root@localhost drupal]# chmod 777 sites/default/files/
           3-3)配置文件错误。用户可以安装上面的错误提醒,将default.settings.php复制一份,然后修改权限777
[root@localhost drupal]# cp sites/default/default.settings.php sites/default/settings.php
[root@localhost drupal]# chmod 777 sites/default/settings.php
       4)设置数据库。此数据库就是我们在开始的时候创建的,如果你还不会使用mysql,那么可以尝试用phpMyAdmin来创建
        
       5)正在安装
        
       6)设置站点信息,包括邮箱、管理员账号、密码等内容
      
       7)安装成功,在浏览器输入“127.0.0.1/drupal”就可以访问了
        

5、状态报告。登录drupal,选择“报告”->“状态报告”,这里可以看到上传进度还不能使用,需要安装PECL。另外,mysql还不支持4字节utf-8,我们需要开启这个功能。
        

6、安装PECL。首先要安装一些依赖软件php-devel、php-pear,然后才能安装PECL
[root@localhost ~]# yum install -y php-devel php-pecl php-pear
[root@localhost ~]# pecl install uploadprogress
Build process completed successfully
Installing '/usr/lib/php/modules/uploadprogress.so'
install ok: channel://pecl.php.net/uploadprogress-1.0.3.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=uploadprogress.so" to php.ini

7、修改php配置文件php.ini
[root@localhost ~]# gedit /etc/php.ini
extentsion=uploadprogress.so

8、修改mysql配置文件my.cnf
[root@localhost ~]# gedit /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
innodb_large_prefix=true
innodb_file_format=barracu
innodb_file_per_table=true

9、重启mysql和apache
[root@localhost ~]# service httpd restart
停止 httpd:                                              [确定]
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                          [确定]
[root@localhost ~]# service mysqld restart
停止 mysqld:                                             [确定]
MySQL Daemon  start.
正在启动 mysqld:                                          [确定]
[root@localhost ~]#

10、修改settings权限,取消写入属性。
[root@localhost drupal]# chmod 444 sites/default/settings.php
[root@localhost drupal]# chmod 555 sites/default

      做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
      链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk  
      

使用道具 举报

回复
论坛徽章:
0
58#
 楼主| 发表于 2019-6-14 06:49 | 只看该作者
XOOPS
        XOOPS是一款用php制作的开源网站管理系统,可用于构建各种网络站点。   
1、下载XOOPS软件(https://xoops.org/

2、将XOOPS软件中的htdocs文件夹拷贝到apache的网页根目录“/var/www/html/”,重命名为“XOOPS”。
[root@localhost phpMyAdmin]# cp -r /wj/xoops-2.3.3-schinese_utf8/htdocs/ /var/www/html/xoops

3、安装。在浏览器输入“127.0.0.1/xoops”,进入安装界面
       1)选择语言,汉语
        
       2)用户要读一下“安装准备”,以免出错
        
       3)这一步看清楚对php和mysql的版本需求,保证本机的php环境满足要求
        
       4)检测路径
        
       5)设置数据库的用户名和密码,用来连接数据库。
        
       6)设置数据库名称
        
       7)设置管理员账户和密码,用来管理网站
        

4、安装完成后,在管理后台会看见有下面的警告
        

5、移动xoops_lib和xoops_data目录,并修改配置文件。一下的修改是为了消除上面的警告
[root@localhost phpMyAdmin]# mv /var/www/html/xoops/xoops_lib/ /var/www/          移动xoop_lib
[root@localhost phpMyAdmin]# mv /var/www/html/xoops/xoops_data/ /var/www/         移动xoop_data
[root@localhost xoops]# gedit mainfile.php
    // Physical path to the XOOPS library directory WITHOUT trailing slash
    define( 'XOOPS_PATH', '/var/www/xoops_lib' );           //这里一定要按照上面移动的位置来修改
    // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash
define( 'XOOPS_VAR_PATH', '/var/www/xoops_data' );    //这里一定要按照上面移动的位置来修改
[root@localhost xoops]# chmod 444 mainfile.php              //修改这个文件的权限

6、在浏览器输入“127.0.0.1/xoops”,这样就可以访问xoops了。用户名和密码在安装的时候就已经指定了

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表