所以我有2个配置文件。
网站配置文件
<VirtualHost *:80>
ServerName www.mysite.com
ServerAlias mysite.com *.mysite.com
DocumentRoot /var/www/mysite/www
ErrorDocument 404 /redirect.php
ErrorLog logs/application/mysite.error_log
CustomLog logs/application/mysite.access_log Combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
视频上传.conf
<VirtualHost *:80>
ServerName upload.mysite.com
DocumentRoot /var/www/videouploader/www
ErrorLog logs/application/videoupload.error_log
CustomLog logs/application/videoupload.access_log Combined
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
看,我们有大约 50 个可能的 some.mysite.com 子域,它们都执行不同的操作,但它们都由相同的文档根提供服务。
我想将 *.mysite.com 保留在那里,只是因为它比拥有世界上最长的 serveralias 线路更干净,而且它可以防止弱智尝试 banananan.mysite.com 或其他不起作用的东西。
我已经通读了 apache 文档,但它并没有真正适合这种情况的任何内容。有人知道怎么做吗?
Apache 线程堆积在我的一台 Web 服务器上(300-500 个并发请求,有些需要 3-8 秒来处理!),但 CPU 使用率非常低(约 10%)。因此,页面加载时间正在减慢。我有足够的空闲 CPU 功率。我怎样才能使用更多的它来更快地处理这些线程?
这是顶部的顶部......
Tasks: 469 total, 1 running, 468 sleeping, 0 stopped, 0 zombie
Cpu(s): 8.1% us, 1.7% sy, 0.0% ni, 90.3% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 9181012k total, 7998772k used, 1182240k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11351 apache 15 0 364m 30m 17m S 11.9 0.3 0:00.73 …Run Code Online (Sandbox Code Playgroud) 今天浏览我的评估日志,我发现有很多条目试图访问页面。(不存在的)。喜欢
- robots.txt(我知道这是用来做什么的)
- 申请
- favicon.ico(我知道这是用来做什么的)
- 等等
因此,显然404返回了 a但还有其他 3 位代码(?)以及 404。
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" 404 312
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" 404 285
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" 404 286
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" 404 287
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" 404 288
ip-address - - [date & time] "GET /some/file_OR_folder HTTP/1.1" …Run Code Online (Sandbox Code Playgroud) 我正在使用的 PHP 程序 ( LConf ) 使用sudo.
我已允许用户apache运行脚本并使用sudo -u apache /usr/local/LConf/lconf_deploy.sh.
我在lconf_deploy.sh拨打时被提示输入密码/usr/bin/sudo -u icinga /usr/local/LConf/LConfExport.pl -o /etc/icinga/lconf -v,但在此线路之前或之后拨打线路没有问题。
在阅读了很多(在 stackexchange 和互联网上的其他地方)关于在这种情况下该怎么做之后,我已经禁用requiretty并使用NOPASSWD了所有我能想到的会影响这种情况的东西。
# cat /etc/sudoers | grep -v "#"
Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC …Run Code Online (Sandbox Code Playgroud) VirtualBox 和 CentOS 6,从主机重启后无法连接到 httpd。如果我做一个
iptables -I 输入 -p tcp -m tcp --dport 80 -j 接受
然后它可以工作,但是每次我重新启动时,我都必须以 root 身份登录并执行此操作。我该如何解决这个问题,这样我就不必在每次重新启动后都这样做
我看到 GET 请求如下:
"GET /assets/)!==t&&(e.html(e.data( HTTP/1.1" 200 3538 "-" "Java/1.7.0_25"
Run Code Online (Sandbox Code Playgroud)
在我的日志中,用于托管 Rails 应用程序的盒子。看起来很可疑,就像有人在探查应用程序,但不能确定。
有什么建议?
我已经编辑了我的 conf.d/ssl.conf 文件并将 TransferLog 指令从:
TransferLog logs/ssl_access_log
Run Code Online (Sandbox Code Playgroud)
到
TransferLog "|/usr/sbin/rotatelogs logs/ssl_access_log.%Y-%m-%d.log 60"
Run Code Online (Sandbox Code Playgroud)
(我使用 60 秒进行测试)
由于该更改和 httpd 重新启动,我原来的 ssl_access_log 没有更新,也没有生成新日志。我错过了什么?
在我的错误日志中,我收到此消息
Could not open log file 'logs/ssl_access_log.2014-05-30.log' (No such file or directory)
piped log program '/usr/sbin/rotatelogs logs/ssl_access_log.%Y-%m-%d.log 60' failed unexpectedly
Run Code Online (Sandbox Code Playgroud) 我有一个运行 CentOS 的 VPS。我安装了apache并配置了访问日志。刚刚查了一下,发现了一些有趣的流量:
VPS-Hostname MYIP MYIP - - [23/Dec/2014:16:47:20 -0500] "GET / HTTP/1.1" 200 13
VPS-Hostname MYIP MYIP - - [23/Dec/2014:16:47:20 -0500] "GET /favicon.ico HTTP/1.1" 404 209
VPS-Hostname MYIP MYIP - - [23/Dec/2014:16:47:20 -0500] "GET /favicon.ico HTTP/1.1" 404 209
VPS-Hostname 66.119.41.34 66.119.41.34 - - [23/Dec/2014:19:05:53 -0500] "GET /xvidtox-china-company HTTP/1.1" 404 219
VPS-Hostname 66.119.41.34 66.119.41.34 - - [23/Dec/2014:19:15:18 -0500] "GET /xdmx-rental-cars-insurance HTTP/1.1" 404 224
VPS-Hostname 66.119.41.34 66.119.41.34 - - [23/Dec/2014:19:16:47 -0500] "GET /nv-life-insurance-dies-when-premium/?si=2aa54ab4c0b33 HTTP/1.1" 404 234
VPS-Hostname 119.63.196.62 119.63.196.62 - …Run Code Online (Sandbox Code Playgroud) 我在 CentOS 6.6 上运行 httpd。我已经成功地在端口 80 上建立了一个站点,但现在我希望在端口 82 上拥有该站点,因此当我<myip>:82在浏览器中键入时,我可以查看该站点,但不能查看<myip>:80或<myip>.
在我的httpd.conf文件中,我已更改Listen 192.168.1.18:80为Listen 192.168.1.18:82,并且已在路由器上转发端口 82。但是当我尝试重新启动该过程时,它会出现以下错误:
(13)Permission denied: make_sock: could not bind to address 192.168.1.18:82
no listening sockets available, shutting down
Run Code Online (Sandbox Code Playgroud)
我是否必须在其他任何地方http.conf或其他地方将端口更改为 82 ?在端口 80 上一切正常。对不起,如果我不够清楚,如果需要,我会澄清更多信息。
我有以下 Dockerfile 应该启动 Centos 机器并安装 httpd:
FROM centos:centos6.6
RUN yum install -y httpd
RUN chkconfig httpd on;
RUN /etc/init.d/httpd start
EXPOSE 80
CMD ["/bin/bash"]
Run Code Online (Sandbox Code Playgroud)
我构建图像:
docker build --no-cache -t centos_http .
Run Code Online (Sandbox Code Playgroud)
构建说:
...
Step 4/6 : RUN /etc/init.d/httpd start
---> Running in 0766e84ec292
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2 for ServerName
[ OK ]
...
Successfully built 5380a0bacdfb
Run Code Online (Sandbox Code Playgroud)
但是如果我运行图像:
docker run -p 8090:80 -it 5380
[root@eda7400a46a9 /]# ps -ef | grep …Run Code Online (Sandbox Code Playgroud) httpd ×10
apache-2.2 ×5
centos ×2
httpd.conf ×2
security ×2
bash ×1
centos6 ×1
docker ×1
hacking ×1
http ×1
iptables ×1
linux ×1
log-files ×1
performance ×1
perl ×1
php ×1
port ×1
sudo ×1
ubuntu ×1
virtualhost ×1
web-hosting ×1
web-server ×1