Articles of ubuntu 16.04的

nginx显示200正常状态,但不加载页面

我已经在我的ubuntu 16.04服务器上安装了nginx,php7.0-fpm和mysql。 一切工作正常但是它不加载phpmyadmin的设置页面。 下面是我的phpmyadmin nginx块。 location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/run/php/php7.0-fpm.sock; include fastcgi_params; } } 以下是我的nginx访问日志 /usr/share# tail -f /var/log/nginx/access.log 127.0.0.1 – – [15/Oct/2016:17:13:06 +0530] "GET /phpmyadmin/setup/index.php HTTP/1.1" 200 31 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" 127.0.0.1 – […]

Mongos with –upgrade:我已经停止了平衡器,但是

从Ubuntu 14.x切换到16.x后,我遇到了麻烦。 像configuration服务器,仲裁器和主MongoDB服务器的MongoDB进程运行良好。 我可以用Mongo shell访问我的数据库。 但问题来自mongos。 当我想启动它(使用–upgrade )时,它会崩溃,说运行升级之前必须停止平衡器。 但是,我已经停止了几秒钟! 我用Mongo shell做了: sh.stopBalancer () 然后我用下面的方式validation了状态 sh.getBalancerState () 返回的值是false 。 但是我仍然从mongos得到同样的错误! (平衡器必须停止configuration升级) 之前的几行(在mongos输出中)我得到了这个: 范围连接到xxx没有被返回到池 但我不明白这句话。 我不知道这是否与我的问题有关。 所以最后的问题是:我怎么能成功启动mongos?

Ubuntu 16.04 Systemd不可能使用systemctl

我有一个Ubuntu 16.04服务器,自上次重启后,systemctl不再工作了。 例如,如果我想启动nginx,我得到以下错误: root@SERVER:/# systemctl start nginx Failed to start nginx.service: Unknown unit: nginx.service 每个其他服务的结果都一样。 只是systemctl给出了以下结果: root@SERVER:/# systemctl Failed to list units: No such method 'ListUnitsFiltered' 谢谢 apt autoremove Start-Date: 2016-11-12 20:37:29 Commandline: apt autoremove Remove: linux-image-4.4.0-38-generic:amd64 (4.4.0-38.57), libsnappy1v5:amd64 (1.1.3-2), libboost-program-options1.58.0:amd64 (1.58.0+dfsg-5ubuntu3.1), linux-image-4.4.0-36-generic:amd64 (4.4.0-36.55), libboost-filesystem1.58.0:amd64 (1.58.0+dfsg-5ubuntu3.1), libv8-3.14.5:amd64 (3.14.5.8-5ubuntu2), linux-headers-4.4.0-36-generic:amd64 (4.4.0-36.55), libboost-thread1.58.0:amd64 (1.58.0+dfsg-5ubuntu3.1), linux-headers-4.4.0-34-generic:amd64 (4.4.0-34.53), linux-headers-4.4.0-38-generic:amd64 […]

Apache SSL握手缓慢

我正在运行在Ubuntu 16.04.1 LTS下运行的Apache 2.4.18服务器,只安装了PHP 7和Exim 4。 在清晨,SSL握手非常快,大约200毫秒,但随着时间的推移它增加了(约1小时后),8秒左右。 如果我重新启动Apache,SSL会再次变快,但过了一段时间后又会变慢,返回到8秒,有时会达到30秒。 我configuration了Apache ssh.conf(etc / apache2 / mods-enabled)如下: SSLRandomSeed startup builtin SSLRandomSeed startup file:/dev/urandom 512 SSLRandomSeed connect builtin SSLRandomSeed connect file:/dev/urandom 512 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl SSLPassPhraseDialog exec:/usr/share/apache2/ask-for-passphrase SSLSessionCache shmcb:${APACHE_RUN_DIR}/ssl_scache(512000) SSLSessionCacheTimeout 300 SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS SSLHonorCipherOrder on SSLProtocol all -SSLv3 SSLCompression off SSLSessionTickets off SSLUseStapling on SSLStaplingResponderTimeout 5 […]

无人参与升级日志

我目前分别使用Ubuntu 14.04和Ubuntu 16.04在两台不同的服务器上进行无人值守的升级。 在Ubuntu 16.04中,日志保存在/var/log/unattended-upgrades/unattended-upgrades.log 在Ubuntu 14.04中保存为/var/log/unattended-upgrades/unattended-upgrades-dpkg_yyyy_mm_dd_hh:mm:ss.log 在寻找如何改变这个日志格式,以便在Ubuntu 14.04只有无人值守升级.log我没有find任何东西。 有谁知道我可以如何改变日志的格式? 非常感谢你

Ubuntu 16.04服务器正在监听,但不接受传入的请求

