码迷,mamicode.com
首页 > Web开发 > 详细

apache

时间:2016-12-16 02:02:05      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:虚拟主机   加密   网页   

apachq 日志类型

1.虚拟主机加密和网页重写

mkdir /var/www/virtual/news.rito.com/html -p

mkdir /var/www/virtual/ent.rito.com/html -p

cd /etc/httpd/conf.d/

vim default.conf

vim news.conf

vim ent.conf

 

cd /var/www/virtual/news.rito.com/html

vim index.html

news.rito.com

cd /var/www/virtual/ent.rito.com/html

vim index.html

ent.rito.com

网页重写(用http和https访问都是https)

vim news.conf

<Virtualhost *:80>

        Servername news.timo.com

        RewriteEngine on

        RewriteRule ^(/.*)$ https://%{HTTP_HOST}$1 [redirect=301]

</Virtualhost>

<Directory "/var/www/virtual/news.rito.com/html">

        Require all granted

</Directory>

<Virtualhost *:443>

        Servername news.timo.com

        Documentroot /var/www/virtual/news.rito.com/html

        Customlog "logs/news-443.log" combined

        SSLEngine on

        SSLCertificateFile /etc/pki/tls/certs/www.rito.com.crt

        SSLCertificateKeyFile /etc/pki/tls/private/www.rito.com.key

</Virtualhost>

在客户机

vim /etc/hosts

172.25.254.124 www.rito.com news.rito.com ent.rito.com

firefox

https://news.rito.com

2.php和cgi

antlpe

a#显示所有端口

n#不解析

t#tcp

l

p#服务名称

e

 

 

3.论坛搭建

yum install mariadb-server httpd php php-mysql -y

vim /etc/my.cnf

skip-networking=1

下载 Discuz_X3.2_SC_UTF8.zip 到/var/www/html/

unzip Discuz_X3.2_SC_UTF8.zip

less readme/readme.txt

chmod 777 upload/ -R

setenforce 0

systemctl restart httpd.service

测试机:

http://172.25.254.124/upload

 

Yum install squid -y

代理机(双网关):

cp ifcfg-eth0 ifcfg-eth1

yum install squid -y

vim /etc/squid/squid.conf

59 http_access allow all

62 cache_dir ufs /var/spool/squid 100 16 256

systemctl restart squid

另一虚拟机172.25.24.11

设置代理

 

vim /etc/squid/squid.conf

http_access allow all

http_port 80 vhost vport

cache_peer 172.25.254.4 parent 80 0 no-query originserver round-robin name=web1

cache_peer 172.25.254.3 parent 80 0 no-query originserver round-robin name=web2

cache_peer_domain web1 web2 www.taobao.com

cache_dir ufs /var/spool/squid 100 16 256

 

 


apache

标签:虚拟主机   加密   网页   

原文地址:http://12118369.blog.51cto.com/12108369/1883142

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!