Apache errors:
1. 403 error:- If you are receiving a 403 forbidden error, and get the apache error log as following,
pcfg_openfile: unable to check htaccess file, ensure it is readable, you will think this as permission error of .htaccess. But Actually this will be the permission error of website dowcument root. Please change the permission according to following,
=-=-
Go to Document root of website and execute the following script,
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
=-=-
The issue will be fixed.
2. Apache failed to start with the error as,
[root@ ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[root@ ~]#
To fix,
First check any other application using apache port,
[root@server /]# netstat -lnp | grep :80
o/p should be in the form of PID/httpd
If you find any other application other that apache kill the process ID with the command kill -9 PID and restart apache. Try changing the apache port also.
Another method
1. Change the port 80 in httpd.conf to port 88 just to unbind it.
2. Change the 443 (https) port in /etc/httpd/conf.d/ssl.conf
3. [root@ ~]# service httpd stop
4. Changing ports back to 80 and 443 in both files ssl.conf and httpd.conf:
[root@ ~]# nano /etc/httpd/conf.d/ssl.conf
[root@ ~]# nano /etc/httpd/conf/httpd.conf
5. [root@ ~]# fuser 80/tcp
6. [root@ ~]# fuser 443/tcp
7. [root@ conf.d]# lsof -i :443
httpd PID
8. [root@ conf.d]# lsof -i :80
httpd PID
9. kill -9 PID
10. [root@ conf.d]# service httpd start
1. 403 error:- If you are receiving a 403 forbidden error, and get the apache error log as following,
pcfg_openfile: unable to check htaccess file, ensure it is readable, you will think this as permission error of .htaccess. But Actually this will be the permission error of website dowcument root. Please change the permission according to following,
=-=-
Go to Document root of website and execute the following script,
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
=-=-
The issue will be fixed.
2. Apache failed to start with the error as,
[root@ ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[root@ ~]#
To fix,
First check any other application using apache port,
[root@server /]# netstat -lnp | grep :80
o/p should be in the form of PID/httpd
If you find any other application other that apache kill the process ID with the command kill -9 PID and restart apache. Try changing the apache port also.
Another method
1. Change the port 80 in httpd.conf to port 88 just to unbind it.
2. Change the 443 (https) port in /etc/httpd/conf.d/ssl.conf
3. [root@ ~]# service httpd stop
4. Changing ports back to 80 and 443 in both files ssl.conf and httpd.conf:
[root@ ~]# nano /etc/httpd/conf.d/ssl.conf
[root@ ~]# nano /etc/httpd/conf/httpd.conf
5. [root@ ~]# fuser 80/tcp
6. [root@ ~]# fuser 443/tcp
7. [root@ conf.d]# lsof -i :443
httpd PID
8. [root@ conf.d]# lsof -i :80
httpd PID
9. kill -9 PID
10. [root@ conf.d]# service httpd start