我最近把我的服务器从Ubuntu 14.04升级到了16.04。 升级似乎成功(所以我不知道是否相关),但在重新启动主机一个星期左右,它现在不会接受远程请求。 我可以连接到terminal使用我的托pipe服务提供商的控制台访问,但我不能远程SSH进入机器。 一旦在机器上,我可以ping myhost.com成功,但我不能从远程位置ping机器。 Request timed out请求从我的开发机器请求。 我之前尝试加载之前的快照从我升级我的操作系统,我可以ping机器成功。 我已经尝试了/var/log/auth.log但是当我尝试远程访问时,日志没有更新。 我不知道下一步要尝试找出为什么我的服务器没有响应。 编辑 运行iptables -nvL导致: modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.4.0-28-generic iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.

OCFS2文件系统未安装

在Ubuntu 16.04上,我有一个运行在双主DRBD设置之上的OCFS2集群。 昨天,我推动这个集群投入生产,似乎运行良好。 但今天,这个集群似乎已经死亡。 重新启动节点后,我不再能够挂载ocfs2文件系统。 当我运行: mount.ocfs2 /dev/drbd0 /mnt/drbd 它只是坐在那里等待和等待,但它没有安装。 OCFS2似乎运行良好,看着dmesg -H输出: [+12.308685] ocfs2:注册集群接口o2cb [+0.012233]加载OCFS2用户DLM内核接口 [Feb24 14:34] o2net:连接到节点edmure(num 0)在192.168.2.11:7777 [+4.092023] o2dlm:join域CCEFD26343174950A6BEF9A2F83B6735(0 1)2个节点 它正确连接到LAN上的其他节点并join域。 DRBD资源也正常运行,没有任何问题: % cat /proc/drbd version: 8.4.5 (api:1/proto:86-101) srcversion: 2A6B2FA4F0703B49CA9C727 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r—– ns:403 nr:4529 dw:4932 dr:1006 al:1 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 但是,如果我运行mount命令,它只是挂起。 每两分钟,我在dmesg输出中得到这个消息: [+23.059786] INFO:任务mount.ocfs2:1788被阻塞超过120秒。 […]

几分钟后RTC时间完全错了(Ubuntu 16.04 + Hyper-V)

我在Ubuntu 16.04上的RTC时间正在疯狂。 几分钟后,RTC时间将会大错特错。 奇怪的是,如果我禁用NTP服务(timedatectl set-ntp false和service ntp stop)并修复一次(hwclock -w),则RTC时间总是正确的。 当地时间(真正正确的时间)总是正确的。 我的configuration: 具有正确的ntp时间的具有Hyper-V(Windows Server 2012 R2)的根服务器。 Hyper-V VM设置中的时间同步被禁用。 (否则,我在/ var / log / syslog中每5秒收到一次“Time has been changed”消息) 游客:Ubuntu 16.04 没有NTP服务: timedatectl Local time: Fri 2017-03-03 12:07:35 CET Universal time: Fri 2017-03-03 11:07:35 UTC RTC time: Fri 2017-03-03 11:07:35 Time zone: Europe/Berlin (CET, +0100) Network time on: […]

OpenNMS系统日志集成

我正在尝试configurationOpenNMS以接收来自ASA的Syslog消息。 我的syslogdconfiguration文件如下所示: <configuration syslog-port="514" new-suspect-on-message="false" parser="org.opennms.netmgt.syslogd.CustonSyslogParser" forwarding-regexp="((.+?) (.*))\r?\n?$" matching-group-host="2" matching-group-message="3" /> 系统日志消息以这种格式到达: Sep 13 08:36:37 192.168.75.254 %ASA-4-106023: Deny tcp src outside:144.5.5.255/ 56607 dst inside:192.168.75.102/23 by access-group "outside_access_in" [0x0, 0x0] 有了这个configuration,我可以将系统日志消息放入Opennms中,但它们通过的方式是不确定的。 似乎这个正则expression式不能parsing。 当我在regex101.com等其他网站上testing这个正则expression式时,它清楚地表明没有匹配。 我创build了一个符合我需要的正则expression式: \b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*([\s\S]*) 但是当我把这个添加到configuration,我不再有任何系统日志消息。 有没有人有我如何做到这一点的想法。 我花了太多的时间在这个上。

将htaccess转换成Nginx重写规则

我需要将.htaccessredirect转换为Nginx conf。 这是.htaccess Redirect 301 /wp-content/plugins/zendesk-for-woocommerce/api/redirect-test1.html /wp-content/plugins/zendesk-for-woocommerce/api/redirect-test2.html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L] DirectoryIndex index.html index.htm index.php index.shtml 这里是我的Nginxconfiguration的相关部分 location / { root /var/www/vhosts/sitename/httpdocs; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; } 根据我在网上find的指南,我把它改为: location / { root /var/www/vhosts/sitename/httpdocs; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; if (!-e $request_filename){ rewrite ^(.*)$ […]