Linux 基于端口的虚拟主机配置

来源:互联网 发布:php ajax实例 编辑:程序博客网 时间:2024/06/11 16:34

[whch@localhost 桌面]$ cd/mnt/cdrom

[whch@localhost cdrom]$ ll

总用量 0

[whch@localhost cdrom]$ mount /dev/cdrom/mnt/cdrom

mount: only root can do that

[whch@localhost cdrom]$ su root

密码:

[root@localhost cdrom]# mount /dev/cdrom/mnt/cdrom

mount: block device /dev/sr0 iswrite-protected,

mounting read-only

[root@localhost cdrom]# ll

总用量 0

[root@localhost cdrom]# cd /mnt/cdrom

[root@localhost cdrom]# ll

总用量 3885

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011 EFI

-r--r--r--. 3 whch whch   8794 9月  2 2010 EULA

-r--r--r--. 3 whch whch  18092 6月 29 2010 GPL

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011

HighAvailability

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011 images

dr-xr-xr-x. 2 whch whch   2048 11月 17 2011 isolinux

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011

LoadBalancer

-r--r--r--. 2 whch whch    114 11月 17 2011 media.repo

dr-xr-xr-x. 2 whch whch 649216 11月 17 2011Packages

-r--r--r--. 2 whch whch  16435 9月  2 2010 README

-r--r--r--. 3 whch whch 172833 11月 15 2011RELEASE-

NOTES-as-IN.html

-r--r--r--. 3 whch whch 178359 11月 15 2011RELEASE-

NOTES-bn-IN.html

-r--r--r--. 3 whch whch 109593 11月 15 2011RELEASE-

NOTES-de-DE.html

-r--r--r--. 3 whch whch 101919 11月 15 2011RELEASE-

NOTES-en-US.html

-r--r--r--. 3 whch whch 109920 11月 15 2011RELEASE-

NOTES-es-ES.html

-r--r--r--. 3 whch whch 114396 11月 15 2011RELEASE-

NOTES-fr-FR.html

-r--r--r--. 3 whch whch 166662 11月 15 2011RELEASE-

NOTES-gu-IN.html

-r--r--r--. 3 whch whch 168104 11月 15 2011RELEASE-

NOTES-hi-IN.html

-r--r--r--. 3 whch whch 108343 11月 15 2011RELEASE-

NOTES-it-IT.html

-r--r--r--. 3 whch whch 123332 11月 15 2011RELEASE-

NOTES-ja-JP.html

-r--r--r--. 3 whch whch 189916 11月 15 2011RELEASE-

NOTES-kn-IN.html

-r--r--r--. 3 whch whch 111469 11月 15 2011RELEASE-

NOTES-ko-KR.html

-r--r--r--. 3 whch whch 200245 11月 15 2011RELEASE-

NOTES-ml-IN.html

-r--r--r--. 3 whch whch 172372 11月 15 2011RELEASE-

NOTES-mr-IN.html

-r--r--r--. 3 whch whch 168580 11月 14 2011RELEASE-

NOTES-or-IN.html

-r--r--r--. 3 whch whch 152138 11月 15 2011RELEASE-

NOTES-pa-IN.html

-r--r--r--. 3 whch whch 108164 11月 15 2011RELEASE-

NOTES-pt-BR.html

-r--r--r--. 3 whch whch 112882 11月 15 2011RELEASE-

NOTES-ru-RU.html

-r--r--r--. 3 whch whch   5125 5月  4 2010 RELEASE-

NOTES-si-LK.html

-r--r--r--. 3 whch whch  84168 4月 20 2011 RELEASE-

NOTES-ta-IN.html

-r--r--r--. 3 whch whch 180112 11月 15 2011RELEASE-

NOTES-te-IN.html

-r--r--r--. 3 whch whch 203953 11月 15 2011RELEASE-

NOTES-zh-CN.html

-r--r--r--. 3 whch whch 197545 11月 15 2011RELEASE-

NOTES-zh-TW.html

dr-xr-xr-x. 2 whch whch   4096 11月 17 2011 repodata

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011

ResilientStorage

-r--r--r--. 3 whch whch   3375 11月  8 2011 RPM-GPG-

KEY-redhat-beta

-r--r--r--. 3 whch whch   3211 11月  8 2011 RPM-GPG-

KEY-redhat-release

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011

ScalableFileSystem

dr-xr-xr-x. 3 whch whch   2048 11月 17 2011 Server

-r--r--r--. 1 whch whch   9435 11月 17 2011 TRANS.TBL

[root@localhost cdrom]# cd Server

[root@localhost Server]# ll

总用量 135

-r--r--r--. 2 whch whch 132839 11月 17 2011listing

dr-xr-xr-x. 2 whch whch   4096 11月 17 2011 repodata

-r--r--r--. 1 whch whch    439 11月 17 2011 TRANS.TBL

[root@localhost Server]# cd Packages

bash: cd: Packages: 没有那个文件或目录

[root@localhost Server]# cd ../

[root@localhost cdrom]# cd Packages

[root@localhost Packages]# find http*

httpd-2.2.15-15.el6.x86_64.rpm

