我只是进行了基本安装,Apache 2.4启动就好了.我正在从运行Apache 2.2的旧服务器迁移.
当我将文件放入包含VirtualHost定义的/etc/httpd/conf.d并重启服务器时,它会在启动时崩溃.此VirtualHost定义是我以前的服务器使用的定义.
# systemctl restart httpd.service Job for httpd.service Failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. # systemctl -l status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: Failed (Result: exit-code) since Sun 2017-01-22 03:03:35 UTC; 10s ago Docs: man:httpd(8) man:apachectl(8) Process: 20621 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited,status=1/FAILURE) Process: 20620 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited,status=1/FAILURE) Main PID: 20620 (code=exited,status=1/FAILURE) Jan 22 03:03:35 production-frontend-0 systemd[1]: Starting The Apache HTTP Server... Jan 22 03:03:35 production-frontend-0 systemd[1]: httpd.service: main process exited,code=exited,status=1/FAILURE Jan 22 03:03:35 production-frontend-0 kill[20621]: kill: cannot find process "" Jan 22 03:03:35 production-frontend-0 systemd[1]: httpd.service: control process exited,code=exited status=1 Jan 22 03:03:35 production-frontend-0 systemd[1]: Failed to start The Apache HTTP Server. Jan 22 03:03:35 production-frontend-0 systemd[1]: Unit httpd.service entered Failed state. Jan 22 03:03:35 production-frontend-0 systemd[1]: httpd.service Failed. #
<VirtualHost *:80> ServerName mydomain.com ServerAlias www.mydomain.com <Directory /home/kenny/domains/mydomain.com/html> Options Indexes FollowSymLinks MultiViews ExecCGI Includes AllowOverride All </Directory> DocumentRoot /home/kenny/domains/mydomain.com/html CustomLog /home/kenny/domains/mydomain.com/logs/access.log combined ErrorLog /home/kenny/domains/mydomain.com/logs/error.log ScriptAlias /cgi-bin /home/kenny/domains/mydomain.com/cgi RewriteEngine on # Does the file exist? RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ http://mydomain.otherdomain.com [R,L] </VirtualHost>
我检查了文件语法:
# httpd -t Syntax OK #
如果我删除文件并重新启动,那么Apache启动就好了.我确保我的文件的权限与现有的conf文件匹配:
# ls -l total 20 -rw-r--r--. 1 root root 2926 Nov 14 18:04 autoindex.conf -rw-r--r--. 1 root root 366 Nov 14 18:05 README -rw-r--r--. 1 root root 1252 Nov 14 16:53 userdir.conf -rw-r--r--. 1 root root 674 Jan 22 03:03 vhost.mydomain.com.conf -rw-r--r--. 1 root root 824 Nov 14 16:53 welcome.conf #
Apache 2.4中的某些内容是否与我的VirtualHost定义相冲突?
在拒绝我的配置的标准Google Compute实例中是否存在某种安全措施?
是否有一些配置选项我几年前在我的旧服务器上进行了调整,而我忘记了我需要调整我的Google Compute实例?