本文共 1202 字,大约阅读时间需要 4 分钟。
1.下载httpd-2.2.15.tar.gz
2. tar zxvf httpd-2.2.15.tar.gz #解压文件会生成httpd-2.2.15目录
3../configure --prefix=/usr/local/apache-2.2.15 --enable-so --enable-mods-shared=most --with-mpm=worker
4.make
5.make install
6.apache开启:./apachectl start
7.apache配置文件做如下修改(httpd.conf)
Listen 10020 #侦听的端口号
ServerName 10.6.222.47:10020 #服务器的ip地址
#DocumentRoot "/home/tobyweng/usr/local/apache//htdocs" #这行我注释掉,等下在虚拟主机处配置
#<Directory "/home/tobyweng/usr/local/apache//htdocs">
........
.....
.......
#</Directory> #这一段我也注释掉,与上面匹配起来
以下是设置一个IP多站点
NameVirtualHost 10.6.222.47:10020 <VirtualHost 10.6.222.47:10020> ServerName tobyweng.com #站点域名的设置 DocumentRoot /home/tobyweng/usr/local/apache//htdocs #index存放位置的设置 <Directory "/home/tobyweng/usr/local/apache//htdocs"> #设置同上 Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost 10.6.222.47:10020> ServerName satan.com DocumentRoot /home/tobyweng/usr/local/apache//baidu.com <Directory "/home/tobyweng/usr/local/apache//baidu.com"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory></VirtualHost>
8.win7系统中hosts文件设置,文件在/windods/system32/driver/etc/hosts,具体设置有exmple
转载地址:http://ltpbi.baihongyu.com/