<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]在 FreeBSD 上彻底禁用 sendmail,禁用freebsd ntpd 时间同步，devd进程禁用开机启动，iftop在Port下的安装，加大SWAP,Freebsd修改hostname。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Sun, 10 Sep 2017 06:32:56 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	vim /etc/defaults/rc.conf&nbsp;&nbsp; 里面有sendmail部分的关闭参数说明，修改一下即可。<br/>sendmail_enable=&quot;NO&quot;&nbsp;&nbsp;&nbsp;&nbsp;# Run the sendmail inbound daemon (YES/NO).<br/><br/>不想重新启动服务器的话（应急措施）∶killall sendmail&nbsp;&nbsp;<br/>/etc/rc.d/sendmail stop<br/>Stopping sendmail.<br/>Waiting for PIDS: 1489.<br/>Cannot &#039;stop&#039; sendmail_msp_queue. Set sendmail_msp_queue_enable to YES in /etc/rc.conf or use &#039;onestop&#039; instead of &#039;stop&#039;<br/>/etc/rc.d/sendmail onestop<br/>sendmail not running? (check /var/run/sendmail.pid).<br/>sendmail_msp_queue not running? (check /var/spool/clientmqueue/sm-client.pid).<br/><br/>cat&nbsp;&nbsp;/etc/rc.conf<br/>hostname=&quot;jackxiang_owncloud_tools_diff_nginx_php_mysql_redis-10-10-0-237&quot;<br/>ifconfig_vtnet0=&quot;inet 10.10.0.*** netmask 255.255.255.0&quot;<br/>defaultrouter=&quot;*.*.0.1&quot;<br/>sshd_enable=yes<br/>syslogd_flags=&quot;-s&quot;<br/>devd_flags=&quot;-s&quot;<br/>sendmail_submit_enable=&quot;NO&quot;&nbsp;&nbsp;<br/>sendmail_outbound_enable=&quot;NO&quot;&nbsp;&nbsp;<br/>sendmail_msp_queue_enable=&quot;NO&quot;<br/><br/><br/><br/>因为Service php-fpm或mysql及nginx出现Freebsd重启不了，于是这样写就Ok了：<br/>vi /etc/rc.conf<br/><textarea name="code" class="php" rows="15" cols="100">
hostname=&quot;jackxiang-owncloud_nginx-php-mysql-redis-47_94_88_237&quot;
sshd_enable=&quot;YES&quot;
dumpdev=&quot;NO&quot;
ifconfig_lo0=&quot;inet 127.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;netmask 255.0.0.0&quot;
ifconfig_vtnet0=&quot;inet 172.17.254.227 netmask 255.255.240.0&quot;
defaultrouter=&quot;172.17.255.253&quot;
sendmail_enable=&quot;NONE&quot;
sendmail_submit_enable=&quot;NO&quot;
sendmail_outbound_enable=&quot;NO&quot;
sendmail_msp_queue_enable=&quot;NO&quot;
ntpd_enable=&quot;NO&quot;
syslogd_enable=&quot;NO&quot;
devd_enable=&quot;NO&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

