{"id":29,"date":"2024-12-13T14:16:30","date_gmt":"2024-12-13T14:16:30","guid":{"rendered":"http:\/\/123.249.119.122\/Wordpress\/?p=29"},"modified":"2024-12-27T00:44:42","modified_gmt":"2024-12-27T00:44:42","slug":"when-the-websitewordpress-is-not-accessiblehow-to-solve-the-problem","status":"publish","type":"post","link":"http:\/\/123.249.119.122\/Wordpress\/index.php\/2024\/12\/13\/when-the-websitewordpress-is-not-accessiblehow-to-solve-the-problem\/","title":{"rendered":"When the website(WordPress) is not accessible,how to solve the problem?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Premise:The LAMP enviorment and WordPress website has been successfully deployed.But now,the website is not accessible.Can&#8217;t visit the website by &#8216;IP Address:Port\/content(directory)&#8217; or &#8216;Domain Name:Port\/content(directory)&#8217;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the checklist:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1.Input <strong>&#8216;systemctl status httpd&#8217;<\/strong> 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 <strong>&#8216;systemctl stop nginx(or another server name)&#8217;<\/strong> to stop the other webserver,then input <strong>&#8216;systemctl start httpd&#8217;<\/strong> to start Apache webserver.And then,Apache server will be &#8216;running&#8217;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2.Can&#8217;t start Apache server?You can input <strong>&#8216;systemctl status httpd&#8217;<\/strong> to check the problem.And you will see the guidance to fix the error.The main configuration file <strong>&#8216;httpd.conf&#8217;<\/strong> located in the directory <strong>&#8216;\/etc\/httpd\/conf&#8217;<\/strong>.And the extended configuration files located in the directory <strong>&#8216;\/etc\/httpd\/conf.d&#8217;<\/strong>,the function modules configuration files located in the directory <strong>&#8216;\/etc\/httpd\/conf.modules.d&#8217;<\/strong>.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&#8217;t conflict.File <strong>&#8216;php.conf&#8217;<\/strong> must be located in the directory <strong>&#8216;\/etc\/httpd\/conf.d&#8217;<\/strong>.Finally,you can input <strong>&#8216;systemctl restart httpd&#8217;<\/strong> to restart Apache server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3.Where are these contents?Are these contents in the correct directory?According to the configuration file <strong>&#8216;httpd.conf&#8217;<\/strong>,the initial Document Root is <strong>&#8216;\/var\/www\/html&#8217;<\/strong>.You can check,modify,add,delete contents in <strong>&#8216;\/var\/www\/html&#8217;<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4.Check the status of mysqld and php.Input <strong>&#8216;systemctl status mysqld&#8217;<\/strong> and <strong>&#8216;systemctl status php-fpm&#8217;<\/strong>.When the status is not running,input <strong>&#8216;systemctl start mysqld&#8217;<\/strong> and <strong>&#8216;systemctl start php-fpm&#8217;<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5.Login in mysql.You can input <strong>&#8220;mysql -h&#8217;host&#8217; -u&#8217;username&#8217; -p&#8217;password'&#8221;<\/strong> to login in mysql.When mysql is accessible,you can input <strong>&#8220;show databases;&#8221;<\/strong> to check databases;input <strong>&#8220;use &#8216;database&#8217;;&#8221;<\/strong> to get in the database,input <strong>&#8216;show tables;&#8217;<\/strong> to check tables in the database.You can input mysql language to query,delete,manipulate the data.Does the account &#8216;root&#8217; accessible for other hosts or the Apache host?Does the account &#8216;root&#8217; have any authorization?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">6.Check the connection between mysql and php.You can input <strong>&#8220;yum install -y php-mysqlnd&#8221;<\/strong> 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 &#8220;OK&#8221;,the connection is OK.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">7.Service Unavailable(503).&#8221;The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.&#8221;It means the php configuration file has been modified,and it&#8217;s incorrect.You should check and correct the php configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">8.Moved Permanently(301).First,delete cookies in your website.If it&#8217;s not available,then,check your Apache configuration file <strong>&#8220;httpd.conf&#8221;<\/strong>.Check <strong>&#8220;Redirect Premanent&#8221;<\/strong> 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&#8217;s redirected fequently from homepage to homepage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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>\n\n\n\n<p class=\"wp-block-paragraph\">P.S. The bold text means the file,directory or code,you can reply it in your command line.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Premise:The LAMP enviorment and WordPress website has been successfully deployed.But now,the website is not accessible.Can&#8217;t visit the website by &#8216;IP Address:Port\/content(directory)&#8217; or &#8216;Domain Name:Port\/content(directory)&#8217;. This is the checklist: 1.Input &#8216;systemctl status httpd&#8217; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":5,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":42,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions\/42"}],"wp:attachment":[{"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/123.249.119.122\/Wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}