Articles of centos

脚本expression式获取string的一部分?

我在CentOS中使用了bash shell,版本… $ uname -a Linux mydomain.com 3.2.29-48.63.amzn1.x86_64 #1 SMP Sat Sep 15 01:43:12 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux 在我的shell脚本中,我想获得一个string的一部分,特别是最后一个短划线(“ – ”)之前的所有内容。 所以如果我的string是“my-importer-1.0.ear”,我想提取“my-importer”。 但是,下面的expression prefix=${fname%-*} 只是返回“我的”,因为它与第一个短划线相匹配。 如何调整expression式以匹配所有内容,直到最后一个短划线?

多个站点的虚拟文件夹

我正在为小型(多语言)网站创build一个非常简单的平面文件CMS。 继续进行的小文件处理由每个名为/edit站点中的公共可用文件夹中的4个脚本处理。 鉴于我有2个网站现在在这个简单的系统上工作: websiteA/index.php (etc) websiteA/edit/ websiteB/index.php (etc) websiteB/edit/ 使这个/edit文件夹“虚拟”的最好方法是让这些和每个后续的网站所有者可以login到他们的视图/edit ,而代码只存在于一个地方。 我不希望网站所有者必须从中心网站login,而是从他们自己的/edit目录login。 我已经在每个网站的httpd.conf声明中看到了使用<Directory>指令的不同解决scheme,同时也使用了直接的mod_rewrite,但是现在却对某些术语感到困惑。 每个网站都有自己的configuration文件,其中包含path设置等。 你认为什么是处理这个问题的最好方法? 编辑根据回复,我想这给了一个虚拟的主机指令,如: <VirtualHost 00.00.00.00:80> DocumentRoot /var/www/html/websitea.com ServerName www.websitea.com ServerAlias websitea.com DirectoryIndex index.htm index.php CustomLog logs/websitea combined </VirtualHost> 是否有可能在文件夹websitea.com/edit的该指令中创build一个别名?

KVM guest虚拟机的networking性能不佳

我有一个专用的服务器连接到1000 Mbit的端口。 但是,Debian客户只能获得1/4的速度: 在节点本身(Linux节点2.6.32-279.9.1.el6.x86_64#1 SMP周二9月25日21:43:11 UTC 2012 x86_64 x86_64 x86_64 GNU / Linux): wget http://www.bbned.nl/scripts/speedtest/download/file1000mb.bin -O /dev/null –2012-11-11 23:10:11– http://www.bbned.nl/scripts/speedtest/download/file1000mb.bin Resolving www.bbned.nl… 62.177.144.181 Connecting to www.bbned.nl|62.177.144.181|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 1048576000 (1000M) [application/octet-stream] Saving to: â/dev/nullâ 100%[====================================>] 1,048,576,000 100M/s in 10s 2012-11-11 23:10:21 (100 MB/s) – â/dev/nullâ 在客户端(Debian 6.0.5,x64:Linux debian […]

内部服务器错误phpMyAdmin与suPHP

我最近在我们的专用服务器上安装了phpMyAdmin。 它工作正常,直到我们有磁盘空间已满,不得不移动/新的分区。 现在我们在访问xxxx.xx.xxxx.xxxx / phpMyAdmin /或domain.com/phpMyAdmin/时出现以下错误,我们得到内部服务器错误。 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this […]

Cenros 6.3安装php-imap cross-repo失败

我正尝试在Centos 6.3上安装php-imap支持 yum install php-imap 由于回购安装失败有不同的PHP版本: Resolving Dependencies –> Running transaction check —> Package php-imap.x86_64 0:5.3.3-14.el6_3 will be installed –> Processing Dependency: php-common = 5.3.3-14.el6_3 for package: php-imap-5.3.3-14.el6_3.x86_64 –> Processing Dependency: libc-client.so.2007()(64bit) for package: php-imap-5.3.3-14.el6_3.x86_64 –> Running transaction check —> Package libc-client.x86_64 0:2007e-11.el6 will be installed —> Package php-imap.x86_64 0:5.3.3-14.el6_3 will be installed –> Processing […]

SNMP在CentOS中closures状态

我在这里有一个问题,我已经添加到我的IPtables规则这个: -A INPUT -p tcp -m state –state NEW -m tcp –dport 161 -j ACCEPT -A INPUT -p udp -m state –state NEW -m udp –dport 161 -j ACCEPT 但是当我用nmap或任何其他工具扫描它说: Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 161/tcp closed snmp 另外当我在做: netstat -apn | grep snmpd tcp 0 0 127.0.0.1:199 0.0.0.0:* […]

MySQL:已经安装,但依然在一个较低版本的依赖列表

我试图在我的CentOS服务器上安装GDAL ,以便能够进行一些GIS操作,但是我有很多MySQL的问题,我无法弄清楚… 这是我试过的命令,没有成功。 我试过一个简单的: # yum install gdal 首先, GDAL版本是1.4(最后发布的版本是1.9) 然后, 我在依赖项列表中看到mysql 。 但我已经从另一个存储库( remi ),已经安装了一个比由yumbuild议的版本更新的版本的mysql …这是一个架构的问题(百胜build议i386)? 我冒着一个是的 ,但仍然不可能安装它! 这是我的错误。 Transaction Check Error: package mysql-5.5.28-1.el5.remi.x86_64 (which is newer than mysql-5.0.95-1.el5_7.1.i386) is already installed 然后,我尝试从最新版本(1.9.2)的源代码安装它。 我下载了GDAL tar.gz,解压缩了这些文件,并像下面这样安装它: # tar -xzf gdal-1.9.2.tar.gz # ./configure –with-static-proj4=/usr/local/lib –with-threads –with-libtiff=internal –with-geotiff=internal –with-jpeg=internal –with-gif=internal –with-png=internal –with-libz=internal # make # make install […]

后缀:中继访问被拒绝

由于我找不到可以与我的configuration一起使用的解决scheme,所以我依靠你们来帮助我解决这个问题。 我在CentOS服务器上安装了postfix和dovecot。 一切运行良好。 但是,当我尝试从Outlook发送电子邮件到tld不是.com,服务器返回: 中继访问被拒绝。 这是postconf -n命令的结果 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_protocols = all mailbox_size_limit = 104857600 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 20971520 mydestination = $myhostname, $mydomain, localhost, localhost.$mydomain […]

/ etc /意外删除在centos中

我的服务器没有启动,因为里面没有/etc/文件夹。 看起来它已被意外删除。 我的主人告诉我通过KVM控制台启动操作系统的救援光盘来重新安装操作系统。 在KVM控制台中,我坚持屏幕截图,我无法发布,因为我在这里没有足够的声誉。 请告诉我如何通过KVM控制台修复我的Centos 5 64位,因为我不想丢失/home/文件夹,因为不幸的是我没有最近的备份。

升级到5.3.19和memcached停止工作

我有一个服务器与centos 6.3和cPanel 从PHP 5.3.16升级到PHP 5.3.19后,我的网站停止工作。 当我尝试手动执行index.php ,我收到以下错误。 php:符号查找错误:/usr/local/lib/php/extensions/no-debug-non-zts-20090626/memcached.so:undefined symbol:memcached_last_error_errno 通过pecl和手动重新安装memcached和memcache,但没有帮助。 什么是造成这个问题,我该如何解决?