{"id":11013,"date":"2024-02-25T08:40:18","date_gmt":"2024-02-25T08:40:18","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=11013"},"modified":"2024-03-30T11:15:53","modified_gmt":"2024-03-30T11:15:53","slug":"how-to-setup-apache-virtual-hosts-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/","title":{"rendered":"How to Setup Apache Virtual Hosts on Ubuntu 22.04"},"content":{"rendered":"\n<p>Apache Virtual Hosts enable you to host multiple websites on a single server. This procedure can improve the server performance and prevent conflicts between websites.&nbsp;<\/p>\n\n\n\n<p>Furthermore, you can add or remove websites without affecting others.&nbsp;<\/p>\n\n\n\n<p>The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on <a href=\"https:\/\/greenwebpage.com\/community\/what-is-ubuntu-understanding-linux-distribution\/\">Ubuntu 22.04<\/a> system.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Setup Apache Virtual Hosts on Ubuntu 22.04?<\/strong><\/h2>\n\n\n\n<p>The following necessary steps can be performed before initializing the Apache virtual host on your Ubuntu machine.&nbsp;<\/p>\n\n\n\n<p><strong>Step 1: Update Ubuntu Packages<\/strong><\/p>\n\n\n\n<p>It is a good practice for keeping your Ubuntu system up to date:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo apt update<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/mxyx5ULBK4bB4fSjU2Wl92yFrAdGVdxzbkk45qFOVkZRn4IlDy_uJm9OwsXDFZ8hGmhuTd9T5GvuQHlUKQMvbLCAMnwVRdiNmExNeaM1crKUzWliBLwtUiuEP6as9yNjYxBymlBw8oYfPzcg_vyXKg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 2: Install Apache2 via APT<\/strong><\/p>\n\n\n\n<p>For the Apache virtual host, it is necessary to install the apache2 server on your system:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo apt install apache2 -y<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/1ZkVEIs0Px7oYKIPcXVhVIrgMCQaVKBzJPrE1WuwFBeseCOEZxcBmf0z-LrYGLBkainPecS_zEHPtJPFLczeDzxeowJLA5lptbFGilIL0Ah3sjzoasK1NUOHPY5aEExOnBpStLtptqdx0h3iKrEQ1A\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/xoAXQuTPvhsY11_p0nEmbFUG9XPTYdo_JrBVsIRG2HEijHTpseOgYSmhAQGjjtvjkQ2W676OIAmVvP3fxWioP8u8QQd7KtgFvJ5rXx0cau34NpQKYgEng7ugahi8XXVJts1SOTgO5nW7wip7fsXjfQ\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 3: Check Apache2 Status<\/strong><\/p>\n\n\n\n<p>After installing, confirm the running status of the Apache2 via the command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>systemctl status apache2<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/FzTvxCve-bLV0NGHW5-rcIkwYniaKXpLELh3xWx2OgnP3Zqki-Ihf7mU9n_ddcLvWsnRza3rRaNiEwN9CRZaWGyP34R2sS9KUkr9FBgrIZhk14oGZ2WWVFWojs39nrSQNpuB2m-J8Bhefh8lyg7Kfw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 4: Test Apache2 Server<\/strong><\/p>\n\n\n\n<p>Open the web browser and visit the localhost to test whether the Apache server is working properly:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>localhost&nbsp;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/aIbTL6v9plL3VEKxu6_evcE_IJW3_HmtXqSumsmcyVAm14OgtcdBCK__OOLHEAbsP_ZQLxzllL8FBVgaGjcwDL35BGYDUePGNJForY9e0EIxQN1q7yz24r1JV0LRanWOHfJkPwDwgRMBr0zv9Jzwhw\" alt=\"\"\/><\/figure>\n\n\n\n<p>Make sure you have the above message on your screen.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Setup Virtual Host on Ubuntu 22.04?<\/strong><\/h2>\n\n\n\n<p>Here are essential commands that can be used to setup and configure the Apache virtual host on Ubuntu 22.04.<\/p>\n\n\n\n<p><strong>Step 1: Create a Directory for the Website<\/strong><\/p>\n\n\n\n<p>Using the command, create a separate directory where you can store all file related to you website:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo mkdir -p \/var\/www\/karimone.com<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/DF9VtOnY1v6K3eQJVRM9LYYV1c9SXzDcoCR-2vY-pYqIhsmqXik0_riMVV3TglK4U1ga2twekS_-sjX8sXdioymfKXHJlWmXp5hwoBBZFh5O3p_NQiHCO3d4WDAzjYm18Bc7njOTIjo89jv2aCDGJw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 2: Set Permissions for the Website<\/strong><\/p>\n\n\n\n<p>Through the below command, set the necessary permissions to the Apache user:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo chown -R $USER:$USER \/var\/www\/karimone.com<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/whcECAARfwm38SYvMDhe3eJ7eL4s_quzcYxR_8hNG32XXz0vY7ePzvNcd6D-ZdHrWlZq8OY_Upt-5uG3qJVtHkw2vFZZVlbqJq3VObfhDq1CYocInZjpJIe6EDGauvbf14zrCv9jia_f5wM4fw4SIQ\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 3: Create and Access \u201cindex.html\u201d<\/strong><\/p>\n\n\n\n<p>To display the content of your website, create and open the html file, for instance \u201cindex.html&#8221;:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo nano index.html<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/qNnlF8oOypovti1SXl-NMHphEzTXwUa4zVOOATKb7TLqs-A94P4LdQGg5ZTh4egk2kSefTQN_9agNIRjxFSnohqpM_D5LFaaw6SJcZ172uZkFC6_cuK5vrJleJHf1GvkPEBBvj3Q2etonEvTHWfCOw\" alt=\"\"\/><\/figure>\n\n\n\n<p>Inside index.html, you can add your HTML content for your website. For example:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=\"en\"&gt;<br>&lt;head&gt;<br>&lt;meta charset=\"UTF-8\"&gt;<br>&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;<br>&lt;title&gt;Welcome to karimone.com&lt;\/title&gt;<br>&lt;\/head&gt;<br>&lt;body&gt;<br>&lt;div class=\"container\"&gt;<br>&nbsp; &nbsp; &lt;h1&gt;Welcome to karimone.com&lt;\/h1&gt;<br>&nbsp; &nbsp; &lt;p&gt;This is a sample webpage hosted on karimone.com.&lt;\/p&gt;<br>&nbsp; &nbsp; &lt;p&gt;Feel free to replace this content with your own!&lt;\/p&gt;<br>&lt;\/div&gt;<br>&lt;\/body&gt;<br>&lt;\/html&gt;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/Rs5omGxgs5XLW7L1zgZylzalm4W37lOfpGyBHuTLfhbhRWe4-ZMwDvK0uc7SgnLE-hsNxoHFmQ4BwN5aju5SZn-bJx2dwsoWDDc3aux6tVELLZzkFMowK354YQaVIm1P1zgx5FSwngIkWA0h6pfAnQ\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 4: Create Virtual Host Configuration&nbsp;<\/strong><\/p>\n\n\n\n<p>Next, create a new configuration file for your virtual host (i.e. karim.com.comf) using a text editor such as Nano:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo nano \/etc\/apache2\/sites-available\/karimone.com.conf<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/ZTgCU4c2jtd2Jb4UrFztH8PjN_8ZSnpl4Z8NUkOHo5sUpNi0WIGggZBVa08D0p-RGBW0iSsZsSMTRHaAq3uD_hg2TKTh10cUep752E4JlZei_uvErRuZ40FjzcIvI6yC35PrUGoDHxVAF6muQtff-g\" alt=\"\"\/><\/figure>\n\n\n\n<p>Add and modify the configuration file as per your virtual host:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>&lt;VirtualHost *:80&gt;<br>ServerAdmin admin@localhost<br>ServerName karimone.com<br>ServerAlias www.karimone.com<br>DocumentRoot \/var\/www\/karimone.com<br>ErrorLog ${APACHE_LOG_DIR}\/error.log<br>CustomLog ${APACHE_LOG_DIR}\/access.log combined<br>&lt;\/VirtualHost&gt;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/tCB98Putq6fjwsRa8Qj3fAl3tPrcOpHRbIoqHX_KBXgvtA22ElKnA9M6DgXlWHiCZneEzPpNkoZ8vjd-ql7hWXeVEIdo9GLtbSAVuPM4Is_WmK-Xa9nDKbPGRCQ1qYHwbwcLPZaHpxoSoIoQzq7KMA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step<\/strong> 5: Enable Virtual Host<\/p>\n\n\n\n<p>Execute the <strong>a2ensite<\/strong> followed by your host configuration file name to enable Virtual Host:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo a2ensite karimone.com.conf<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/rODGrhjtFEU9G3bdd8RHbdIlJGU8FMdAPWE-HSg0P_3f14-_nDHxpCDW8_0z3mVmM13F88lPvTTiP51RFYNKV_jmBgfv8_thK5eH7Wsb-ZJsMmI7mrTBOPgJuuUr2NuFNFAjYKA7NsLW_AbGzNpOjw\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 6: Disable the Default Sites<\/strong><\/p>\n\n\n\n<p>To prevent interference with your virtual hosts, disable the Default configuration sites:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo a2dissite 000-default.conf<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/zDQCR858_DviFlZW-UcBkkVvfaTPtwCbRAa2osJ92wwMzXsLoaWqNetOaUgNIQVaywanX_9nRguo2nw2TZiZwjYr-0WwAUlRlByywFZjUKZZxgZveJuOskI_qiv1yCAY-aQQRuGqIsoFql7fNwP1NA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 7: Configure ServerName<\/strong><\/p>\n\n\n\n<p>Open the Apache global configuration file using the command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo nano \/etc\/apache2\/conf-available\/servername.conf<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/IYXPevgbw5bwEcAYonOqQqU0cfLwpJl99xmsyTHxtERwIg2vfPHmEZ3zItERaFfMfWZ2cV3lSJiVggFQH7xx1n5X-BNDPakCqho6Q8NhugTcIaUNtfzAOn3i-em1O7ASO76Prm0v26Fkye1ZhQhSJg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Here, add the ServerName to specify your server&#8217;s domain name. For example:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>ServerName karimone.com<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/ek50OINPl1AB0uAHeHrGp2es5EHQKVVqtA1rmoUlUhx9O80mORSV8Dk7d43ZYH2jd6cv1UiEbyEbgxhIPqdk7gv5YV3dlH0X8ZzeJ8sN_JZGFxkQ19RQh6IYrqayvakmf_aI_uoLPJ0v6vVXHc5FVg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Save the file using Ctrl + S.<\/p>\n\n\n\n<p><strong>Step 8: Enable ServerName Configuration&nbsp;<\/strong><\/p>\n\n\n\n<p>Run the command to enable ServerName configuration file:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo a2enconf servername<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/xhF3wjnt24Z9CcVLfkBaw5IcbLGEOuCeTPP_oQNAGmw-yj2v9uyFcHonR40PoryP59ZIbFxMp19dZYXdu58H_Hfpyw2mP0wW1ru3xrj218ilZ1-nm2BD7gRlRlwxIWSlF0TMWmJSCYZVGEkDQsJU1Q\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 9: Restart Apache2 Server<\/strong><\/p>\n\n\n\n<p>After necessary modification in the global configuration file, simply run the command to restart the Apache2 server:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo systemctl restart apache2<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/7lxQ46MGBbQG_Scha5sRA9_X5XY-Y0PMZAqW9W5LD9Ldhb90D1Ojohpgegg3VrlhwENOu1Rbz7iYKb1_GSygR8-fJQdKEs_JGv_SzexpksBGSmTjqadk0Nqjiv_okT3JNzilDk3qv87VT-dFXezMFA\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Step 10: Test Apache Configuration<\/strong><\/p>\n\n\n\n<p>Utilize the below-mentioned command for testing the Apache configuration:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>sudo apache2ctl configtest<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/MlscU8C6jri9pwmrnbECkKpSoyi5MOtJImeWUx4lTF-Ywq9Ktbl5eqYZSi3YH3qlKe3jBNJeVZAjzO4E0qitZq64dNqMOc7RqYXhMNI6jfc1fGcWIR4xaPPOO8o0BlC0OiT7fwrK75I6FAHVuclKSA\" alt=\"\"\/><\/figure>\n\n\n\n<p>In the output, you see the \u201cSyntax OK&#8221;, it indicates that you have successfully configured the Apache Virtual Host on your Ubuntu 22.04 system.&nbsp;<\/p>\n\n\n\n<p>To see the website content, open the web browser and enter \u201clocalhost&#8221; in the address bar. For instance:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre>localhost&nbsp;<\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/5-Qi10O8dsXoGeV7KIU-7THDIOnxxlyGYe8R5kO36cEju6N_pI6jsIU4UxYmetTosxmvaX49IG8t-r6y_oT3-2BuK6BNWjzT2gfuv5-xvKf3r7ePvgdHSsbETLLbLtFL9qClofOOiViKAtQrdYs-pw\" alt=\"\"\/><\/figure>\n\n\n\n<p>Here, you go! The content of your website is displayed on your screen after successfully configuring the Apache Virtual Host on your Ubuntu 22.04.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>On Ubuntu 22.04, you can set up the Apache Virtual Host through simple commands. First, ensure you have already installed Apache2 on your system, if not, use the command \u201csudo apt install apache2 -y&#8221;. Create a virtual host configuration file and modify it according to your requirements. Finally, enable the configuration file and test to confirm the running status of your Apache virtual host on your Ubuntu system.<\/p>\n\n\n\n<p>This article explores the process of setting up Apache virtual hosts on Ubuntu 22.04 system.&nbsp;<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Apache Virtual Hosts enable you to host multiple websites on a single server. This procedure can improve the server performance and prevent conflicts between websites.&nbsp; Furthermore, you can add or remove websites without affecting others.&nbsp; The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":11020,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[233,281,224,280],"class_list":["post-11013","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-apache","tag-apache-virtual-hosts","tag-ubuntu-22-04","tag-web-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-25T08:40:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-30T11:15:53+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Setup Apache Virtual Hosts on Ubuntu 22.04\",\"datePublished\":\"2024-02-25T08:40:18+00:00\",\"dateModified\":\"2024-03-30T11:15:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\"},\"wordCount\":583,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg\",\"keywords\":[\"Apache\",\"Apache Virtual Hosts\",\"Ubuntu 22.04\",\"Web Server\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\",\"name\":\"How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg\",\"datePublished\":\"2024-02-25T08:40:18+00:00\",\"dateModified\":\"2024-03-30T11:15:53+00:00\",\"description\":\"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to Setup Apache Virtual Hosts on Ubuntu 22\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Setup Apache Virtual Hosts on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community","description":"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0","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:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community","og_description":"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0","og_url":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/","og_site_name":"Greenwebpage Community","article_published_time":"2024-02-25T08:40:18+00:00","article_modified_time":"2024-03-30T11:15:53+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Setup Apache Virtual Hosts on Ubuntu 22.04","datePublished":"2024-02-25T08:40:18+00:00","dateModified":"2024-03-30T11:15:53+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/"},"wordCount":583,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg","keywords":["Apache","Apache Virtual Hosts","Ubuntu 22.04","Web Server"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/","url":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/","name":"How to Setup Apache Virtual Hosts on Ubuntu 22.04 - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg","datePublished":"2024-02-25T08:40:18+00:00","dateModified":"2024-03-30T11:15:53+00:00","description":"The primary purpose of this learning-based article is to illustrate how to set up Apache virtual hosts on Ubuntu 22.04 system.\u00a0","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2024\/02\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-22.jpg","width":1020,"height":600,"caption":"How to Setup Apache Virtual Hosts on Ubuntu 22"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-setup-apache-virtual-hosts-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Setup Apache Virtual Hosts on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11013","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=11013"}],"version-history":[{"count":3,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11013\/revisions"}],"predecessor-version":[{"id":11228,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/11013\/revisions\/11228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/11020"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=11013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=11013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=11013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}