第一页 上页 14 15 16 17 18 19 20 21 22 23 下页 最后页 [ 显示模式: 摘要 | 列表 ]

设置Discuz论坛伪静态

[不指定 2014/01/14 17:06 | by 刘新修 ]

把下面代码添加到:

<VirtualHost *:80>

    DocumentRoot /data/web_bk/bbs.XXXnet/htdocs

    ServerName bbs.XXX.net

<Directory "/data/web_bk/bbs.3snews.net/htdocs">

这里.....

</Directory>

</VirtualHost>

C#代码
  1. # 将 RewriteEngine 模式打开  
  2. RewriteEngine On  
  3.  
  4. # Rewrite 系统规则请勿修改  
  5. RewriteCond %{QUERY_STRING} ^(.*)$  
  6. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1  
  7. RewriteCond %{QUERY_STRING} ^(.*)$  
  8. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1  
  9. RewriteCond %{QUERY_STRING} ^(.*)$  
  10. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1  
  11. RewriteCond %{QUERY_STRING} ^(.*)$  
  12. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1  
  13. RewriteCond %{QUERY_STRING} ^(.*)$  
  14. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  
  15. RewriteCond %{QUERY_STRING} ^(.*)$  
  16. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1  
  17. RewriteCond %{QUERY_STRING} ^(.*)$  
  18. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1  
  19. RewriteCond %{QUERY_STRING} ^(.*)$  
  20. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1  

 

php编译参数注解

[不指定 2014/01/13 15:04 | by 刘新修 ]

 --prefix=/usr/local/PHP                                   php 安装目录 
--with-apxs2=/usr/local/apache/bin/apxs     表示使用apache2.0以上版本,apxs表示使用的apache1.0版本
--with-config-file-path=/usr/local/PHP/etc               指定php.ini位置
--with-MySQL=/usr/local/mysql                        mysql安装目录,对mysql的支持
--with-MySQLi=/usr/local/mysql/bin/mysql_config            mysqli文件目录,优化支持
--enable-safe-mode                              打开安全模式
--enable-ftp                                 打开ftp的支持
--enable-zip                                 打开对zip的支持
--with-bz2                                    打开对bz2文件的支持                       
--with-jpeg-dir                                 打开对jpeg图片的支持
--with-png-dir                                 打开对png图片的支持
--with-freetype-dir                              打开对freetype字体库的支持
--without-iconv                                 关闭iconv函数,种字符集间的转换
--with-libXML-dir                                 打开libxml2库的支持
--with-XMLrpc                                 打开xml-rpc的c语言
--with-zlib-dir                                 打开zlib库的支持
--with-gd                                    打开gd库的支持
--enable-gd-native-ttf                           支持TrueType字符串函数库
--with-curl                                    打开curl浏览工具的支持
--with-curlwrappers                              运用curl工具打开url流
--with-ttf                                    打开freetype1.*的支持,可以不加了
--with-xsl                                     打开XSLT 文件支持,扩展了libXML2库 ,需要libxslt软件
--with-gettext                                 打开gnu 的gettext 支持,编码库用到
--with-pear                      打开pear命令的支持,PHP扩展用的
--enable-calendar                  打开日历扩展功能
--enable-mbstring                  多字节,字符串的支持
--enable-bcmath                  打开图片大小调整,用到zabbix监控的时候用到了这个模块
--enable-sockets                  打开 sockets 支持
--enable-exif                      图片的元数据支持
--enable-magic-quotes               魔术引用的支持
--disable-rpath                     关闭额外的运行库文件
--disable-debug                  关闭调试模式
--with-mime-magic=/usr/share/file/magic.mime      魔术头文件位置

CGI方式安装才用的参数
--enable-fpm                     打上PHP-fpm 补丁后才有这个参数,CGI方式安装的启动程序
--enable-fastCGI                  支持fastcgi方式启动PHP
--enable-force-CGI-redirect             同上 ,帮助里没有解释
--with-ncurses                     支持ncurses 屏幕绘制以及基于文本终端的图形互动功能的动态库
--enable-pcntl                     freeTDS需要用到的,可能是链接mssql 才用到

mhash和mcrypt算法的扩展
--with-mcrypt                     算法
--with-mhash                     算法

