Articles of freebsd

重写freebsd的sh脚本

我有一个sh脚本: #!/bin/bash fullpath="$1" filename="${fullpath##*/}" dir="${fullpath:0:${#fullpath} – ${#filename}}" base="${filename%.[^.]*}" ext="${filename:${#base} + 1}" if [ -f $fullpath ]; then if [ $ext != "mp4" ]; then ffmpeg -threads 4 -i $fullpath -y -vcodec libx264 -g 100 -bt 100k mp4 -vpre fast -acodec libfaac -ab 128k "$dir$base.mp4" mv -f "$dir$base.mp4" "/data/www/rfpl/htdocs/videotapes/$base.mp4" fi fi 所以我写了Linux,现在我需要在FreeBSD下运行它,但是我对FreeBSD一无所知。 有一个错误: ./convert.sh:$ {fullpath:0 …}:错误的replace。 […]

需要有关resolv.conf的帮助

我的freebsd服务器运行一个名称服务器。 名称服务器具有关于单个域的信息。 一个常见的,我认为,设置一个专用的服务器。 我也有一个上游域名服务器,我想转发所有的请求,不涉及我不服务的域名。 下面是我的/etc/resolv.conf是否正确? 我是新来的,我不是系统pipe理员。 它似乎工作,我不主机的名称得到解决,但有一件事让我困惑,nslookup给出“非权威答案:”警告: $ nslookup yahoo.com Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: Name: yahoo.com Address: 69.147.125.65 Name: yahoo.com Address: 72.30.2.43 Name: yahoo.com Address: 98.137.149.56 Name: yahoo.com Address: 209.191.122.70 Name: yahoo.com Address: 67.195.160.76 请指教。 谢谢康斯坦丁 search bluecherrymedia.com nameserver 127.0.0.1 nameserver 76.73.0.2

如何在Apache服务器上chroot VirtualHosts?

我有一个FreeBSD服务器(公司的首选操作系统)。 目前,我们在每个networking服务器上运行多个网站。 网站是在PHP模式下运行的PHP模块。 在Apache不chrooted所以Apache和PHP可以访问整个文件系统。 对于我的私人网站,我使用共享托pipe服务。 看来服务提供商正在运行一个定制的Apache版本。 有趣的是,服务器上的每个网站(VirtualHost我设定的)都是根据文件根目录。 我将如何去做这个在我的Apache设置? 我已经看了Apache的ChrootDir ,这对我来说已经足够好了,但是在处理VirtualHosts或者我无法正确设置的时候,这个问题还是有的。 虽然它似乎运行良好 – 可以访问VirtualHosts – 似乎有一个问题,当(重新)启动Apache。 我得到了VirtualHosts DocumentRoot的警告。 configuration摘录: ChrootDir "/usr/local/www/apache22/data" DocumentRoot "/" <VirtualHost *:80> DocumentRoot "/test-1" ServerName test-1.example.com </VirtualHost> <VirtualHost *:80> DocumentRoot "/test-2" ServerName test-1.example.com </VirtualHost> 警告是: Warning: DocumentRoot [/test-1] does not exist Warning: DocumentRoot [/test-2] does not exist 而且,启用SSL的问题还有很多。 尽pipe如此,还没有解决这些问题。 所以,我的问题是: 如何将每个VirtualHost chroot到它的DocumentRoot? 如何正确地chroot […]

RAID 10 – 在概念上还是有点不清楚

可能重复: 什么是不同的广泛使用的RAID级别,我应该什么时候考虑他们? 我没有任何麻烦build立更简单的RAIDforms的心理图像,但由于某种原因,当我试图思考10时,我的头旋转。让我走过我的概念: 镜像是显而易见的:N驱动器,每个都有相同数据X的副本。所以对于N = 2,我们有D(isc)0与Xcopy0和D1与Xcopy1。 条带是显而易见的:N驱动器,每个字节的1 / N。 所以对于N = 2,我们有D(isc)0,Stripe0有每个nybble 0,D1有Stripe1,每个nybble有1。 对于10,假设用2比特条纹(即4个盘片),我们需要8个盘片,其中我们镜像D0 + D4,D1 + D5,D2 + D6和D3 + D7,然后条纹D0..D3 (和D4..D7,还是免费的?)。 还是以其他方式工作?

我怎么能强制puppet在freebsd中使用port collection?

