{"id":9114,"date":"2023-12-15T10:14:11","date_gmt":"2023-12-15T10:14:11","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=ht_kb&#038;p=9114"},"modified":"2024-10-04T06:20:02","modified_gmt":"2024-10-04T06:20:02","password":"","slug":"fixing-404-and-502-errors-on-cloudpanel","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/","title":{"rendered":"How to Fix 404 and 502 Errors on CloudPanel"},"content":{"rendered":"\n<p>After deploying your website, particularly Python or Laravel-based website, you may encounter 502 error on your website. We will look at potential issues and how to resolve them<\/p>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>uWSGI or Gunicorn not running.<\/strong><\/li>\n<\/ol>\n\n\n\n<p>One of these service provides a gateway for your website and it may not be running on your VPS. To check its status, run one of these commands:<\/p>\n\n\n\n<p>For uWSGI:<\/p>\n\n\n\n<p><em><code><strong>systemctl status uwsgi<\/strong><\/code><\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>For gunicorn:<\/p>\n\n\n\n<p><em><code><strong>systemctl status gunicorn<\/strong><\/code><\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>If the service is not running, you can try restarting it.<\/p>\n\n\n\n<p><strong><code>systemctl restart uwsgi<\/code><\/strong><\/p>\n\n\n\n<p><code><strong>systemctl restart gunicorn<\/strong><\/code><br><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/p>\n\n\n\n<p>2. <strong>Permissions<\/strong><\/p>\n\n\n\n<p>You may have uploaded the files as root, and the owner designated for the website in the VPS may not be root. This will cause 502 errors.<\/p>\n\n\n\n<p>You can run the following command to check the owner and group allocated to the files:<\/p>\n\n\n\n<p><strong><code>ls -l<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>If your websites have owner root and\/or group root, it will cause a permission issue to your website. You can use the following command to change:<\/p>\n\n\n\n<p><strong><code>chown -R owner:group \/path\/to\/file<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>The owner and group should be the Site User of the current website. To check Site User, click the Setting tab on your website dashboard.<\/p>\n\n\n\n<p>Also, the read\/write permissions may be incorrect. Folders should have 755 while files should have 644. This allows them to be accessible, readable and writable where needed.<\/p>\n\n\n\n<p>Use this commands to change them to the correct permissions<\/p>\n\n\n\n<p><strong><code>find . -type d -print0 | xargs -0 chmod 0755<br>find . -type f -print0 | xargs -0 chmod 0644<\/code><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>These are the two potential causes of 404 and 502 errors in websites migrated to CloudPanel. Ensure that the gunicorn or uWSGI socket is running, as well as the permissions are set correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After deploying your website, particularly Python or Laravel-based website, you may encounter 502 error on your website. We will look at potential issues and how to resolve them One of these service provides a gateway for your website and it may not be running on your VPS. To check its status, run one of these [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[2132],"doc_tag":[],"class_list":["post-9114","docs","type-docs","status-publish","hentry","doc_category-cloudpanel"],"year_month":"2026-06","word_count":272,"total_views":"0","reactions":{"happy":"1","normal":"0","sad":"0"},"author_info":{"name":"Ian M","author_nicename":"ian","author_url":"https:\/\/truehost.com\/support\/author\/ian\/"},"doc_category_info":[{"term_name":"Cloudpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloudpanel\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix 404 and 502 Errors on CloudPanel -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix 404 and 502 Errors on CloudPanel -\" \/>\n<meta property=\"og:description\" content=\"After deploying your website, particularly Python or Laravel-based website, you may encounter 502 error on your website. We will look at potential issues and how to resolve them One of these service provides a gateway for your website and it may not be running on your VPS. To check its status, run one of these [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-04T06:20:02+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/fixing-404-and-502-errors-on-cloudpanel\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/fixing-404-and-502-errors-on-cloudpanel\\\/\",\"name\":\"How to Fix 404 and 502 Errors on CloudPanel -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\"},\"datePublished\":\"2023-12-15T10:14:11+00:00\",\"dateModified\":\"2024-10-04T06:20:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/fixing-404-and-502-errors-on-cloudpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/fixing-404-and-502-errors-on-cloudpanel\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/fixing-404-and-502-errors-on-cloudpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix 404 and 502 Errors on CloudPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix 404 and 502 Errors on CloudPanel -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix 404 and 502 Errors on CloudPanel -","og_description":"After deploying your website, particularly Python or Laravel-based website, you may encounter 502 error on your website. We will look at potential issues and how to resolve them One of these service provides a gateway for your website and it may not be running on your VPS. To check its status, run one of these [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/","article_modified_time":"2024-10-04T06:20:02+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/","name":"How to Fix 404 and 502 Errors on CloudPanel -","isPartOf":{"@id":"https:\/\/www.truehost.com\/support\/#website"},"datePublished":"2023-12-15T10:14:11+00:00","dateModified":"2024-10-04T06:20:02+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/fixing-404-and-502-errors-on-cloudpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Fix 404 and 502 Errors on CloudPanel"}]},{"@type":"WebSite","@id":"https:\/\/www.truehost.com\/support\/#website","url":"https:\/\/www.truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/www.truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/www.truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/www.truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=9114"}],"version-history":[{"count":7,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9114\/revisions"}],"predecessor-version":[{"id":14445,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9114\/revisions\/14445"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=9114"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=9114"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=9114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}