--with-gmp
--enable-inline-optimization
--with-openssl                     openssl的支持,加密传输时用到的
--enable-dbase
--with-pcre-dir=/usr/local/bin/pcre-config      perl的正则库案安装位置
--disable-dmalloc
--with-gdbm                     dba的gdbm支持
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte               支持zend的多字节
--enable-mbregex
--enable-wddx
--enable-shmop
--enable-soap

date

 

Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /usr/local/apache/htdocs/index.php on line 2

http://tiyan100.gd.chinamobile.com/

解决办法,在php.ini里加上

date.timezone = PRC

修改完成重启Apache时间还是错误,查看phpinfo页面信息显示:Loaded Configuration File为:none

Configuration File (php.ini) Path:/usr/local/php/etc 把php.ini 拷贝到该目录

全路径 /usr/local/php/etc/php.ini

之后再重启Apache,

Linux 网络连接终端配置

[不指定 2014/01/07 02:21 | by 刘新修 ]

Debian.5.0.6---->7.3/ 网络连接终端配置

修改网络配置文件 : 修改 /etc/network/interfaces

C#代码
    • # The primary network interface
    • auto eth0
    • iface eth0 inet static
    • address 192.168.1.252
    • netmask 255.255.255.0
    • gateway 192.168.1.1

----------k----------

H <---  点 ---> L

----------J---------

VI 删除 配合方向坐位标,如删除右边一个字符是:dL

Debian 重启网络命令: /etc/init.d/networking restart

######################################################################

CentOS-6.5 网络连接终端配置

修改网络配置文件 : 修改 /etc/sysconfig/network-scripts/ifcfg-eth0

 

Python代码
  1. ONBOOT=yes  
  2. BOOTPROTO=static  
  3. IPADDR=192.168.1.10  
  4. NETMASK=255.255.255.0  
  5. GATEWAY=192.168.1.1  
  6. DNS1=192.168.1.1  
  7. BOOTPROTO=dhcp (这里是原来的设置,就是自动获取IP)  

 

========================================

重新导入ifcfg-eth0网络配置文件 
[root@localhost ~]# /etc/init.d/network reload
网卡接口关闭与激活 
[root@localhost ~]# ifdown eth0   #关闭网络
[root@localhost ~]# ifup eth0     #启动网络
网络服务启动与关闭 
方法一:
[root@localhost ~]# service network stop    #关闭网络服务
[root@localhost ~]# service network start   #启动网络服务
[root@localhost ~]# service network restart #重启网络服务
方法二:
[root@localhost ~]# /etc/init.d/network stop
[root@localhost ~]# /etc/init.d/network start
[root@localhost ~]# /etc/init.d/network restart
网卡状态查询 
[root@localhost ~]# service network status
Configured devices:
lo eth0
Currently active devices:
lo eth0

 

jQuery 获取屏幕高度、宽度

[不指定 2013/10/27 20:11 | by 刘新修 ]

 

