I don't get it -- httpd fails to start when using virtual hosts

General support questions
Post Reply
doulos
Posts: 38
Joined: 2015/11/07 17:55:32

I don't get it -- httpd fails to start when using virtual hosts

Post by doulos » 2018/11/03 22:09:27

journalctl -xe

Code: Select all

-- Unit httpd.service has begun starting up.
Nov 03 14:45:48 black1 httpd[1688]: httpd: Syntax error on line 355 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/sites-enabled/10.0.0.52.conf: No such file or directory
Nov 03 14:45:48 black1 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 03 14:45:48 black1 kill[1690]: kill: cannot find process ""
Nov 03 14:45:48 black1 systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 03 14:45:48 black1 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
Image
10.0.0.52.conf

Code: Select all

<VirtualHost *:80>
    ServerName www.10.0.0.52	
    DocumentRoot /home/doulos/html
    ServerAlias 10.0.0.52	
	DirectoryIndex index.html index.htm index.php	
	<Directory /home/doulos/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Require all granted
	</Directory>	
    ErrorLog /var/www/error.log
    CustomLog /var/www/access.log combined
</VirtualHost>
Image

Code: Select all

[doulos@black1 ~]$ sudo groups doulos
doulos : doulos wheel apache
What am I doing wrong? I have this working fine on three other servers. Am I forgetting something?

User avatar
TrevorH
Site Admin
Posts: 33233
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by TrevorH » 2018/11/04 01:47:30

10.0.0.52.conf is a symlink. What is the target of that symlink?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

doulos
Posts: 38
Joined: 2015/11/07 17:55:32

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by doulos » 2018/11/04 04:28:31

Image
/etc/httpd/sites-available/10.0.0.52.conf

Code: Select all

<VirtualHost *:80>
    ServerName www.10.0.0.52	
    DocumentRoot /home/doulos/html
    ServerAlias 10.0.0.52	
	DirectoryIndex index.html index.htm index.php	
	<Directory /home/doulos/html/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Require all granted
	</Directory>	
    ErrorLog /var/www/error.log
    CustomLog /var/www/access.log combined
</VirtualHost>

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by hunter86_bg » 2018/11/04 06:10:02

Directory /home/doulos/html/
If SELINUX is running - it would not allow this.
You need to enable access to the home dir by activating 'httpd_enable_homedirs' boolean.
As per my opinion, apache has no place in '/home' and bellow.Best practice is to either use '/var/www/HTML/your_web_site/' or a separate mount point -for example: '/webcontent/your_web_site/' .

User avatar
TrevorH
Site Admin
Posts: 33233
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by TrevorH » 2018/11/04 11:27:38

I'm not sure you answered the question about where does the symlink point to? And the file you show in sites-available says there that it is 0 bytes.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

doulos
Posts: 38
Joined: 2015/11/07 17:55:32

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by doulos » 2018/11/04 22:58:14

TrevorH, I see what you mean. Thanks for pointing that out. I am away from home, but I will check later today.

doulos
Posts: 38
Joined: 2015/11/07 17:55:32

Re: I don't get it -- httpd fails to start when using virtual hosts

Post by doulos » 2018/11/05 00:00:54

OK, I see that I am doing wrong. Wiping and starting all over. Thanks for your time.

Post Reply