标签: apache2

到达文档范围之外的文件

我正在编写一个脚本来构建一个动态网站,该网站是通过加载外部组件创建的.

DocumentRoot位于/ sites/website/public,组件目录位于/ sites/website/components

我想到达每个组件的数据目录取决于请求的URL.

例如:

网址:

HTTP://ibuildmywebsite/component-data/randomimage/demo/swan04090044_small.jpg

应该获取文件/sites/website/components/randomimage/data/demo/swan04090044_small.jpg

我怎么能实现这一目标?我更喜欢一种可以放在.htaccess(如果有的话)里面而不是修改虚拟主机定义的方法.

谢谢!

mod-rewrite apache2 virtualhost

3
推荐指数
1
解决办法
2127
查看次数

将重新启动apache清除我的memcache内容?

我只是想知道memcache是​​否链接到apache还是作为一个单独的进程运行.那么,重新启动apache会清除我的内存缓存内容吗?

apache memcached apache2

3
推荐指数
1
解决办法
3836
查看次数

我可以在我的Apache服务器上运行Bottle.py而不会中断我的PHP应用程序吗?

我刚才最近捡起它,让我的网络服务器上的Python运行起来很烦人.

我选择了Bottle.py,因为它看起来很简单,易于访问和包含.我对Web服务器的工作原理(如何弄乱它们)的经验和知识很少,如果我不需要,我不愿意使用我的服务器的Apache,因为它已经托管了一个非常活跃的留言板.

Bottle的文档似乎假定了我没有的服务器/ python理解的一两步,因为我已经将bottle.py复制到我的doc根目录时,我甚至不确定在哪里放置实际的路由/网站内容.或者当我去"mydomain.com"时服务器如何知道运行瓶子(或执行python).

python apache2 bottle

3
推荐指数
1
解决办法
4921
查看次数

必须重新验证此请求的标头错误?

我注意到chrome缓存了一个视频文件.我用服务器上的另一个替换它,并且chrome继续从缓存服务旧的(使用JW flash player 5)

请求的标头如下所示:

joe@joe-desktop:~$ wget -O - -S --spider http://www.2xfun.de/files_geheimhihi14/20759.mp4
Spider mode enabled. Check if remote file exists.
--2011-05-15 22:40:56--  http://www.2xfun.de/files_geheimhihi14/20759.mp4
Resolving www.2xfun.de... 213.239.214.112
Connecting to www.2xfun.de|213.239.214.112|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Sun, 15 May 2011 20:40:56 GMT
  Server: Apache
  Last-Modified: Sun, 15 May 2011 20:37:59 GMT
  ETag: "89b38-3bb227-4a35683b477c0"
  Accept-Ranges: bytes
  Content-Length: 3912231
  Cache-Control: max-age=29030400, public, must-revalidate
  Expires: Sun, 15 Apr 2012 20:40:56 GMT
  Connection: close
  Content-Type: video/mp4
Length: 3912231 (3.7M) [video/mp4]
Remote …
Run Code Online (Sandbox Code Playgroud)

apache http apache2 http-headers

3
推荐指数
1
解决办法
2420
查看次数

为什么我的Perl CGI程序返回服务器错误?

我最近学习了cgi,并在vbox中设置了一个Ubuntu服务器.我写的第一个程序是使用vim通过ssh在Python中编写的.然后我在我的Windows 7工作站上安装了Eclipse并创建了完全相同的Perl文件; 只是一个简单的问候世界.

我试过运行它,我得到了500,而同一个目录(/ usr/lib/cgi-bin)中的Python代码显示正常.沮丧,我检查并三重检查权限,它开始于#!/ usr/bin/perl.我还检查了AddHandler是否设置为.pl.一切都设置得很好,一时兴起,我决定使用vim在服务器中编写完全相同的代码,就像我在Python文件中所做的那样.

瞧,它有效.我比较了他们,以为我疯了,他们完全一样.那么,这笔交易是什么?为什么Eclipse中的Windows 7中的文件与使用vim的Ubuntu服务器中生成的文件不同?他们有不同的二进制标题或什么?这确实会影响我的开发环境.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Testing.";
Run Code Online (Sandbox Code Playgroud)

Apache错误日志:

[Tue Aug 07 12:32:02 2012] [error] [client 192.168.1.8] (2)No such file or directory:     exec of '/usr/lib/cgi-bin/test.pl' failed
[Tue Aug 07 12:32:02 2012] [error] [client 192.168.1.8] Premature end of script headers: test.pl
[Tue Aug 07 12:32:02 2012] [error] [client 192.168.1.8] File does not exist: /var/www/favicon.ico
Run Code Online (Sandbox Code Playgroud)

这是我得到的持续错误.

perl cgi apache2 cgi-bin

3
推荐指数
1
解决办法
1773
查看次数

无法通过phpmyadmin导入数据库

当我尝试上传数据库(794 kb)时,我有错误:

No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.
Run Code Online (Sandbox Code Playgroud)

我已经阅读了很多关于这个错误的答案,但我找不到和决定和答案对我有用.

我的服务器:

Ubuntu 12.10服务器

Apache/2.2.22(apache2-mpm-itk) ;

MySQL客户端版本:5.5.27 ;

phpmyadmin 3.4.11.1deb1 ;

nginx/1.2.1 ;

PHP 5.4.6 ;

在/ etc/nginx/default中配置phpmyadmin

 location /phpmyadmin {

                root /usr/share/phpmyadmin;
                index index.php;

                proxy_pass http://backend/phpmyadmin;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_connect_timeout 120;
                proxy_send_timeout 120;
                proxy_read_timeout 180;

}
Run Code Online (Sandbox Code Playgroud)