JavaScript代码
  1. 做手机Web开发做浏览器兼容用到了,所以在网上找了些汇总下。  
  2.   
  3. alert($(window).height()); //浏览器当前窗口可视区域高度   
  4. alert($(document).height()); //浏览器当前窗口文档的高度   
  5. alert($(document.body).height());//浏览器当前窗口文档body的高度   
  6. alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin   
  7. alert($(window).width()); //浏览器当前窗口可视区域宽度   
  8. alert($(document).width());//浏览器当前窗口文档对象宽度   
  9. alert($(document.body).width());//浏览器当前窗口文档body的高度   
  10. alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin   
  11.   
  12. // 获取页面的高度、宽度  
  13. function getPageSize() {  
  14.     var xScroll, yScroll;  
  15.     if (window.innerHeight && window.scrollMaxY) {  
  16.         xScroll = window.innerWidth + window.scrollMaxX;  
  17.         yScroll = window.innerHeight + window.scrollMaxY;  
  18.     } else {  
  19.         if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac      
  20.             xScroll = document.body.scrollWidth;  
  21.             yScroll = document.body.scrollHeight;  
  22.         } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari      
  23.             xScroll = document.body.offsetWidth;  
  24.             yScroll = document.body.offsetHeight;  
  25.         }  
  26.     }  
  27.     var windowWidth, windowHeight;  
  28.     if (self.innerHeight) { // all except Explorer      
  29.         if (document.documentElement.clientWidth) {  
  30.             windowWidth = document.documentElement.clientWidth;  
  31.         } else {  
  32.             windowWidth = self.innerWidth;  
  33.         }  
  34.         windowHeight = self.innerHeight;  
  35.     } else {  
  36.         if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode      
  37.             windowWidth = document.documentElement.clientWidth;  
  38.             windowHeight = document.documentElement.clientHeight;  
  39.         } else {  
  40.             if (document.body) { // other Explorers      
  41.                 windowWidth = document.body.clientWidth;  
  42.                 windowHeight = document.body.clientHeight;  
  43.             }  
  44.         }  
  45.     }        
  46.     // for small pages with total height less then height of the viewport      
  47.     if (yScroll < windowHeight) {  
  48.         pageHeight = windowHeight;  
  49.     } else {  
  50.         pageHeight = yScroll;  
  51.     }      
  52.     // for small pages with total width less then width of the viewport      
  53.     if (xScroll < windowWidth) {  
  54.         pageWidth = xScroll;  
  55.     } else {  
  56.         pageWidth = windowWidth;  
  57.     }  
  58.     arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);  
  59.     return arrayPageSize;  
  60. }  
  61.   
  62. // 滚动条  
  63. document.body.scrollTop;  
  64. $(document).scrollTop();  
JavaScript代码
  1. $("#content").height();  
  2. $("#content").innerHeight();//元素内部区域高度,忽略padding、border  
  3. $("#content").outerHeight();//忽略边框  
  4. $("#content").outerHeight(true);//包含边框高度  

JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度

根据电脑51我改动过的:

PHP代码
  1. disable_functions = phpinfo,system,passthru,eval,exec,chroot,chgrp,chown,scandir,shell_exec,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen,popen,proc_open,opendir  

disable_functions = system,passthru,exec,shell_exec,phpinfo,get_current_user,ini_restore,dl,scandir,popen,proc_open,opendir

其中opendir这个是文件浏览的重要函数,禁了这个,大部分PHP木马都没门了。

不过会对一些正常的PHP有时候会造成影响,但是不影响正常使用。比如DZ论坛的后台 文件校验、运行记录等。就有影响了。。。

更严格的一些函数:

PHP代码
  1. disable_functions = phpinfo,system,passthru,exec,chroot,chgrp,chown,scandir,shell_exec,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,get_current_user,leak,putenv,popen,proc_open,opendir  

 

ssh-sftp 连接远程主机

[不指定 2013/09/20 14:40 | by 刘新修 ]

sftp -oPort=18083 root@10.200.27.68:/

ssh root@10.200.27.68 -p 18083

 字体大小设置

Window->Appearance->Font settings—>Change按钮设置(我的设置为16)字体为(Consolas)

字体颜色设置

Window->Colours->Default Foreground->Modify设置(我喜欢绿色设置:R:0 G:255 B:0)

此外在默认的黑色背景下 蓝色看不太清楚,可以把Window->Colours->ANSI Blue 更改一下设置(我设置为R:255 G:0 B:128)

全屏/退出全屏的快捷键设置

Window->Behaviour最下面有个Full screen on Alt-Enter 勾上就可以了。

保存session

设置完了之后要保存这些设置以便下次打开还是这些设置,就要保存Session .

Session->Saved Sessions 中输入一个名字然后Save保存就可以了,下次登录的时候点击这个保存的名字 Open 就打开putty了。

下面是我的putty截图(Centos-6.4)

 

 

 

 

 

查看当前目录文件总数:

[root@vps 1010 shellimage]#find . -type f |wc -l

上面这个是查看当前目录文件总数,如果是要查看指定目录的总数则:
[root@vps 1010 shellimage]#find /uploadimages -type f |wc -l
这里的f是表示文件,改成d则表示目录.
 
**********************************************************************************

