Apache服务器的配置(一)
来源:互联网 发布:单片机密码锁编程 编辑:程序博客网 时间:2024/05/16 18:02
个人web站点配置
一、 前期准备:
检测Apach是否安装
[root@localhost Desktop]# rpm -qa|grep httpd
httpd-2.2.15-29.el6_4.i686
httpd-tools-2.2.15-29.el6_4.i686
二、配置
1,若已经安装好则开启服务
[root@localhost Desktop]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
2,测试网页
3,配置防火墙:setup
4,Apache服务停止
停止Apache服务的命令如下所示:
[root@localhost Desktop] #service httpd stop
5,自动加载Apache服务,有两种方法,这里用哪一种都行
(1)使用ntsysv命令,在文本图形界面对Apache自动加载(在httpd选项前按空格,加上“*”)。
(2)使用chkconfig命令自动加载。
[root@localhost Desktop] #chkconfig --level 3 httpd on
#运行级别3自动加载
[root@localhost Desktop] #chkconfig --level 3 httpd off
#运行级别3不自动加载
6,配置httpd文件
[root@localhost Desktop]# vi /etc/httpd/conf/httpd.conf
在UserDir disabled前面加上#注释
把UserDir public_html前的#去掉,表示用户个人目录可用
在用户家目录下面创建public_html目录,用来存放网页,linux中一般默认网页名称为index.html
[student@localhost ~]$ mkdir public_html
[student@localhost ~]$ vi public_html/index.html
之后编辑静态网页就行
7,配置权限,根据httpd.conf配置文件用户家目录的权限是711,public_html目录的权限是755
[student@localhost home]$ chmod 711 student
[student@localhost home]$ chmod 755 student/public_html
8,关闭SELIinux,两种方法都可以
查看SELinux状态:
/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
getenforce ##也可以用这个命令检查
关闭SELinux:
(1)临时关闭(不用重启机器):
setenforce 0 ##设置SELinux成为permissive模式
setenforce 1 设置SELinux成为enforcing模式
这里需要关闭,临时关闭也可以
9,其他配置
在root用户下输入
setsebool -P httpd_can_network_connect=1
配置完成之后一定要重启服务
service httpd restart
- Apache服务器的配置(一)
- 配置Apache服务器 (一)
- Apache服务器的配置
- Apache服务器的配置
- Apache服务器配置全攻略(一)
- Apache服务器的安全配置
- apache服务器的相关配置
- Linux16-Apache服务器的配置
- 简单的Apache服务器配置
- Web 服务器的配置与应用(一) —— Apache 简介
- [服务器]基于mod_proxy+Apache 2.2.16+Tomcat 7的负载均衡与集群配置(一)
- apache一台服务器搭建两个不同域名的网站如何配置
- apache的james邮件服务器的配置
- Linux下Apache服务器的配置!
- Linux下的Apache服务器配置小记
- Linux中Apache服务器的基本配置
- Apache服务器配置的全攻略
- 基于Apache的Svn服务器配置
- 【Espruino】NO.04 让灯自由闪动
- Java用于嵌入式系统的十大优点和五个局限
- Android修炼之道—自定义控件 (300喵喵币)
- poj 2117 Electricity
- LinuxMint 15 / Ubuntu 13.04 / Ubuntu 13.10 下无法连接 wpa2 enterprise 加密无线网络的解决方法
- Apache服务器的配置(一)
- 多媒体编程——声音播放(2)
- 人生真的是一场马拉松吗?
- HDU1372:Knight Moves(BFS)
-  |"|&|<|>等html字符转义
- 纯c语言版的贪吃蛇,linux终端运行
- 程序是怎么在计算机中运行的--运行时程序的内存结构
- 设计模式之状态模式
- nginx源码分析--模块分类