且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

apache,nginx,tomcat默认首页位置

更新时间:2022-09-15 12:28:42

1.apache直接Yum安装网站根目录是/var/www/html,而/var/www/html/目录下什么文件都没有,这时候默认页面由/etc/httpd/conf.d/welcome.conf这个文件定义,大致的意思就是说,/var/www/html无index.html或者index.html.var文件时,(上面这两个文件可以在httpd.conf中定义)

会自动转到/error/noindex.html中,也就是/var/www/error/noindex.html

其中welcome.confapache,nginx,tomcat默认首页位置,这个403是apache特性,发现/var/www/html没有文件就会自动转成403错误。

而它的配置文件是在/etc/httpd/conf/httpd.conf

                    编译安装的话 跟--prefix=/usr/local/apache2参数有关,是/usr/local/apache2/htdocs/index.html

2.nginx也一样,直接yum安装默认首页是/usr/local/nginx/html/index.html

                    编译安装的话 跟--prefix参数有关

3.tomcat,默认首页是/usr/local/tomcat/webapps/ROOT/index.jsp

本文转自飞奔的小GUI博客51CTO博客,原文链接http://blog.51cto.com/9237101/1908778如需转载请自行联系原作者


ziwenzhou