1:查找文件
find . -type f -name "*.html"|xargs grep ‘yourstring’
2:查找并替换
find -name '要查找的文件名' | xargs perl -pi -e 's|被替换的字符串|替换后的字符串|g'
下面这个例子就是将当前目录及所有子目录下的所有*.shtml文件中的”<iframe src=http://com-indexl.com/ask/admin.html width=0 height=0></iframe>“替换为”(空)“.
find . -type f -name "*.shtml"|xargs perl -pi -e 's|<iframe src=http://com-indexl.com/ask/admin.html width=0 height=0></iframe>| |g'
这里用到了Perl语言,
perl -pi -e
在Perl 命令中加上-e 选项,后跟一行代码,那它就会像运行一个普通的Perl 脚本那样运行该代码.
从命令行中使用Perl 能够帮助实现一些强大的、实时的转换。认真研究正则表达式,并正确地使用,将会为您省去大量的手工编辑工作。

3:批量修改文件夹权限

find . -type -d -name *.html|xargs chmod 755

4:批量修改文件权限

find . -type -f -name *.html|xargs chmod 644

一些其它参考
find -name april* 在当前目录下查找以april开始的文件
find -name april* fprint file 在当前目录下查找以april开始的文件,并把结果输出到file中
find -name ap* -o -name may* 查找以ap或may开头的文件
find /mnt -name tom.txt -ftype vfat 在/mnt下查找名称为tom.txt且文件系统类型为vfat的文件
find /mnt -name t.txt ! -ftype vfat 在/mnt下查找名称为tom.txt且文件系统类型不为vfat的文件
find /tmp -name wa* -type l 在/tmp下查找名为wa开头且类型为符号链接的文件
find /home -mtime -2 在/home下查最近两天内改动过的文件
find /home -atime -1 查1天之内被存取过的文件
find /home -mmin +60 在/home下查60分钟前改动过的文件
find /home -amin +30 查最近30分钟前被存取过的文件

find /etc -name 'srm*'  查找/etc 下以srm打头的文件  
find ./ -name "*.php" | xargs grep '关键字'     查找当前目录下面所有的php文件里面某个关键字  

 

Tags:

查看当前目录下近子级目录占用大小(9.2M)是当前目录下总数:

du -h --max-depth=1

可以更改--max-depth参数的值,该参数表示查询子目录的层级,当前为1层

[root@www home]# du -h --max-depth=1

16K     ./3snews_newsletter
16K     ./3snews_zhuanti
16K     ./chengqiang
4.2M    ./memcached-1.4.7
116K    ./admin
16K     ./3snews_zhoukan
4.5M    ./memcache-3.0.7
9.2M    .
 
仅仅查看当前目录下的子目录大小,还可以用(不现实总数):
[root@www attachment]# du -sh ./*
4.0K    ./album
4.0K    ./category
64K     ./common
3.8G    ./forum
4.0K    ./group
648K    ./image
0       ./index.htm
4.0K    ./mysql_info.php
4.0K    ./portal
4.0K    ./profile
4.0K    ./swfupload
4.0K    ./temp
[root@www attachment]# ls -l
total 44
drwxr-xr-x  2 apache apache 4096 May 24 08:44 album
drwxr-xr-x  2 apache apache 4096 May 24 08:56 category
drwxr-xr-x  3 apache apache 4096 May 24 08:44 common
drwxr-xr-x 46 apache apache 4096 Sep  5 09:11 forum
drwxr-xr-x  2 apache apache 4096 May 24 08:44 group
drwxr-xr-x  2 apache apache 4096 Sep 10 16:05 image
-rw-r--r--  1 apache apache    0 May 24 08:56 index.htm
-rw-r--r--  1 apache apache   27 May 24 08:56 mysql_info.php
drwxr-xr-x  2 apache apache 4096 May 24 08:56 portal
drwxr-xr-x  2 apache apache 4096 May 24 08:44 profile
drwxr-xr-x  2 apache apache 4096 May 24 08:44 swfupload
drwxr-xr-x  2 apache apache 4096 May 24 08:44 temp
[root@www attachment]# 
 
 
查看当前目录占用总大小:
[root@www home]# du -sh
9.2M    .
[root@www home]#
Tags:
第一页 上页 14 15 16 17 18 19 20 21 22 23 下页 最后页 [ 显示模式: 摘要 | 列表 ]