apache
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章