Chinaunix首页 | 论坛 | 博客
  • 博客访问: 328958
  • 博文数量: 46
  • 博客积分: 1921
  • 博客等级: 上尉
  • 技术积分: 417
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-03 17:07
文章分类

全部博文(46)

文章存档

2011年(19)

2010年(4)

2009年(11)

2008年(12)

我的朋友

分类: LINUX

2008-07-14 11:07:35

配置文件:/etc/httpd/conf/httpd.conf

 

若在莫用户名下建立网页步骤:

1.     Userdir 默认情况下是不允许非root用户建立网页的,如有需要,把disable这一行用#注释掉。

2./home/用户名/下面建立文件夹public_html

3.更改/home/用户名  的权限(以airway用户名为例)

[root@localhost conf]# ls -dl /home/airway

drwx------  17 airway airway 4096 Jul  9 18:42 /home/airway

other用户能够访问airway文件夹

[root@localhost conf]# chmod o+x /home/airway

X:是other用户进入airway文件的权限

 

 

 

 

网页存放在:/var/www目录下面

服务启动命令:service httpd restart

Root用户:在文件夹下面 /var/www/html 下面建立文件 index.html文件。在文件里面输入任意内容,则在浏览器中看到内容为index.html文件内容。

 

virtualHost:

 

#    ServerAdmin webmaster@dummy-host.example.com

#    DocumentRoot /www/docs/dummy-host.example.com

#    ServerName dummy-host.example.com

#    ErrorLog logs/dummy-host.example.com-error_log

#    CustomLog logs/dummy-host.example.com-access_log common

#

 

/var/named/chroot/var/named db.domain----------要安装dns服务才有named文件夹

 

[root@localhost named]# service httpd restart

Stopping httpd: [FAILED]

Starting httpd: Syntax error on line 1039 of /etc/httpd/conf/httpd.conf:

ServerName takes one argument, The hostname and port of the server

[FAILED]

 

例如建立两个站点:root.comairway.com

在文件/etc/httpd/conf/httpd.conf 中添加如下字符。

 

 

NameVirtualHost 192.168.150.129

 

DocumentRoot /var/www/html

    ServerName

 

 

DocumentRoot /home/airway/public_html

    ServerName

 

 

 

Php支持

/var/www/html建立后缀为php的文件,可以查看是否支持php

阅读(2642) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~