#fnmpr boot start
/etc/rc.d/redis start
/etc/rc.d/mysqld start
/etc/rc.d/php-fpm start
/etc/rc.d/nginx start
</textarea><br/><br/>/etc/rc.d的启动需要在 /etc/rc.conf里打开，用Service就能启动，前面出问题不知道啥原因：<br/>/etc/rc.d/php-fpm <br/><textarea name="code" class="php" rows="15" cols="100">
sendmail_enable=&quot;NONE&quot;
sendmail_submit_enable=&quot;NO&quot;
sendmail_outbound_enable=&quot;NO&quot; 
sendmail_msp_queue_enable=&quot;NO&quot;
ntpd_enable=&quot;NO&quot;
syslogd_enable=&quot;NO&quot;
devd_enable=&quot;NO&quot;&nbsp;&nbsp; 
</textarea><br/><br/><br/><br/>你可能会因为种种原因而想在 FreeBSD 服务器上彻底禁用 sendmail，那么你可以尝试这样∶<br/><br/>1，如果你不想重新启动服务器的话（应急措施）∶<br/><br/># killall sendmail<br/>2，如果你想让 sendmail 在启动的时候就不做任何行为的话，你需要把以下这几行加入到 /etc/rc.conf 中∶<br/><br/>sendmail_enable=&quot;NONE&quot; <br/>sendmail_submit_enable=&quot;NO&quot; <br/>sendmail_outbound_enable=&quot;NO&quot; <br/>sendmail_msp_queue_enable=&quot;NO&quot;<br/>加入之后需要重新启动服务器让设置生效。<br/><br/><br/>来自：http://www.chinaz.com/server/2010/0226/107257.shtml<br/><br/><br/>=============禁用freebsd ntpd 时间同步================<br/>vi /etc/rc.conf <br/>ntpd_enable=&quot;NO&quot;<br/><br/>1.首先在rc.conf里面添加：ntpd_enable=”YES”。<br/>2.修改/etc/ntp.conf<br/>server 0.freebsd.pool.ntp.org iburst maxpoll 9<br/>server 1.freebsd.pool.ntp.org iburst maxpoll 9<br/>server 2.freebsd.pool.ntp.org iburst maxpoll 9<br/>其他全部注释掉。<br/>3.启动ntpd之前需要手动运行ntpdate pool.ntp.org先同步一下时间，避免因为系统时间与时间服务期时间相差太大导致渐次逼近无法实施而造成的ntpd运行失败。<br/>4.运行/etc/rc.d/ntpd start启动服务。<br/>5.可以通过ntpq -p命令来检查当前ntpd服务状态，注意看输出的表格中st这一项值，必须小于16，16代表无法连接时间服务器，如果都为16，则对时不能完成，需要检查网络原因。<br/>6.ntpd服务需要开放对udp端口123的访问。<br/><br/>来自：http://www.voidcn.com/article/p-ebfmvhcn-ve.html<br/><br/>disable syslogd：<br/>echo syslogd_enable=NO &gt;&gt; /etc/rc.conf<br/><br/>syslogd_enable=&quot;NO&quot;&nbsp;&nbsp;# vi /etc/rc.conf<br/>来自：https://superuser.com/questions/626305/disabling-syslogd-in-freebsd<br/><br/>devd进程禁用开机启动：<br/>devd_enable=&quot;NO&quot; # vi /etc/rc.conf<br/><br/>iftop在Port下的安装：<br/>cd /usr/ports/net-mgmt/iftop/ &amp;&amp; make install clean<br/><br/>Freebsd下面加大SWAP实践OK：<br/><textarea name="code" class="php" rows="15" cols="100">
dd if=/dev/zero of=/swapfile bs=1M count=512
ls -alh /swapfile
chmod 0600 /swapfile
ls -alh /swapfile
tail /etc/rc.conf
reboot
</textarea><br/><br/>/etc/fstab<br/>md99&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swap&nbsp;&nbsp;&nbsp;&nbsp;sw,file=/swapfile,late&nbsp;&nbsp;0&nbsp;&nbsp; 0<br/><br/>手工生效,否则用这个swapinfo -m就会发现只有1M：<br/>mdconfig -a -t vnode -f&nbsp;&nbsp;/swapfile -u 0 &amp;&amp; swapon /dev/md0<br/>swapinfo -m<br/>Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1M-blocks&nbsp;&nbsp;&nbsp;&nbsp; Used&nbsp;&nbsp;&nbsp;&nbsp;Avail Capacity<br/>/dev/md0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;512&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;512&nbsp;&nbsp;&nbsp;&nbsp; 0%<br/>查看新增加的swap是否生效：top<br/>CPU:&nbsp;&nbsp;0.0% user,&nbsp;&nbsp;0.0% nice,&nbsp;&nbsp;0.0% system,&nbsp;&nbsp;0.4% interrupt, 99.6% idle<br/>Mem: 8616K Active, 11M Inact, 45M Wired, 4396K Buf, 1900M Free<br/>Swap: 512M Total, 512M Free<br/>From:http://darren2000.pixnet.net/blog/post/2180080-freebsd%E4%B8%8A%E6%96%B0%E5%A2%9Eswap%E7%A9%BA%E9%96%93<br/>https://www.cyberciti.biz/faq/create-a-freebsd-swap-file/<br/><br/>Freebsd下实时查看各种信息：<br/>systat 能实时查看各种信息<br/>systat -pigs 默认值CPU<br/>systat -iostat 硬盘IO<br/>systat -swap 交换分区<br/>systat -mbufs 网络缓冲区<br/>systat -vmstat 虚拟内存<br/>systat -netstat 网络<br/>systat -icmp ICMP协议<br/>systat -ip IP协议<br/>systat -tcp TCP协议<br/>systat -ifstat 网卡<br/><br/>显示PCI总线设备信息<br/>pciconf -lv<br/>显示内核加载的模块<br/>kldstat -v<br/>显示指定模块<br/>klsdstat -m ipfilter<br/><br/>即插即用设备<br/>pnpinfo<br/><br/>显示设备占用的IRQ和内存地址<br/>devinfo -u<br/><br/>cpu<br/>sysctl -a&#124;grep cpu<br/>sysctl -a&#124;grep sched 查看使用的调度器，我编译的是ULE<br/><br/>虚拟内存<br/>vmstat<br/><br/>硬盘<br/>gstat<br/>systat -iostat<br/>iostat<br/><br/>网卡<br/>ifconfig<br/>systat -ifstat<br/><br/>网络<br/>netstat<br/>sockstat<br/>tcpdump<br/>trafshow<br/>systat -mbufs<br/>systat -icmp<br/>systat -ip<br/>systat -tcp<br/><br/>只是看流量的话，用systat -netstat<br/>https://my.oschina.net/u/187928/blog/37049
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]在 FreeBSD 上彻底禁用 sendmail,禁用freebsd ntpd 时间同步，devd进程禁用开机启动，iftop在Port下的安装，加大SWAP,Freebsd修改hostname。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>