Apache won't serve pages
Apache won't serve pages
I've configured Apache in CentOS 7 in the same way as I successfully did on a Fedora 20 server, and expected it to work. However, I've found that pages aren't being displayed.
SElinux is disabled and I've permitted port 80 in firewalld.
In my /etc/httpd/conf/http.conf, I've added:
<VirtualHost *:80>
ServerName hostname.domain.com
ServerAlias *.domain.com
DocumentRoot /home/username/www
<Directory /home/username/www>
Require all granted
</Directory>
</VirtualHost>
/home/username and /home/username/www are owned by username and permissions are set to 755.
I restarted Apache after making these changes.
Any suggestions?
SElinux is disabled and I've permitted port 80 in firewalld.
In my /etc/httpd/conf/http.conf, I've added:
<VirtualHost *:80>
ServerName hostname.domain.com
ServerAlias *.domain.com
DocumentRoot /home/username/www
<Directory /home/username/www>
Require all granted
</Directory>
</VirtualHost>
/home/username and /home/username/www are owned by username and permissions are set to 755.
I restarted Apache after making these changes.
Any suggestions?
Re: Apache won't serve pages
Any error messages? Anything in /var/log/httpd ?
Re: Apache won't serve pages
Nothing in the Apache log. That's what makes me think it's a firewall issue, but port 80 is open.
Re: Apache won't serve pages
What happens when you try to view your page? What kind of error message do you get in your web browser?
Re: Apache won't serve pages
I've resolved it. For some reason, the firewall rules were discarded (apart from ssh). I'm not sure why, as I used "firewall-cmd --permanent --zone=public --add-port=80/tcp" and then systemctl restart firewalld.service.
Re: Apache won't serve pages
You don't need to restart firewalld after making changes, that is almost the entire point of firewalld - to allow iptables rules to be amended on the fly without affecting running services.
You probably wanted to use --add-service=http not --add-port=80/tcp. It may not make much difference in this particular case but the definition for the service can also include other things that need to be done - for example, the ftp service definition not only opens tcp port 21 but also tells it to load the nf_conntrack_ftp module.
You probably wanted to use --add-service=http not --add-port=80/tcp. It may not make much difference in this particular case but the definition for the service can also include other things that need to be done - for example, the ftp service definition not only opens tcp port 21 but also tells it to load the nf_conntrack_ftp module.
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
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
Re: Apache won't serve pages
OK, so I'll switch standard service rules to use "service" instead. If ssh is opened, and the port is changed, does it detect this change in /etc/ssh/sshd_config and adjust the rule automatically?
Re: Apache won't serve pages
I doubt it.
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
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