欢迎来到天天文库
浏览记录
ID:18590597
大小:115.50 KB
页数:14页
时间:2018-09-19
《linux网络服务-命令总结》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第4章构建LAMP网站服务平台1:安装HTTPD软件包root@s1~]#ls/media/cdrom/Server/*httpd*/media/cdrom/Server/httpd-2.2.3-6.el5.i386.rpm/media/cdrom/Server/httpd-devel-2.2.3-6.el5.i386.rpm/media/cdrom/Server/httpd-manual-2.2.3-6.el5.i386.rpm/media/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm[root@s1~]#rpm-ivh/
2、media/cdrom/Server/httpd-2.2.3-6.el5.i386.rpm2:[root@s1mnt]#tar-zxvfhttpd-2.2.9.tar.gz-C/usr/src/3:配置编译选项[root@s1mnt]#cd/usr/src/httpd-2.2.9/[root@s1httpd-2.2.9]#./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite--enable-cgi--enable-suexec--with-suexec-caller=daemon--with-suexec-docro
3、ot=/usr/local/apache2/htdocs4:编译服务程序和安装[root@s1httpd-2.2.9]#make&&makeinstall5:在HTTPD.CONF文件中添加:SERVERNAME“配置行,设置WEB服务的域名[root@s1~]#vi/usr/local/apache2/conf/httpd.confServerNamewww.benet.com6:启动、终止HTTPD服务[root@s1~]#/usr/local/apache2/bin/apachectl-tSyntaxOK[root@s1~]#/usr/local/apache2/bin/apachect
4、lrestarthttpdnotrunning,tryingtostart[root@s1~]#/usr/local/apache2/bin/apachectlstarthttpd(pid20911)alreadyrunning[root@s1~]#netstat-anpt
5、grep:80tcp00:::80:::*LISTEN20911/httpd7:构建虚拟WEB主机(1)在HTTPD服务器的网页目录建立两个文件夹benetcomaccpcom,并分别建立两个测试网页[root@s1~]#cd/usr/local/apache2/htdocs/[root@s1htdocs]#mkdirbe
6、netcomaccpcom[root@s1htdocs]#echo"www.benet.com">benetcom/index.html[root@s1htdocs]#echo"www.accp.com">accpcom/index.html(2)修改HTTPD.CONF文件添加虚拟主机配置[root@s1htdocs]#vi/usr/local/apache2/conf/httpd.confNameVirtualHost172.16.16.166DocumentRoot/usr/local/apache2/htdocs/benetcomSe
7、rverNamewww.benet.comErrorLoglogs/www.benet.com.error.logCustomLoglogs/www,benet.com.access.logcommonDocumentRoot/usr/local/apache2/htdocs/accpcomServerNamewww.accp.comErrorLoglogs/www.accp.com.error.logCustomLoglogs/www,accp.com.access.logcommon
8、(3)建立系统用户的个人主页[root@s1~]#vi/usr/local/apache2/conf/httpd.confUserDirpublic_htmlAllowOverridenoneOptionsnoneOrderallow,denyAllowfromall
此文档下载收益归作者所有