Articles of ubuntu 16.04的

启动Ubuntu 16系统服务

我有一个Ubuntu 16.04机器。 我写了一个非常简单的系统服务。 这样做的目的是创build一个服务,一旦启动过程完成并运行一个python脚本就会启动。 如果python脚本崩溃,它也应该重新启动python脚本。 这是我的systemd脚本的样子。 [Unit] Description=My Python Script Requires=multi-user.target After=multi-user.target [Service] Type = forking WorkingDirectory=/path/to/my/python/script/ ExecStart=/usr/bin/python /path/to/my/python/script/mypythonscript.py Restart=always [Install] WantedBy=multi-user.target 这个脚本是使用这个教程编写的。 我跟着那里的台阶改了名字。 我现在有一个服务,我可以手动统计。 如果我做sudo service myservice start我能够开始我的服务。 但是,该服务在机器启动时不启动。 它需要手动启动。 你知道我怎么能解决这个问题吗? 在Ubuntu 16.04操作系统启动后,启动服务的正确方法是什么? 谢谢!

phpMyAdmin和Apache – 查询string – 404错误

当phpMyAdmin尝试访问URL为https://example.com/phpmyadmin/server_variables.php&filter=long_query_time时 ,Apache将引发404错误。 可能是什么问题? The requested URL /phpmyadmin/server_variables.php&filter=long_query_time was not found on this server. Apache/2.4.27 (Ubuntu) Server at example.com Port 443 当我改变& ? ,一切都像魅力一样工作。 我的phpmyadmin.conf如下所示: Alias /phpmyadmin "/usr/share/phpmyadmin" <Directory "/usr/share/phpmyadmin"> DirectoryIndex index.php AllowOverride All Options FollowSymlinks Require all granted </Directory> /usr/share/phpmyadmin .htaccess如下所示: AuthType Basic AuthName "Restricted access!" AuthUserFile /usr/share/phpmyadmin/.htpasswd Require valid-user phpMyAdmin版本是:4.7.3

无法收到电子邮件后缀Ubuntu

我无法接收电子邮件,但发送他们工作正常 卡在下一步做什么如果任何人都可以指出这个错误或指出我在正确的方向,将不胜感激。 后缀main.cf文件 smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/ssl/certs/dlcincluded.crt smtpd_tls_key_file=/etc/ssl/private/dlcincluded.key smtpd_use_tls=yes smtp_tls_security_level = may smtpd_tls_security_level = may smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache milter_default_action = accept milter_protocol = 2 smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, check_relay_domains smtpd_data_restrictions = reject_unauth_pipelining myhostname = […]

Linux的IP表在Access.log上转发松散的源IP

球队, 我们已经在eth1(public IP xxxx)接口上向其他服务器configuration了带有转发请求的IP表。 我们可以转发所有的请求,但是问题是在服务器192.168.254.X上丢失了来源公共IP(用户的来源IP) 请在下面findconfiguration: # Generated by iptables-save v1.6.0 on Wed Sep 13 12:19:51 2017 *nat :PREROUTING ACCEPT [0:0] :INPUT ACCEPT [0:0] :OUTPUT ACCEPT [8:827] :POSTROUTING ACCEPT [0:0] -A PREROUTING -d 192.168.254.142/32 -i eth1 -p tcp -m tcp –dport 80 -j DNAT –to-destination 192.168.254.89 -A PREROUTING -d 192.168.254.142/32 -i eth1 -p tcp -m […]

连接在端口8100上被拒绝

从远程浏览器访问端口8100上的侦听服务(Ionic)时遇到困难。 我在Ubuntu 16.04 LTS服务器上安装了iptables,设置如下: -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -s 127.0.0.0/8 ! -i lo -j REJECT –reject-with icmp-port-unreachable -A INPUT -p icmp -m state –state NEW -m icmp –icmp-type 8 -j ACCEPT -A INPUT -p tcp -m tcp –dport 22 -m state –state […]

调整apache2提供tomcat web应用程序在域没有超时

我有一个托pipe在Ubuntu 16.04的非托pipeVPS服务器上的域我已经configuration了我的Java EE Tomcat Web应用程序在我的域名。 但是,应用程序的响应时间太慢,逐渐趋向于浏览器中的超时。 如果我停止apache2服务,并通过域名访问我的web应用程序:8080的web应用程序的性能是完美的。 你如何正确configurationapache2提供良好的性能的域名的tomcatnetworking应用程序? 我意识到,简单的解决scheme是链接到我的web应用程序的所有引用到域:8080,但我想知道如何正确configurationapache2提供的域名与Tomcat的web应用程序相同的性能使用域:8080 。 在此先感谢您的帮助。 这是我的apache2网站可用的文件的域名: <VirtualHost *:80> # Admin email, Server Name (domain name) and any aliases ServerAdmin [email protected] ServerName lae-laeweb.com ServerAlias www.lae-laeweb.com # Index file and Document Root (where the public files are located) DirectoryIndex index.html DocumentRoot /var/www/html # Custom log file locations LogLevel warn ErrorLog /var/log/apache2/error-lae-laeweb.com.log […]

