清风如月

洗衣做饭,样样会干。上得厅堂,下得卧房,通得了厕所,打得死蟑螂,写得了代码,补得了裤衩~~~

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  apache/nginx

网站服务器软件的配置和使用技巧
摘要:1 #!/bin/bash 2 # 3 # httpd Startup script for the Apache HTTP Server 4 # 5 # chkconfig: - 85 15 6 # description: The Apache HTTP Server is an ... 阅读全文
posted @ 2015-12-23 16:50 清风如月 阅读(311) 评论(0) 推荐(0)

摘要:比如192.168.16.116是我的服务器地址,域名是www.demo.com,我想只允许用户通过域名访问,而不允许用户通过ip访问,所有通过ip访问的都跳转到域名,第一个server部分为起作用的配置代码nginx配置如下:server { server_name 80 default; server_name _; rewrite ^(.*) http://www.demo.com; }server { server_name localhost www.demo.com; root /usr/share... 阅读全文
posted @ 2014-02-18 20:28 清风如月 阅读(8391) 评论(0) 推荐(0)

摘要:linux菜鸟,遇到一问题,php连接mssql,获取的结果中文乱码,pdo_dblib扩展使用的是apt-get install php5-sybase方法安装的,尝试了修改freetds.conf php.ini 文件编码 页面编码以及系统字符集都没有解决问题,在freetds客户端下也是乱码,折腾了n多天,没有搞定,最后得知编译安装可以解决此问题,于是尝试编译搭建环境(主要是不知道apt搭建的环境能不能编译安装扩展),下载了freetds(慢的雷人啊,这是的网盘分享http://pan.baidu.com/share/link?shareid=217028745&uk=14262 阅读全文
posted @ 2013-08-28 10:18 清风如月 阅读(5000) 评论(0) 推荐(0)

摘要:1 server { 2 listen 80; 3 server_name www.phpno.com; 4 root /home/www/www_phpno_com/admin_wwwroot; 5 access_log off; 6 error_page 404 /404.html; 7 location /404.html { 8 root /home/www/www_phpno_com/admin_wwwroot; 9 }10 ... 阅读全文
posted @ 2013-05-13 16:05 清风如月 阅读(488) 评论(0) 推荐(0)

摘要:在ubuntu13.04上使用apt方式安装nginx发现无法启动nginx,也不报错查看nginx运行状态,显示未启动搜索无果,想起了原来的遇到的一个问题,那时候是安装了nginx和lighthttpd服务器,导致nginx无法启动的情况,提示端口被占用,于是拆卸lighthttpd,启动nginx正常,但是访问localhost提示无法访问,排查获知是在nginx中的配置文件是有这么一句:listen [::]:80 default_server ipv6_only=on;使用了ipv6的地址,把这句注释掉,可以访问。试了一下,无法启动的问题解决了。相关资料可以参考ubuntu中文官方:h 阅读全文
posted @ 2013-05-08 10:17 清风如月 阅读(5615) 评论(0) 推荐(0)

摘要:原来的代码如下:View Code 1 # You may add here your 2 # server { 3 # ... 4 # } 5 # statements for each of your virtual hosts to this file 6 7 ## 8 # You should look at the following URL's in order to grasp a solid understanding 9 # of Nginx configuration files in order to fully unleash the pow... 阅读全文
posted @ 2013-05-04 17:16 清风如月 阅读(293) 评论(0) 推荐(0)

摘要:需要在虚拟主机配置文件中添加localhost的指向,如<VirtualHost *:80> DocumentRoot "D:\domain" ServerName localhost</VirtualHost>另外,请注意,DocumentRoot路径后面不要加\或/ 阅读全文
posted @ 2013-04-27 14:49 清风如月 阅读(380) 评论(0) 推荐(0)

摘要:使用gzip提高页面载入速度. apache下开启gzip模块并配置压缩规则,在文件发送前将文件压缩,客户端收到的是压缩后的文件,接着客户端将收到的压缩文件解压缩,页面载入速度得到优化 阅读全文
posted @ 2012-08-06 11:21 清风如月 阅读(4879) 评论(0) 推荐(0)