python manager.py runserver 127.0.0.1:8001…
一台MySQL服务器启动多个端口 在测试Mysql多主一从服务器,即一个从服务器多端口同步不同主库.本文记录了开启不同端口的操作. 详细步骤: 1.首先要先把my.cnf配置文件复制一份,开几个端口要复制几份当然要重新命名. 如: cp /etc/my.cnf /etc/my3306.cnf cp /etc/my.cnf /etc/my3307.cnf cp /etc/my.cnf /etc/my3308.cnf 2.修改my_1.cnf my_2.cnf my_3.cnf文件把默认的3306端…
这篇文章主要介绍了linux下通过iptables只允许指定ip地址访问指定端口的设置方法,需要的朋友可以参考下. 首先,清除所有预设置 iptables -F#清除预设表filter中的所有规则链的规则 iptables -X#清除预设表filter中使用者自定链中的规则 其次,设置只允许指定ip地址访问指定端口 其次,设置只允许指定ip地址访问指定端口 iptables -A INPUT -s xxx.xxx.xxx.xxx -p tcp --dport 22 -j ACCEPT iptab…
apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for 在RedHat Linux 5 与 CentOS 5服务器上配置好apache后,启动或者关闭时总要报个错: httpd: apr_sockaddr_info_get() failed for XX(主机名) httpd: Could not reliably determine the server's fully qualified domain name, using 127.0…
package com.ripsoft.util; import java.util.Calendar; import java.util.Timer; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class TimerListener implements ServletContextListener{ private Timer timer = nu…
如果要想让 servlet 的 init () 方法在服务器启动 时就被执行,则需要在 web.xml 中相应的 servlet 下配置 <servlet > <servlet -name>test</servlet -name> <servlet -class>com.zzk.test.MyServlet</servlet -class> <load-on-startup>1</load-on-startup> <…
[root@MSJTVL-MJSP-A01 sm01]# vim /etc/rc.d/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /v…
前言:其实配置文件不随服务器启动时加载也是可以的,但是这样操作的话,每次获取相应对象,就会去读取一次配置文件,从而降低程序的效率,而Spring中已经为我们提供了监听器,可监听服务器是否启动,然后在启动时,加载spring的配置文件,并且只加载一次,从而提高程序效率. 实现:其配置需要在web.xml中进行,具体实现如下: <!--配置监听器 --> <!--以便在服务器启动的时候,加载spring配置文件--> <listener> <listener-clas…
springboot打包时,去掉资源文件 <build> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>*.properties</exclude> <exclude>*.xml</exclude> </excludes> </resource&g…
django项目启动时,自定义执行某个py文件 在任意的app下的apps.py中的Config类下自定义ready()方法,并且调用autodiscover_modules. app01/apps.py from django.apps import AppConfig from django.utils.module_loading import autodiscover_modules class App01Config(AppConfig): name = 'app01' def rea…