Premise:The LAMP enviorment and WordPress website has been successfully deployed.But now,the website is not accessible.Can’t visit the website by ‘IP Address:Port/content(directory)’ or ‘Domain Name:Port/content(directory)’.
This is the checklist:
1.Input ‘systemctl status httpd’ in the terminal of the Linux operating system,check the status of Apache.Is the Apache webserver running?Is the other webserver(like Nginx,and so on) running?When the server is not running,input ‘systemctl stop nginx(or another server name)’ to stop the other webserver,then input ‘systemctl start httpd’ to start Apache webserver.And then,Apache server will be ‘running’.
2.Can’t start Apache server?You can input ‘systemctl status httpd’ to check the problem.And you will see the guidance to fix the error.The main configuration file ‘httpd.conf’ located in the directory ‘/etc/httpd/conf’.And the extended configuration files located in the directory ‘/etc/httpd/conf.d’,the function modules configuration files located in the directory ‘/etc/httpd/conf.modules.d’.You can modify these configuration files to fix the error.Every configuration file must located in the correct directory,and the file contents must be correct.The port can’t conflict.File ‘php.conf’ must be located in the directory ‘/etc/httpd/conf.d’.Finally,you can input ‘systemctl restart httpd’ to restart Apache server.
3.Where are these contents?Are these contents in the correct directory?According to the configuration file ‘httpd.conf’,the initial Document Root is ‘/var/www/html’.You can check,modify,add,delete contents in ‘/var/www/html’.
4.Check the status of mysqld and php.Input ‘systemctl status mysqld’ and ‘systemctl status php-fpm’.When the status is not running,input ‘systemctl start mysqld’ and ‘systemctl start php-fpm’.
5.Login in mysql.You can input “mysql -h’host’ -u’username’ -p’password’” to login in mysql.When mysql is accessible,you can input “show databases;” to check databases;input “use ‘database’;” to get in the database,input ‘show tables;’ to check tables in the database.You can input mysql language to query,delete,manipulate the data.Does the account ‘root’ accessible for other hosts or the Apache host?Does the account ‘root’ have any authorization?
6.Check the connection between mysql and php.You can input “yum install -y php-mysqlnd” to install.You can make a new file,input write php language in the file,and check the connection between mysql and php.If the file output “OK”,the connection is OK.
7.Service Unavailable(503).”The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”It means the php configuration file has been modified,and it’s incorrect.You should check and correct the php configuration file.
8.Moved Permanently(301).First,delete cookies in your website.If it’s not available,then,check your Apache configuration file “httpd.conf”.Check “Redirect Premanent” in the configuration file.Redirect to which website?The server name is what?And then,if the website or server name is wrong,correct it,or delete these lines.It’s redirected fequently from homepage to homepage.
You can refer the checklist to fix the error.After the error is fixed,the website(WordPress) is accessible,and you can visit the website(WordPress) normally.
P.S. The bold text means the file,directory or code,you can reply it in your command line.
Leave a Reply