apache2.4 httpd.conf httpd-vhost.conf配置

extra / httpd-vhost.conf

<VirtualHost *:81>
    DocumentRoot "/data/sda1_data/"
    ServerName nemtech.cn
    ServerAlias nemtech.cn
    ServerSignature Off

    ErrorLog "logs/nemtech.cn-error_log"
    CustomLog "logs/nemtech.cn-access_log" common

  <Directory /data/sda1_data/>
        Options Indexes
        IndexOptions Charset=UTF-8
        ReadmeName  /footer.html
        IndexIgnore footer.html bk.jpg alipay.jpg wechatpay.jpg
        Order deny,allow
        Allow  from all

        AllowOverride AuthConfig
        AuthName "Personal web Auth!"
        AuthType Basic
        AuthUserFile /data/.htpasswd
        require valid-user 

        SetEnvIfNoCase Referer "nemtech.cn" local_ref
        SetEnvIfNoCase Referer "^$" local_ref
        <filesmatch "\.(txt|doc|mp3|zip|rar|jpg|gif)">
            Order Allow,Deny
            Allow from env=local_ref
        </filesmatch>

</Directory>

</VirtualHost>

httpd.conf

```

httpd-mpm.conf 为apache连接数配置

原文地址:https://www.cnblogs.com/zhaocundang/p/9360423.html

时间: 2024-10-01 05:22:28

apache2.4 httpd.conf httpd-vhost.conf配置的相关文章

D:/apache2/conf/httpd.conf:Cannot load D:/apache2/modules/mod_actions.so

报错如下: errors reported here must be corrected before service can be started.httpd:Syntax error on line 60 of D:/apache2/conf/httpd.conf:Cannot load D:/apache2/modules/mod_actions.so into server:\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xa3\xbf\

vim /usr/local/apache2/conf/httpd.conf

[[email protected] ~]# vim -n /usr/local/apache2/conf/httpd.conf 1 # 2 # This is the main Apache HTTP server configuration file. It contains the 3 # configuration directives that give the server its instructions. 4 # See <URL:http://httpd.apache.org/

apache的/etc/httpd/conf/httpd.conf和/usr/local/apache2/conf/httpd.conf区别

一.问题 centos系统用yum安装完apache后,重启后有时会失效,然后去网上找资料,发现有的说重启命令是这样的: /etc/init.d/httpd restart 而有的呢,说重启命令应该是这样的: service httpd restart 这两行命令写法不同,但其实是同一个东西,都是重启httpd服务. 但很多时候发现改了配置文件后,重启并不生效,然后网上的资料有的让改 /etc/httpd/conf/httpd.conf 这个文件,有的让改 /usr/local/apache2/

Apache的主配置文件:/etc/httpd/conf/httpd.conf

Apache的主配置文件:/etc/httpd/conf/httpd.conf默认站点主目录:/var/www/html/Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行.[[email protected] ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf [[emai

Apache下的配置文件httpd.conf、httpd-vhosts.conf 转

Apache下的配置文件httpd.conf.httpd-vhosts.conf(windows) 2013-05-24 22:09 by youxin, 58 阅读, 0 评论, 收藏, 编辑 httpd.conf文件一般存在于apache目录下的conf文件夹中,主要用来配置apache的.http.conf里面的配置介绍: 1.Listen :监听端口,默认情况是80. 2.ServerAdmin :服务器管理员邮箱. 3.ServerName:服务名. 4.DocumentRoot:PH

解决方案:虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf?

答案是:都可以.但是推荐在vhosts.conf中设置. --官方文档的举例是在httpd.conf中设置的. --百度一下会发现99%都是在httpd-vhosts.conf中设置的.但是这种设置会存在一些问题,比如设置后localhost打不开等等问题,虽然解决方案简单,但是毕竟感觉不太保险. --在vhosts.conf中设置的话,比较简单,而且没有什么幺蛾子问题. <VirtualHost *:80> ServerName localhost DocumentRoot "E:

vim /etc/httpd/conf/httpd.conf

[[email protected] httpd]# cat -n /etc/httpd/conf/httpd.conf  //httpd.conf配置文件初始值 1 # 2 # This is the main Apache server configuration file. It contains the 3 # configuration directives that give the server its instructions. 4 # See <URL:http://httpd

虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf

https://blog.csdn.net/weisubao/article/details/43536723 解决方案:虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf? 答案是:都可以.但是推荐在vhosts.conf中设置. ——官方文档的举例是在httpd.conf中设置的. ——百度一下会发现99%都是在httpd-vhosts.conf中设置的.但是这种设置会存在一些问题,比如设置后localhost打不开等等问题,虽然解决方案简单

Apache2.4.6添加虚拟主机提示:NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf

[[email protected] conf]# service httpd restart 停止 httpd: [确定] 启动 httpd:AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf:1 文件 /usr/local/apache/conf/extra/httpd-vhosts.conf

httpd 2.4.12 安装配置

编译apache 之前查看官网的安装说明 http://httpd.apache.org/docs/2.4/install.htmlapache 安装说明 下载组件wgethttp://mirrors.hust.edu.cn/apache/apr/apr-1.5.1.tar.gz wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz wget ftp://ftp.csx.cam.ac.uk/pub/software/pr