我刚刚试过基本的木偶清单,实际需要大约23秒钟才能申请。 root@ovh:/root # cat freebsd.pp package { '*./editors/vim': ensure => installed, } 添加–debug开关之后,清楚地看到每次用pkg_add重新安装vim软件包。 q1)如何迫使傀儡使用端口收集可能与一些portmaster或任何其他港口pipe理工具? q2)这个软件包名称是否也适用于Linux发行版? 或者我应该使用不同的provider两个file条目?

监视脚本的CPU使用情况命令

是否有一个FreeBSD的命令( top -P除外),我可以用它来监视我的专用服务器的CPU使用率? 我正在写我的bash脚本,一旦CPU核心达到100%的使用率就会通知我。 这就是为什么我需要一些其他的命令比top -P因为它需要一些时间来计算在第一次运行的使用率,并不会为每用法命令的工作。

服务器突然停止响应,然后在一小时后恢复

我的FreeBSD服务器已经工作了2年,没有对系统进行任何重大的改变。 最近我使用Apache的mod_ssl安装了SSL证书,经过10天的运行,服务器突然开始崩溃。 当服务器崩溃时: HTTPS和SSH立即变得无法响应 在停止响应之前,PING减慢到数千毫秒 15-60分钟后无法访问: 服务器突然恢复,开始全速工作 – 没有发生任何事情 然后在15-60分钟内再次崩溃,循环重复 我检查了什么: 当我重新启动服务器时,没有任何变化 – 它仍然无法访问 CPU / RAM /硬盘使用情况 – 确定(<50%,包括高峰时间) 交通没有任何影响 – 发生在一天中的任何时间,包括凌晨4点 禁用防火墙没有帮助 在httpd-error.log中我发现: [notice] Digest: generating secret for digest authentication … [notice] Digest: done [notice] Apache/2.2.23 (FreeBSD) mod_ssl/2.2.23 OpenSSL/0.9.8q DAV/2 configured — resuming normal operations [error] server reached MaxClients setting, consider raising the […]

升级到Apache 2.4:VirtualHost命令无效“AssignUserID”

我有很多具有相同configuration的Apache 2.2虚拟主机: <VirtualHost *:80> ServerAdmin [email protected] ServerName site.com ServerAlias www.site.com DocumentRoot /home/site.com/htdocs/ ErrorLog /home/site.com/logs/error.log CustomLog /home/site.com/logs/access.log common AssignUserID site.com ftp <Directory /home/site.com/htdocs/> DirectoryIndex index.html index.htm index.php Options Includes FollowSymLinks SymLinksIfOwnerMatch AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 尝试在Apache 2.4上运行相同的configuration时出现错误: Performing sanity check on apache24 configuration: AH00526: Syntax error on line 8 of /usr/local/etc/apache24/Includes/site.com.conf: […]

在服务器本身上执行nslookup时发生SERVERFAIL错误。 FreeBSD的

我使用FreeBSD来设置DNS服务器。 我已经安装BIND,并在resolv.conf和named.conf文件中设置一切。 这是我的DNS服务器192.168.10.100的IP地址。 在resolv.conf我加了下面一行, nameserver 192.168.10.100 我也在named.conf文件中创build了一个名为.pbv的区域,然后我使用了nsupdate向这个区域添加了一个域.pbv 现在,当我在服务器本身nslookup 192.168.10.100 ,它不起作用,总是返回, ;; Got SERVFAIL reply from 192.168.10.100, trying next server ;; connection timed out; no servers could be reached 但是,当我nslookup testingpbv它返回以下, Server: 192.168.10.100 Address: 192.168.10.100#53 Name: testing.pbv Address: 192.168.10.100 我不明白为什么我不能运行nslookup 192.168.10.100 ? 这是我的resolv.conf nameserver 192.168.10.100 nameserver 8.8.8.8 这里值得一提的是,我甚至无法查找google.com或任何其他外部域名。

通过SSH访问在FreeBSD服务器上设置svn

我不太熟悉这一点,而不是一般的networkingpipe理员,但我试图设置多用户访问本地服务器上的svn存储库。 到目前为止,我已经通过安装颠覆 cd /usr/ports/devel/subversion make install clean 现在我正在考虑如何configuration和设置存储库和访问。 我已经看过这个非常有用的SVN Book,但是我正在寻找FreeBSD特有的任何示例/教程。 访问存储库必须通过SSH。 任何意见,将不胜感激。 谢谢。