- 论坛徽章:
- 0
|
我安装的是2.2.4版本:
- tar -zxvf httpd-2.2.4.tar.gz
- cd httpd-2.2.4
- ./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --enable-modules=most --enable-so --enable-suexec --with-s
- uexec-caller=daemon --with-suexec-docroot=/usr/www
- make
- make install
复制代码
然后创建一个网站test.xxx.cn:
- cd /usr/www
- mkdir test.xxx.cn
复制代码
建立了用户test和用户组test:
- groupadd test
- useradd -g test test
复制代码
设置虚拟主机的权限:
- chown test:test test.xxx.cn -R
- chmod 770 test.xxx.cn
复制代码
httpd.conf的部分配置如下:
- .
- .
- .
- LoadModule suexec_module modules/mod_suexec.so
- <IfModule !mpm_netware_module>
- User daemon
- Group daemon
- </IfModule>
- ServerAdmin you@example.com
- DocumentRoot "/usr/local/apache2/htdocs"
- Listen 80
- NameVirtualHost *:80
- <VirtualHost *:80>
- DocumentRoot /usr/www/test.xxx.cn
- ServerName test.xxx.cn
- SuexecUserGroup test test
- <Directory "/usr/www/test.xxx.cn">
- Options Indexes FollowSymLinks
- AllowOverride None
- Order allow,deny
- Allow from all
- DirectoryIndex index.php index.html
- </Directory>
- </VirtualHost>
- .
- .
- .
复制代码
启动Apache正常,浏览站点test.xxx.cn/test.php时出现
Forbidden
You don't have permission to access / on this server.
可是
chmod 775 test.xxx.cn -R
后就正常了,屏幕上显示
Hostname ort test.xxx.cn:0
User/Group daemon(2)/2
Max Requests Per Child: 10000 - Keep Alive: on - Max Per Connection: 100 |
|