{"id":120,"date":"2010-01-29T10:26:28","date_gmt":"2010-01-29T10:26:28","guid":{"rendered":"http://blog.divydovy.com/?p=120"},"modified":"2020-01-23T10:30:15","modified_gmt":"2020-01-23T10:30:15","slug":"vps-hosting-wordpress-and-flat-websites-together-with-apache-2","status":"publish","type":"post","link":"https://www.divydovy.com/2010/01/vps-hosting-wordpress-and-flat-websites-together-with-apache-2/","title":{"rendered":"VPS: Hosting WordPress and Flat Websites Together with Apache #2"},"content":{"rendered":"<p><a title=\"First attempt\" href=\"/web/vps-hosting-wordpress-and-flat-websites-together-with-apache/\">I did say</a>&#8230;</p>\n<blockquote><p><strong>*Disclaimer: I’m not (and don’t claim to be) an expert. This could break things, upset your granny or otherwise not do what you want. I’m happy to receive corrections or improvements – or thanks if it works for you!*</strong></p></blockquote>\n<p>Turns out I was overcomplicating things a bit. I assumed that something in the .htaccess file was over-riding my VirtualHosts settings in httpd-vhosts.conf: hence the .htaccess modifications.</p>\n<p>In a classic bit of carelessness, it turns out I was editing the wrong httpd-vhosts.conf file &#8211; there are two in different folders :S</p>\n<p>So, the following steps from the first post are still valid:</p>\n<blockquote><p># Virtual hosts<br />\n#Include conf/extra/httpd-vhosts.conf</p></blockquote>\n<p>to</p>\n<blockquote><p># Virtual hosts<br />\nInclude conf/extra/httpd-vhosts.conf</p></blockquote>\n<p>Now, edit httpd-vhosts.conf to include a VirtualHost for your domain, e.g.</p>\n<blockquote><p>#<br />\n# Use name-based virtual hosting.<br />\n#</p>\n<p>NameVirtualHost *:80</p>\n<p>&lt;VirtualHost *:80&gt;<br />\nServerAdmin &lt;you@email.com&gt;<br />\nServerName theflatdomain.com<br />\nServerAlias *.theflatdomain.com theflatdomain.co.uk *.theflatdomain.co.uk<br />\nDocumentRoot “www/flatsites/thisflatsite/”<br />\n&lt;/VirtualHost&gt;</p></blockquote>\n<p>But, not instead of editing the .htaccess file, we just need to make a further entry in the httpd-vhosts.conf file, ABOVE the flat site virtual host(s):</p>\n<blockquote><p>&lt;VirtualHost _default_:80&gt;<br />\nDocumentRoot &#8220;www/wordpress/&#8221;<br />\n&lt;/VirtualHost&gt;</p></blockquote>\n<p>You can then simply add further VirtualHosts UNDER your default catch-all VirtualHost for each flat site you need to host. This will leave the WordPress installation to deal with any domain names that aren&#8217;t explicitly declared as separated flat sites. Note that I&#8217;m using <a title=\"Strider's Virtual Multiblog\" href=\"http://striderweb.com/nerdaphernalia/features/virtual-multiblog/\">Strider&#8217;s Virtual Multiblog</a> for WordPress to host lots of different blogs/domains at once.</p>\n<p>Sweet 🙂 Leave a comment if this was useful for you?</p>\n","protected":false},"excerpt":{"rendered":"<p>I did say&#8230; *Disclaimer: I’m not (and don’t claim to be) an expert. This could break things, upset your granny or otherwise not do what you want. I’m happy to receive corrections or improvements – or thanks if it works for you!* Turns out I was overcomplicating things a bit. I assumed that something in the .htaccess file was over-riding my VirtualHosts settings in httpd-vhosts.conf: hence the .htaccess modifications. In a classic bit of carelessness, it turns out I was editing the wrong httpd-vhosts.conf file &#8211; there are two in different folders :S So, the following steps from the first [&hellip;]</p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","clkt_auto_upload":"0","_clkt_publish_and_upload":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wordproof_timestamp":false},"categories":[7],"tags":[11,42,109,110,111,114,125],"my_content_publications":[],"class_list":["post-120","type-post","status-publish","format-standard","hentry","category-web","tag-apache","tag-flat-sites","tag-virtual-multiblog","tag-virtual-private-server","tag-virtualhosts","tag-vps","tag-wordpress"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"clkt_attachments":{"featured_image":null,"inline_attachments":[],"upload_candidates":[],"max_free_size":102400,"max_allowed_size":104857600},"_clkt_upload_mode":"new_only","clkt_content_hash":"4cd0a462cce06354e7cc1f70989ec9b80adf56012c7149f06214a653f7755eb1","customFields":{"clkt_auto_upload":"0","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"processed_attachments":{"total_attachments":0,"uploaded_to_arweave":0,"kept_original_urls":0,"upload_summary":{"total":0,"uploaded":0,"failed":0,"too_large":0,"reused":0}}},"paymentAddress":"8_-tV4d15kVVq9Gd-Al2MAIC3LqNtJ_KgFol71TzxPw"}