经过一段时间的正确工作PHP不能执行任何系统命令

我正在设置一个新的Web服务器。 我在ubuntu 16.04上用php-fpm有NGINX。 除了一件事以外,一切都很好:经过2-3天的正确工作PHP不能运行任何外部系统命令。 当我说“系统命令”时,我的意思是什么? 例如,当我运行函数shell_exec参数'whoami' echo shell_exec('whoami'); 我得到以下 警告:shell_exec():无法执行'whoami' 而PHP脚本试图执行的每个Linux命令都会发生这种情况 当我试图使用邮件()函数发送邮件时,我收到类似的错误 警告:邮件():无法执行邮件传送程序'/ usr / sbin / sendmail -t -i' 只有当我从浏览器运行PHP脚本时才会发生。 如果我尝试从terminal运行它像这样 sudo -u www-data php /path/to/my/script.php 那么一切正常。 再次说明:只有经过一段时间的正确工作,问题才会出现,并在VDS重新启动后消失(一段时间)。 只有当我从浏览器运行脚本,这意味着它由NGINX服务。 请帮我find解决我的问题。 PS日志:Php错误日志 [27-Aug-2016 04:19:37 Europe/Moscow] PHP Fatal error: Uncaught Error: Call to a member function is_logged() on null in /home/serv/www/templates/page_parts/header_tpl.php:6 Stack trace: #0 /home/serv/www/templates/index_tpl.php(9): require() […]

pfSense DMZ VMware和Ubuntu 16.04.1 LTS

在VMware环境中,网关(pfSense DMZ)和Ubuntu服务器16.04.1 LTS之间存在连接问题(无法ping通)。 Pfsense从LAN子网192.168.1.0/24正常工作,但不是从DMZ子网10.10.10.0/24 我认为我已经正确configuration了防火墙的一面(pfsense),但是对于VMware来说是新的,所以我想我可能会在VMware环境和/或Ubuntu服务器中丢失一些东西? Ubuntu服务器有一个IP地址10.10.10.6 pfSense webdmz网关有一个IP地址10.10.10.3 纵观vSwitch2(局域网)上的拓扑,我在vmnic5上连接一台电脑,我可以上网没有问题。 但是在vSwitch3(WEBDMZ)上,我无法ping 10.10.10.6到10.10.10.3,反之亦然。 有人遇到过同样的问题吗? 拓扑结构: 防火墙DMZconfiguration和ubuntu界面:

networking更新到Ubuntu 16.04后不工作

我从Ubuntu 14.04更新了一个服务器到16.04。 正如所料,我不得不重新命名我的networking接口fron eth0等eno1 ,但是,在两个接口(一个“内部”和一个“外部”),只有一个(内部)工作。 我也有一个kvm桥configuration,所以内部接口运行桥。 的/ etc /networking/接口: auto eno1 iface eno1 inet manual auto br1 iface br1 inet static address yyy.yyy.yyy.2 netmask 255.255.255.0 gateway yyy.yyy.yyy.254 bridge_waitport 30 bridge_ports eno1 bridge_fd 1 bridge_stp off bridge_maxwait 3330 auto eno2 iface eno2 inet static address xxx.xxx.xxx.169 netmask 255.255.255.248 broadcast xxx.xxx.xxx.175 gateway xxx.xxx.xxx.174 由于我突然遇到第二个网关(RTNETLINK答案:文件存在)的问题,我手动定义了路由 ip路由显示: default via […]

Apache DocumentRoot Ubuntu虚拟主机

我对Ubuntu 16.4上的Apache服务器上的虚拟主机的设置感到困惑。 我没有按照这个指示在Ubuntu上安装Processmaker。 一切工作正常,但如果我访问我的网站: http : //process.koina.eu : 8080我只看到/var/www/html/index.html下的默认Apache文件。 但是我的过程控制器位于/ opt / processmaker下的指令中。 在日志中一切似乎运行良好。 问题是我的pmos.conf没有被添加/识别到Appacheconfiguration。 当我运行“sudo a2ensite pmos.conf”或a2dissite命令并重新启动服务器时,这并没有什么区别。