Debian服务器给编译安装的Apache设置系统服务
1. 创建 systemd 服务文件 使用文本编辑器创建 Apache 的 systemd 服务文件… 继续阅读 Debian服务器给编译安装的Apache设置系统服务
1. 创建 systemd 服务文件 使用文本编辑器创建 Apache 的 systemd 服务文件… 继续阅读 Debian服务器给编译安装的Apache设置系统服务
1. 安装 Apache 和 SSL 模块: [crayon-681093c36d5e4325064… 继续阅读 Debian服务器上面配置Apache的ssl证书
步骤一:确认 logrotate 和 Apache 相关配置情况 检查 logrotate 是否已安… 继续阅读 Debian设置Apache2的日志轮转
下载mod_security源代码
1 2 3 |
wget https://github.com/SpiderLabs/ModSecurity/archive/v2.9.3.tar.gz tar -xzvf v2.9.3.tar.gz cd ModSecurity-2.9.3/ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
apt install sudo ssh vim mc ncdu tree git curl nmap net-tools zip gcc automake autoconf libtool make rpm wget ntpdate psmisc telnet build-essential zlib1g-dev libpcre3-dev libssl-dev libexpat1-dev g++ wget http://archive.apache.org/dist/apr/apr-1.7.4.tar.gz tar -zxf apr-1.7.4.tar.gz cd apr-1.7.4 ./configure --prefix=/usr/local/lib/apr make make install wget http://archive.apache.org/dist/apr/apr-util-1.6.3.tar.gz tar -zxf apr-util-1.6.3.tar.gz cd apr-util-1.6.3 ./configure --prefix=/usr/local/lib/apr-util -with-apr=/usr/local/lib/apr/bin/apr-1-config make make install wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz tar -zxf pcre-8.45.tar.gz cd pcre-8.45 ./configure --prefix=/usr/local/lib/pcre make make install wget https://downloads.apache.org/httpd/httpd-2.4.57.tar.gz tar -zxvf httpd-2.4.57.tar.gz cd httpd-2.4.57 cd srclib/ cp -r ../../apr-1.7.4/ apr/ cp -r ../../apr-util-1.6.3/ apr-util/ ./configure --prefix=/usr/local/lib/apache2 --with-apr=/usr/local/lib/apr --with-apr-util=/usr/local/lib/apr-util --enable-dav --enable-proxy --enable-maintainer-mode --enable-rewrite --enable-access_compat --enable-alias --enable-auth_basic --enable-auth_digest --enable-authn_core --enable-authn_file --enable-authz_core --enable-authz_host --enable-authz_user --enable-autoindex --enable-dav_fs --enable-deflate --enable-dir --enable-env --enable-filter --enable-headers --enable-mime --enable-negotiation --enable-reqtimeout --enable-setenvif --enable-status --enable-ssl=shared --enable-expires=shared --enable-static-support --with-included-apr --with-mpm=prefork --enable-cache --enable-file-cache make make install #安装完成之后查看libphp*.so 的位置 然后复制到/usr/local/lib/apache2/modules find / -name "libphp*" cp /usr/lib/apache2/modules/libphp7.1.so modules/libphp7.so #修改Apache的配置文件 #关闭Apache的服务 systemctl disable apache2 #将安装的Apache设置开机启动, 在/etc/rc.local 文件中添加一行, 一定要给rc.local文件可执行权限, 否则文件不生效 /usr/local/lib/apache2/bin/apachectl start |
【apache配置禁止访问】 1. 禁止访问某些文件/目录 增加Files选项来控制,比如要不允许访… 继续阅读 apache 设置禁止访问某些文件或目录
htpasswd命令 网络服务器 htpasswd命令是Apache的Web服务器内置工具,用于创建… 继续阅读 Apache给webdav添加用户