httpd-devel-2.2.15-15.el6.i686.rpm

httpd-devel-2.2.15-15.el6.x86_64.rpm

httpd-manual-2.2.15-15.el6.noarch.rpm

httpd-tools-2.2.15-15.el6.x86_64.rpm

[root@localhost Packages]# rpm -ivhhttpd-2.2.15-

15.el6.x86_64.rpm

warning: httpd-2.2.15-15.el6.x86_64.rpm:Header V3

RSA/SHA256 Signature, key ID fd431d51:NOKEY

Preparing...                                           

              

###########################################[100%]

        packagehttpd-2.2.15-15.el6.x86_64 is already

installed

[root@localhost Packages]# rpm -q httpd

httpd-2.2.15-15.el6.x86_64

[root@localhost Packages]# cd /var/www

[root@localhost www]# mkdir 20151514217

[root@localhost www]# mkdir whc

[root@localhost www]# ll

总用量 24

drwxr-xr-x. 2 root root 4096 10月 26 20:1920151514217

drwxr-xr-x. 2 root root 4096 10月  6 2011 cgi-bin

drwxr-xr-x. 3 root root 4096  9月  9 12:15 error

drwxr-xr-x. 2 root root 4096 10月  6 2011 html

drwxr-xr-x. 3 root root 4096  9月  9 12:15 icons

drwxr-xr-x. 2 root root 4096 10月 26 20:20whc

[root@localhost www]# vi20151514217/index.html

[root@localhost www]# vi whc/index.html

[root@localhost www]# vi/etc/httpd/conf/httpd.conf

[root@localhost www]# ll

总用量 24

drwxr-xr-x. 2 root root 4096 10月 26 20:2320151514217

drwxr-xr-x. 2 root root 4096 10月  6 2011 cgi-bin

drwxr-xr-x. 3 root root 4096  9月  9 12:15 error

drwxr-xr-x. 2 root root 4096 10月  6 2011 html

drwxr-xr-x. 3 root root 4096  9月  9 12:15 icons

drwxr-xr-x. 2 root root 4096 10月 26 20:25whc

[root@localhost www]# cd /etc/httpd/conf

[root@localhost conf]# ll

总用量 52

-rw-r--r--. 1 root root 34437 10月 26 20:47httpd.conf

-rw-r--r--. 1 root root 13139 10月  6 2011 magic

[root@localhost conf]# cd httpd.conf

bash: cd: httpd.conf: 不是目录

[root@localhost conf]# cd ../

[root@localhost httpd]# ll

总用量 8

drwxr-xr-x. 2 root root 4096 10月 26 20:47conf

drwxr-xr-x. 2 root root 4096  9月  9 12:15 conf.d

lrwxrwxrwx. 1 root root   19  9月  9 12:15 logs ->

../../var/log/httpd

lrwxrwxrwx. 1 root root   29  9月  9 12:15 modules ->

../../usr/lib64/httpd/modules

lrwxrwxrwx. 1 root root   19  9月  9 12:15 run ->

../../var/run/httpd

[root@localhost httpd]# cd conf.d

[root@localhost conf.d]# ll

总用量 12

-rw-r--r--. 1 root root 118  5月 19 2009mod_dnssd.conf

-rw-r--r--. 1 root root 392 10月  6 2011 README

-rw-r--r--. 1 root root 299  5月 20 2009welcome.conf

[root@localhost conf.d]# cd README

bash: cd: README: 不是目录

[root@localhost conf.d]# cd conf

bash: cd: conf: 没有那个文件或目录

[root@localhost conf.d]# cd ../

[root@localhost httpd]# find vhosts.conf

find: “vhosts.conf”: 没有那个文件或目录

[root@localhost httpd]# find *.conf

find: “*.conf”: 没有那个文件或目录

[root@localhost httpd]# cd conf

[root@localhost conf]# ll

总用量 52

-rw-r--r--. 1 root root 34437 10月 26 20:47httpd.conf

-rw-r--r--. 1 root root 13139 10月  6 2011 magic

[root@localhost conf]# cd magic

bash: cd: magic: 不是目录

[root@localhost conf]# cd ../

[root@localhost httpd]# cd conf.d

[root@localhost conf.d]# ll

总用量 12

-rw-r--r--. 1 root root 118  5月 19 2009mod_dnssd.conf

-rw-r--r--. 1 root root 392 10月  6 2011 README

-rw-r--r--. 1 root root 299  5月 20 2009welcome.conf

[root@localhost conf.d]# vi mod_dnssd.conf

[root@localhost conf.d]# vi welcome.conf

[root@localhost conf.d]# vi README

[root@localhost conf.d]# vi ../conf/httpd.conf

[root@localhost conf.d]# cd /

[root@localhost /]# service httpd start

Starting httpd: httpd: Syntax error on line1011 of

/etc/httpd/conf/httpd.conf: Expected</Directory> but

saw </VirtualHost>

                                                       

  [FAILED]

[root@localhost /]# vi/etc/httpd/conf/httpd.conf

[root@localhost /]# service httpd start

Starting httpd:                                        

  [  OK  ]

[root@localhost /]#

 

 

 

 

 

阅读全文
0 0