php.ini配置

file_uploads = On
upload_tmp_dir …
Run Code Online (Sandbox Code Playgroud)

php mysql apache2 nginx phpmyadmin

3
推荐指数
1
解决办法
1万
查看次数

NameVirtualHost 0.0.0.0:80没有VirtualHosts

我的服务器运行正常,但有些东西改变了,我不确定是什么.

我收到以下错误,无法获得某些子域名.

apache2: Could not reliably determine the server's fully qualified domain name, using     2001:.....:a669 for ServerName
[Sat Dec 14 21:20:36 2013] [warn] NameVirtualHost 0.0.0.0:80 has no VirtualHosts
...
[Sat Dec 14 21:20:36 2013] [warn] NameVirtualHost 0.0.0.0:80 has no VirtualHosts
Syntax OK
Run Code Online (Sandbox Code Playgroud)

我已经尝试将ports.conf更改为Listen 80和Listen 0.0.0.0:80(参见http://www.rackaid.com/resources/how-to-disable-ipv6-in-apache-server/)

这是我的一个vhost文件.

NameVirtualHost 0.0.0.0:80
Listen 0.0.0.0:80
<VirtualHost 0.0.0.0:80>
    ServerName www.domain.us
    ServerAlias domain.us
    ServerAdmin email@domain.us

    DocumentRoot /home/valid_domain_path/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /home/valid_domain_path/www>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow …
Run Code Online (Sandbox Code Playgroud)

apache ubuntu config apache2

3
推荐指数
1
解决办法
2万
查看次数

Apache2的,并行线程.致命错误.pthreads不支持apache2handler SAPI

我的ubuntu上有apache2 web服务器.我需要安装pthreads,所以我从rep(copy到/ ext /)克隆了php7和pthreads的源代码.我为php安装了所有库,然后我跑了

./buildconf 
Run Code Online (Sandbox Code Playgroud)

和

./configure --prefix =/usr --with-config-file-path =/etc --enable -bcmath --enable-calendar --enable-cli --enable-debug --enable-dba --enable- exif --enable-ftp --enable -gd-native-ttf --enable-mbregex --enable-mbstring --enable-pcntl --enable-shmop --enable-soap --enable-opcache --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-zip --enable-maintainer-zts --with-freetype-dir =/usr/local/opt/freetype - with-openssl --with-gd --with-gettext =/usr/local/opt/gettext --with-iconv-dir =/usr --with-icu-dir =/usr --with-mhash --with -jpeg-dir =/usr/local/opt/jpeg --with-kerberos =/usr --with-libedit --with-mhash --with-png-dir =/usr/local/opt/libpng --with -zlib =/usr --with-apxs2 =/usr/bin/apxs--libexecdir =/usr/local/php7/7.0.0/libexec --with-bz2 =/usr --enable-fpm --with-fpm-user = _www --with-fpm-group = _www --with -curl --with-mysqli = mysqlnd --with-pdo-mysql = mysqlnd …

php ubuntu pthreads apache2 php-7

3
推荐指数
1
解决办法
2994
查看次数

更改apache2服务器的ssl端口.(ERR_SSL_PROTOCOL_ERROR)

我正在EC2实例上开发apache2环境.为了安全起见,我想更改apache2的ssl端口.我已经确认默认的ssl端口443正在使用chrome浏览器检查页面.但是在修改了ports.conf之后,我在访问这个服务器时遇到了错误,ERR_SSL_PROTOCOL_ERROR,如https:// xxxxxxx:18443 /

是否有更改ssl端口的设置?

听口

$ ss -lnt
State       Recv-Q Send-Q                         Local Address:Port                           Peer Address:Port
LISTEN      0      128                                        *:22                                        *:*
LISTEN      0      64                                         *:7777                                      *:*
LISTEN      0      50                                 127.0.0.1:3306                                      *:*
LISTEN      0      128                                       :::22                                       :::*
LISTEN      0      128                                       :::18443                                    :::*
Run Code Online (Sandbox Code Playgroud)

/etc/apache2/ports.conf

#Listen 80

<IfModule ssl_module>
        Listen 18443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 18443
</IfModule>
Run Code Online (Sandbox Code Playgroud)

环境

  • 操作系统:ubuntu 14.04服务器(Amazon/EC2 AMI)
  • apache:Apache/2.4.7(Ubuntu)

EC2入站安全策略

Custom TCP rule: TCP, 18443, 0.0.0.0/0
Custom UDP rule: UDP, 18443, 0.0.0.0/0
Run Code Online (Sandbox Code Playgroud)

apache ssl https apache2 amazon-ec2

3
推荐指数
1
解决办法
2万
查看次数

在apache error_log中非常奇怪的条目.这是一次探险钓鱼探险吗?

当这个庞大的块出现时,我正在为apache拖尾我的错误日志.以前从没见过这样的东西.IP映射到RIPE网络协调中心,此处带有PO框
链接

这是我应该深入研究的吗?在谷歌搜索时,我找不到太多关于这一点,除了RIPE似乎是一个ISP.

[Tue Mar 15 21:34:44.775251 2016] [core:error] [pid 22280] (36)File name too long: [client 93.113.125.12:44444] AH00036: access to /we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages failed (filesystem path '/var/www/html/we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages_we_are_looking_for_not_found_pages')

apache apache2 error-log

3
推荐指数
1
解决办法
978
查看次数