Apache service deployment static websites

Site service program
Apache service deployment static websites
Apache service deployment static websites
IIS to a Windows system
Nginx (features: low system resources consumption and strong concurrency)
the Apache can be applied to Linux, Unix, Windows systems

Apache service deployment
Step 1: the system image to the optical disc apparatus mount / media / cdrom directory.
Step 2: Create a Yum repository configuration file using Vim text editor.
vim /etc/yum.repos.d/rhel7.repo(Ynm depot_path)
[rhel7]
name = rhel7
BaseURL = File: /// Media / CDROM
Enabled. 1 =
gpgcheck = 0
Step 3: Apache service program installed hands.
Note that when using the yum command to install, with packages that names command behind the Apache service is httpd.
Apache service deployment static websites
Step 4: Enable httpd service program and added to the startup items so that it can operate with the system turned on, thereby continuing to provide users with Web services
when a Web site is no data or insufficient privileges, open a Web browser, will prompt page appears.

Httpd service
concept:
HTTP protocol is an international common standard protocol
httpd service is the Linux system to provide users with Web services service program
storage location of the configuration file httpd service program is shown in a Linux system:
Apache service deployment static websites

编辑网站首页面内容:
1、在/var/www/下,创建index.html(一般网站首页)文件
2、用Vim编辑器可以自行编辑想要的首页内容
3、刷新网站首页即可。

修改保存网站的路径目录:(将原/var/www/html目录改成/home/wwwroot目录)
1、检查/home/wwwroot目录是否存在,如果不存在创建该目录
2、编辑需要保存网站的内容,并保存在需要保存的网站数据目录(/home/wwwroot)
3、在httpd服务的主配置文件中,修改网站数据目录保存路径和网站数据目录的权限路径
4、重启httpd服务即可。
注意:httpd服务的主配置文件为/etc/httpd/conf/httpd.conf(同时这也是Apache程序的主配置文件)
下表为httpd服务程序最常配置的参数
Apache service deployment static websites

SELinux安全子系统
作用:让用户更安全的使用Linux服务器,让用户获取自己应获取的资源。
SELinux安全子系统能够从多方面监控违法行为:
对服务程序的功能进行限制(SELinux域限制可以确保服务程序做不了出格的事情);
对文件资源的访问限制(SELinux安全上下文确保文件资源只能被其所属的服务程序进行访问)
SELinux服务有三种配置模式:
enforcing:强制启用安全策略模式,将拦截服务的不合法请求
permissive:遇到服务越权访问时,只发出警告而不强制拦截
disabled:对于越权的行为不警告也不拦截
Apache service deployment static websites

Modify SELinux context value method: semanage [options] [file]
Apache service deployment static websites

Modify SELinux domain security policy approach:
1, view and find SELinux domain security policy
Apache service deployment static websites
2, modify the corresponding value
Apache service deployment static websites

Guess you like

Origin blog.51cto.com/948891/2403646