{"id":9704,"date":"2025-10-07T04:17:29","date_gmt":"2025-10-07T04:17:29","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=9704"},"modified":"2025-10-08T04:03:33","modified_gmt":"2025-10-08T04:03:33","slug":"how-to-change-port-number-in-apache-in-ubuntu","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/","title":{"rendered":"How to Change Port Number in Apache"},"content":{"rendered":"\n<p>Apache is a popular web server used by millions of websites, blogs and organizations. It offers many features and supports high traffic server loads. By default, it runs on port 80 for HTTP and port 443 for HTTPS. But sometimes, you may need to run Apache server on different ports. In this article, we will learn how to change port number in Apache server.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#Why_Change_Port_Number_in_Apache\" >Why Change Port Number in Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#How_to_Change_Port_Number_in_Apache\" >How to Change Port Number in Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#1_Locate_Configuration_File\" >1. Locate Configuration File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#2_Modify_Listen_Directive\" >2. Modify Listen Directive<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#3_Optional_Update_ServerName_VirtualHost\" >3. (Optional) Update ServerName &amp; VirtualHost<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#4_Restart_Server\" >4. Restart Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#5_Update_Firewall\" >5. Update Firewall<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#6_Test_New_Configuration\" >6. Test New Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Change_Port_Number_in_Apache\"><\/span>Why Change Port Number in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several reasons why you may need to change port number in Apache server.<\/p>\n\n\n\n<p>1. <strong>Multiple Services<\/strong> &#8211; Apache server is commonly used along with NGINX server. In this configuration, NGINX is used as reverse proxy and Apache is used as web server. So NGINX needs to run on port 80\/443. Therefore, you need to change Apache port number.<br>2. <strong>Better Security<\/strong> &#8211; Apache server is commonly used to host WordPress websites. There are millions of WordPress sites all over the world, and they are commonly targeted by hackers and bots. They know that most sites and blogs run on port 80 so it is a common target for online attacks. By changing Apache port number, you can make it difficult for automated bots and scripts to hack your site.<br>3. <strong>Testing Purposes<\/strong> &#8211; If you need to run Apache server in development or staging environment, then you may need to run it on a different port. This is because in most cases, the production server will be running on ports 80 and 443.<br>4. <strong><a href=\"https:\/\/www.altexsoft.com\/blog\/system-integration\/\">System Integration<\/a><\/strong> &#8211; You may already have certain software or processes sending data to a specific port, and need Apache server to listen to that port only. So you will need to run Apache on a different server.<br>5. <strong>Firewall Rules<\/strong> &#8211; Since ports 80 and 443 are well-known targets for online attacks, many organizations block them by default. In such cases, you need to change port number in Apache server.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Change_Port_Number_in_Apache\"><\/span>How to Change Port Number in Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now let us look at the steps to change port number in Apache server. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Locate_Configuration_File\"><\/span>1. Locate Configuration File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We need to modify Apache configuration file for our purpose. Depending on your operating system and type of Apache installation, the location of its configuration file may vary.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Windows<\/strong> &#8211; If you have installed Apache server on Windows system, then you will find config file at C:\\Program Files\\Apache Software Foundation\\Apache2.4\\conf\\httpd.conf.<\/li>\n\n\n\n<li><strong>XAMPP\/WAMP<\/strong> &#8211; If you run Apache using other Windows software like XAMPP\/WAMP then you will find config file located at C:\\xampp\\apache\\conf\\httpd.conf.<\/li>\n\n\n\n<li><strong>Ubuntu\/Debian<\/strong> &#8211; Config file is present at \/etc\/apache2\/ports.conf<\/li>\n\n\n\n<li><strong>RHEL\/CentOS<\/strong> &#8211; In this case, the config file is located at \/etc\/httpd\/conf\/httpd.conf<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Modify_Listen_Directive\"><\/span>2. Modify Listen Directive<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open configuration file using text editor such vi, nano, notepad, etc. Look for the <em>Listen<\/em> directive followed by port number. It should look like.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Listen 80 # for HTTP<br>OR<br>Listen 443 # for HTTPS<\/pre>\n\n\n\n<p>The above directive instructs Apache server to listen to port 80 and 443 respectively. Change the port numbers as per your requirement. Here is an example to listen to port 80 for HTTP and 8443 for HTTPS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Listen 8080 # for HTTP<br>OR<br>Listen 8443 # for HTTPS<\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Optional_Update_ServerName_VirtualHost\"><\/span>3. (Optional) Update ServerName &amp; VirtualHost<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In some cases, the ServerName directive in Apache configuration not only mentions the IP address but also the port number, like <em>ServerName 127.0.0.1:80<\/em>. In this case, you need to change the port number to <em>ServerName 127.0.0.1:8080<\/em>.<\/p>\n\n\n\n<p>Similarly, if you have port number mentioned in VirtualHost tags of your virtual host config file, then you need to change that too. For example, if you have <em>&lt;VirtualHost 127.0.0.1:80&gt;<\/em>, change it to <em>&lt;VirtualHost 127.0.0.1:8080&gt;<\/em>.<\/p>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Restart_Server\"><\/span>4. Restart Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Restart Apache Server to apply changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart apache2 # For Ubuntu\/Debian<br>sudo systemctl restart httpd   # For CentOS\/RHEL<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Update_Firewall\"><\/span>5. Update Firewall<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Ports 80 and 443 may be open on your system&#8217;s firewall, when Apache was running on these ports. Now that it is running on a different port, you need to block these ports and open the new ports 8080 and 8443.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Test_New_Configuration\"><\/span>6. Test New Configuration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open web browser and visit your website with new port number. For example, if your website is hosted at 54.43.32.21 then visit http:\/\/54.43.32.21:8080 to see if it works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to run Apache server on different port. You can use these steps as per your operating system. If you run a high-traffic website on Apache server, then it is better to change port on Apache. It will automatically protect your site from most of automated bots that target port 80 and 443.<\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/password-protect-directory-apache\/\">How to Password Protect Directory in Apache<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/speed-apache-web-server\/\">How to Speed Up Apache Web Server<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/apache-deny-access-to-url-files-directory\/\">Apache Deny Access to URL, Files &amp; Directory<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.<\/p>\n","protected":false},"author":1,"featured_media":9719,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[36],"class_list":["post-9704","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","tag-change-port"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change Port Number in Apache - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change Port Number in Apache - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-07T04:17:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-08T04:03:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"312\" \/>\n\t<meta property=\"og:image:height\" content=\"208\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Change Port Number in Apache\",\"datePublished\":\"2025-10-07T04:17:29+00:00\",\"dateModified\":\"2025-10-08T04:03:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/\"},\"wordCount\":753,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1\",\"keywords\":[\"change port\"],\"articleSection\":[\"Apache\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/\",\"name\":\"How to Change Port Number in Apache - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1\",\"datePublished\":\"2025-10-07T04:17:29+00:00\",\"dateModified\":\"2025-10-08T04:03:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1\",\"width\":312,\"height\":208,\"caption\":\"change port number in apache\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-change-port-number-in-apache-in-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change Port Number in Apache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change Port Number in Apache - Ubiq BI","description":"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.","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:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Change Port Number in Apache - Ubiq BI","og_description":"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2025-10-07T04:17:29+00:00","article_modified_time":"2025-10-08T04:03:33+00:00","og_image":[{"width":312,"height":208,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Change Port Number in Apache","datePublished":"2025-10-07T04:17:29+00:00","dateModified":"2025-10-08T04:03:33+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/"},"wordCount":753,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1","keywords":["change port"],"articleSection":["Apache"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/","name":"How to Change Port Number in Apache - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1","datePublished":"2025-10-07T04:17:29+00:00","dateModified":"2025-10-08T04:03:33+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often system administrators need to run Apache server on different port. Here is how to change port number in Apache server.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1","width":312,"height":208,"caption":"change port number in apache"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-port-number-in-apache-in-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Change Port Number in Apache"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/10\/change-port-number-in-apache-server.jpg?fit=312%2C208&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2ww","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=9704"}],"version-history":[{"count":16,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9704\/revisions"}],"predecessor-version":[{"id":9727,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/9704\/revisions\/9727"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/9719"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=9704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=9704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=9704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}