天天看點

學習筆記 八: web服務

一 常見web服務

  apache是internet上使用最多的web程式,它基于httpd協定傳輸和響應資料

常用的方法:

GET

HEAD

POST

httpd.service

二 安裝配置

yum install httpd

systemctl enable httpd.service

systemctl start httpd.service

firewall-cmd --permanent --add-service=http --add-service=https

firewall-cmd --reload

firewall-cmd --list-all

vi /etc/httpd/conf/httpd.conf

ServerAdmin [email protected]

semanage fcontext -a -t httpd_sys_content_t '/new/localtion(/.*)'

setfacl -R -m g:webmasters:rwX /var/www/html

setfacl -R -m g:webmasters:rwx /var/www/html

2.virtual hosts

vi /etc/httpd/conf.d/site1.conf

<Directory /srv/site1/wwww>

Require all granted

AllowOverride None

</Directory>

<VirtualHost 192.168.1.1:80>

DocumentRoot /srv/site1/www

ServerName site1.example.com

ServerAdmin webmaster@xxxx

ErrorLog "logs/xxx"

CustomLog "logs/sie" combined

</VirtualHost>

3. https

genkey <FQDN>

vi /etc/httpd/conf.d/ssl.conf

4. PHP

三 配置執行個體

wordpress

四 高可用

keepaliave+LV+apache

本文轉自 woshiwei201 51CTO部落格,原文連結:http://blog.51cto.com/chenwei/1841967