{"id":2705,"date":"2012-04-06T22:28:38","date_gmt":"2012-04-06T14:28:38","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2705"},"modified":"2023-04-28T09:49:37","modified_gmt":"2023-04-28T09:49:37","slug":"how-to-configure-and-create-apache-httpd-virtualhost-on-fedora-16","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-and-create-apache-httpd-virtualhost-on-fedora-16\/","title":{"rendered":"How to Configure and Create Apache httpd VirtualHost on Fedora 16"},"content":{"rendered":"<p>In this post, i will show on how to configure apache httpd and create VirtualHost on linux Fedora 16 server. Assumed that you already install apache httpd server.<\/p>\n<p>1. Modify httpd.conf as below :<\/p>\n<pre>\n[root@fedora16 ~]# vim \/etc\/httpd\/conf\/httpd.conf\n<\/pre>\n<p>Update Admin&#8217;s address :<\/p>\n<pre>\nServerAdmin root@fedora16.ehowstuff.local\n<\/pre>\n<p>Uncomment the serverName as below :<\/p>\n<pre>\nServerName fedora16.ehowstuff.local:80\n<\/pre>\n<p>Add file name that can be access, example : index.php :<\/p>\n<pre>\nDirectoryIndex index.html index.html.var index.php\n<\/pre>\n<p>2. Uncomment NameVirtualHost :<\/p>\n<pre>\n# Use name-based virtual hosting.\n#\nNameVirtualHost *:80\n#\n<\/pre>\n<p>3. Create Virtual host :<\/p>\n<pre>\n&lt;VirtualHost *:80&gt;\n    ServerAdmin admin@fedora16.ehowstuff.local\n    DocumentRoot \/var\/www\/html\/fedora16.ehowstuff.local\n    ServerName fedora16.ehowstuff.local\n    ErrorLog logs\/fedora16.ehowstuff.local-error_log\n    CustomLog logs\/fedora16.ehowstuff.local-access_log common\n&lt;\/VirtualHost&gt;\n<\/pre>\n<p>4. Create sample index.html file on DocumentRoot of your virtualHost :<\/p>\n<pre>\n[root@fedora16 ~]# vi \/var\/www\/html\/fedora16.ehowstuff.local\/index.html\n<\/pre>\n<pre>\n&lt;html&gt;\n&lt;body&gt;\n&lt;div style=&quot;width: 100%; font-size: 40px; font-weight: bold; text-align: center;&quot;&gt;\nTest Page for Fedora.ehowstuff.local\n&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<p>5. Start httpd service :<\/p>\n<pre>\n[root@fedora16 ~]# systemctl restart httpd.service\n<\/pre>\n<p>6. Enable port 80 to go through linux iptables firewall :<\/p>\n<pre>\n[root@fedora16 ~]# vi \/etc\/sysconfig\/iptables\n<\/pre>\n<p>Add this line :<\/p>\n<pre>\n-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT\n<\/pre>\n<p>7. Restart iptables to take effect :<\/p>\n<pre>\n[root@fedora16 ~]# systemctl restart iptables.service\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this post, i will show on how to configure apache httpd and create VirtualHost on linux Fedora 16 server. Assumed that you already install apache httpd server. 1. Modify&#8230;<\/p>\n","protected":false},"author":6,"featured_media":2351,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1103,2057],"tags":[1199,1371,1536,1744],"class_list":["post-2705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-fedora","tag-apache","tag-fedora-16","tag-linux","tag-security"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2705"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2705\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/2351"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}