-------------------- php程序换目录-----------------------------
在/下建立 php,并开相应权限
# mkdir /php
# chmod -R 777 /php
# vi /usr/local/apache/conf/extra/httpd-vhosts.conf
修改为如下:
<VirtualHost *:80>
DocumentRoot "/php" 修改为新位置
ServerName bbs.tgjia.com
ErrorLog "/php/logs/phpbbs-error_log"
CustomLog "/phplogs/phpbbs-access_log" common
</VirtualHost>
建立/php/logs ,并拷贝以下两个原有的日志文件过来.
/usr/local/apache/logs/jspbbs-error_log
/usr/local/apache/logs/jspbbs-access_log"
# vi httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all 这样就可以访问"/usr/local/apache/htdocs/"以外的位置了
</Directory>
重启apache.
浏览器的地址栏中输入IP , 就可看见tomcat的默认页面了.
ProxyPass / ajp://127.0.0.1:8009/ 注意最后有一个"/",千万不能少
ProxyPassReverse / ajp://127.0.0.1:8009/ 注意最后有一个"/",千万不能少
# cd /mnt
# tar zxvf httpd-2.2.13.tar.gz
# cd httpd-2.2.13
# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-proxy --enable-proxy-ajp --enable-proxy-balancer --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
开了rewrite ,proxy模块
# make && make install
启动apache
# /usr/local/apache/bin/apachectl start
看一下端口, 有没有80端口
# netstat -ant
也可以看一下进程
# ps -ef | grep httpd
下一步,把apache加入开机自启动
# cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
# vi /etc/rc.d/init.d/httpd
在第二行新加两行,内容如下:
# chkconfig: 2345 10 90
# description: Activates/Deactiates Apache Web Server
保存退出.
# chkconfig --add httpd 加入自启动
# chkconfig --level 345 httpd on 设置运行级别
重启apache:
# /usr/local/apache/bin/apachectl restart
