anpache的安装

 

######unit3.9######

###anpache的安装######

 

yum install httpd -y

 

systemctl start httpd
systemctl stop firewalld
systemctl enable httpd

 

systemctl disable firewalld


###apache的信息#####

1.apache的默认发布文件

 

index.html


2.apache的配置文件
/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/*.conf

3.apache的默认发布目录

 

 

/var/www/html

 

 

4.apache的默认端口
80

apache的基本配置

1.修改默认发布文件

 

vim /var/www/html/westos.html      ##编辑配置文件

 

vim /etc/httpd/conf/httpd.conf

 

164     DirectoryIndex westos.html index.html

systemctl restart httpd

 

测试:

 

浏览器方位:172.25.254.124

 

2.修改默认发布目录      ##当selinux是disable状态

 

 

mkdir  /westos/www/test -p  

 

vim /westos/www/test/westos.html

 

vim /etc/httpd/conf/httpd.conf
120 DocumentRoot "/westos/www/test"
121 <Directory "westos/www/test">
122          Require all granted

 

123 </Directory>

 

systemctl restart httpd
测试:

 

浏览器访问:172.25.254.124


3.apache的访问控制
##设定ip的访问
mkdir /var/www/html/admin

 

vim /var/www/html/admin/admin.html

 

 

vim /etc/httpd/conf/httpd.conf   (把前一个实验的数据改回来)
124 <Directory "/var/www/html/admin">         ##允许所有人访问admin目录但是拒绝124主机
125        Order Allow,Deny
126        Allow from All
127        Deny from 172.25.254.124

 

128 </Directory>

测试:

 

<Directory "/var/www/html/admin">             ##只允许124主机访问admin目录
       Order Deny,Allow
       Allow from 172.25.254.124
       Deny from All

 

</Directory>

 

##设定用户的访问

 

htpasswd -cm /etc/httpd/accessuser admin          ##创建用户,如果要添加用户就直接用-m

 

vim /etc/httpd/conf/httpd.conf                    
<Directory "/var/www/html/admin">
         AuthUserFile /etc/httpd/accessuser                    ##用户认证文件
         AuthName "Please input your name and passwd !!"       ##用户认证提示信息
         AuthType basic                                        ##认证类型
         Require valid-user                             ##认证用户,认证文件中所有用户都可以访问
         [Require user admin]                           ##只允许认证文件中的admin用户访问,二选一

 

</Directory>

测试:

 

4.apache语言支持
php html cgi
html语言默认支持
php语言

 

yum install php -y

 

vim /var/www/html/index.php         ##编写php测试文件
<?php
    phpinfo()

 

?>

systemctl restart httpd

测试:

 

cgi语言
mkdir /var/www/html/cgi             ##建立cgi默认发布目录
vim /var/www/html/cgi/index.cgi     ##编写默认发布文件
#!/usr/bin/perl
print "content-type: text/html\n\n";

 

print `date`;

 

chmod +x index.cgi                  ##给文件可执行权限
vim /etc/httpd/conf/httpd.conf
<Directory "/var/www/html/cgi">
          Options +ExecCGI
          AddHandler cgi-script .cgi

 

</Directory>

systemctl restart httpd

测试:


5.apache的虚拟主机
1)定义
可以让我们的一台apache服务器在被访问不同域名的时候显示不同的主页
2)建立测试页
cd /var/www
mkdir virtual/news.westos.com/html -p
mkdir virtual/money.westos.com/html -p
echo "money.westos.com's page" >virtual/money.westos.com/html/index.html

 

echo "news.westos.com's page" >virtual/news.westos.com/html/index.html

 

 

3)配置
vim /etc/httpd/conf.d/default.conf                    ##未指定域名的访问都访问default
<Virtualhost  _default_:80>                           ##虚拟主机开启的端口
               DocumentRoot "/var/www/html"           ##虚拟主机的默认发布目录
               CustomLog "logs/default.log" combined  ##虚拟主机日志

 

</Virtualhost>


vim /etc/httpd/conf.d/news.conf            ##指定域名news.westos.com的访问到指定目录默认发布目录中
<Virtualhost *:80>
           ServerName "news.westos.com"
           DocumentRoot "/var/www/virtual/news.westos.com/html"
           Customlog "logs/news.log" combined
</Virtualhost>
<Directory "/var/www/virtual/news.westos.com/html">            ##默认发布目录的访问授权
           Require all granted

 

</Directory>

 

 

cp -p /etc/httpd/conf.d/news.conf /etc/httpd/conf.d/momey.conf
vim /etc/httpd/conf.d/money.conf

 

%s/news/money/g

 

4)测试
在浏览器所在主机中
vim /etc/hosts

 

172.25.254.124 www.westos.com news.westos.com

 

 

6.https

 

1)https的定义
2)配置

 

yum install mod_ssl.x86_64 crypto-utils.x86_64  -y

genkey www.westos.com                  ##生成密钥和密匙

1.生成证书位置

2.选择密钥大小

3.生成随即数

4.拒绝向CA机构发送CAR证书

5.拒绝加密私钥

6.配置服务器身份信息

 

/etc/pki/tls/certs/www.westos.com.crt          
/etc/pki/tls/private/www.westos.com.key
vim /etc/httpd/conf.d/login.conf
<Virtualhost *:443>
           ServerName "login.westos.com"
           DocumentRoot "/var/www/virtual/login.westos.com/html"
           Customlog "logs/login.log" combined
           SSLEngine on                    ##开始https功能
           SSLCertificateFile /etc/pki/tls/certs/www.westos.com.crt       ##证书
           SSLCertificateKeyFile /etc/pki/tls/private/www.westos.com.key  ##密钥
</Virtualhost>
<Directory "/var/www/virtual/login.westos.com/html">
           Require all granted
</Directory>
<Virtualhost *:80>                         ##网页重写实现自动访问https
          ServerName "login.westos.com"
          RewriteEngine on
          RewriteRule ^(/.*)$ https://%{HTTP_HOST}$1 [redirect=301]

 

</virtualhost>

 

^(/.*)$        ##客户主机在地址栏写入的所有字符,不看换行符
https://      ##定向成为的访问协议
%{HTTP_HOST}   ##客户请求主机
$1             ##$1的值就表示^(/.*)$的值
[redirect=301] ##临时重定向,302永久重定向

mkdir /var/www/virtual/login.westos.com/html -p
vim /var/www/virtual/login.westos.com/html/index.html

 

systemctl restart httpd


测试:
在客户主机中添加解析
vim /etc/hosts

 

172.25.254.124  login.westos.com

 

访问http://login.westos.com会自动跳转到https://login.westos.com实现网页数据加密传输

 

dnSpy是目前业界广泛使用的一款.NET程序的反编译工具,支持32位和64位系统环境。它允许用户查看和编辑.NET汇编和反编译代码,以及调试.NET程序。该工具通常用于程序开发者在维护和调试过程中分析程序代码,尤其在源代码丢失或者无法获取的情况下,dnSpy能提供很大的帮助。 V6.1.8版本的dnSpy是在此系列软件更新迭代中的一个具体版本号,代表着该软件所具备的功能与性能已经达到了一个相对稳定的水平,对于处理.NET程序具有较高的可用性和稳定性。两个版本,即32位的dnSpy-net-win32和64位的dnSpy-net-win64,确保了不同操作系统架构的用户都能使用dnSpy进行软件分析。 32位的系统架构相较于64位,由于其地址空间的限制,只能支持最多4GB的内存空间使用,这在处理大型项目时可能会出现不足。而64位的系统能够支持更大的内存空间,使得在处理大型项目时更为方便。随着计算机硬件的发展,64位系统已经成为了主流,因此64位的dnSpy也更加受开发者欢迎。 压缩包文件名“dnSpy-net-win64.7z”和“dnSpy-net-win32.7z”中的“.7z”表示该压缩包采用了7-Zip压缩格式,它是一种开源的文件压缩软件,以其高压缩比著称。在实际使用dnSpy时,用户需要下载对应架构的压缩包进行解压安装,以确保软件能够正确运行在用户的操作系统上。 dnSpy工具V6.1.8版本的发布,对于.NET程序员而言,无论是32位系统还是64位系统用户,都是一个提升工作效率的好工具。用户可以根据自己计算机的操作系统架构,选择合适的版本进行下载使用。而对于希望进行深度分析.NET程序的开发者来说,这个工具更是不可或缺的利器。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值