{"id":3665,"date":"2016-04-07T12:21:09","date_gmt":"2016-04-07T12:21:09","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=3665"},"modified":"2021-02-06T05:00:36","modified_gmt":"2021-02-06T05:00:36","slug":"add-new-website-apache-based-debian-server","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/","title":{"rendered":"How to add new website into your Apache-based Debian server"},"content":{"rendered":"<p>So we have already set up a working <a href=\"https:\/\/cpanelplesk.com\/wp62\/build-working-debian-server-apache-php-mysql\/\">Debian server with an Apache<\/a>, Now the question is how can we host a new website on this? Simply we can do it via Apache virtual host file where we can put necessary configuration regarding websites we want to host on our Server.<!--more--><\/p>\n<p>First of all SSH into your server via root user,I am using <a href=\"https:\/\/cpanelplesk.com\/wp62\/using-putty-connect-server-ssh-windows\/\">putty<\/a> here.<\/p>\n<p>Now we will create the directory where we can put all our files for website. That would be a main directory for your website.<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true  \">mkdir -p \/var\/www\/domain.com\/public_html<\/pre>\n<\/div>\n<p>Or you can also name it httpsdocs<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">mkdir -p \/var\/www\/domain.com\/httpsdocs\r\n\r\n<\/pre>\n<\/div>\n<p>Make sure to change domain name with your domain name. Now change the ownership of the domain with the user and group you want to:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">chown -R $USER:$USER \/var\/www\/domain.com\/public_html<\/pre>\n<\/div>\n<p>Make sure everyone can read files to the Apache web root directory so change permissions as follows:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">chmod -R 755 \/var\/www\/<\/pre>\n<\/div>\n<p>Now you can upload all your files to that directory using your favorite FTP client.<\/p>\n<p>Next it\u2019s time to create a virtual host file for that website.<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">nano \/etc\/apache2\/sites-available\/domain.com.conf<\/pre>\n<\/div>\n<p>Don\u2019t forget to always replace domain.com with your own domain name:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">VirtualHost *:80&gt;\r\n\r\n        # The ServerName directive sets the request scheme, hostname and port that\r\n\r\n        # the server uses to identify itself. This is used when creating\r\n\r\n        # redirection URLs. In the context of virtual hosts, the ServerName\r\n\r\n        # specifies what hostname must appear in the request's Host: header to\r\n\r\n        # match this virtual host. For the default virtual host (this file) this\r\n\r\n        # value is not decisive as it is used as a last resort host regardless.\r\n\r\n        # However, you must set it for any further virtual host explicitly.\r\n\r\n        #ServerName www.example.com\r\n\r\n\r\n        ServerAdmin your@email.com\r\n\r\n        ServerName domain.com\r\n\r\n        ServerAlias www.domain.com\r\n\r\n        DocumentRoot \/var\/www\/domain.com\/public_html\r\n\r\n\r\n        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,\r\n\r\n        # error, crit, alert, emerg.\r\n\r\n        # It is also possible to configure the loglevel for particular\r\n\r\n        # modules, e.g.\r\n\r\n        #LogLevel info ssl:warn\r\n\r\n\r\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n\r\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n\r\n\r\n        # For most configuration files from conf-available\/, which are\r\n\r\n        # enabled or disabled at a global level, it is possible to\r\n\r\n        # include a line for only one particular virtual host. For example the\r\n\r\n        # following line enables the CGI configuration for this host only\r\n\r\n        # after it has been globally disabled with \"a2disconf\".\r\n\r\n        #Include conf-available\/serve-cgi-bin.conf\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<\/div>\n<p>Save changes and exit the editor.<\/p>\n<p>Virtual host file has been created now we can enable it by using the below command:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">a2ensite domain.com.conf<\/pre>\n<\/div>\n<p>After that restart your Apache service:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">service apache2 restart<\/pre>\n<\/div>\n<p>Now we can test it into our favorite browser.<\/p>\n<p>That\u2019s all and now you know how it\u2019s easy to setup a new website into Apache-based Debian server.<\/p>\n<p>Give your opinion below if you experience any issues or to discuss your ideas and experiences.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So we have already set up a working Debian server with an Apache, Now the question is how can we host a new website on this? Simply we can do it via Apache virtual host file where we can put necessary configuration regarding websites we want to host on our Server. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-3665","post","type-post","status-publish","format-standard","hentry","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add new website into your Apache-based Debian server - cPanel Plesk<\/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:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to add new website into your Apache-based Debian server - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"So we have already set up a working Debian server with an Apache, Now the question is how can we host a new website on this? Simply we can do it via Apache virtual host file where we can put necessary configuration regarding websites we want to host on our Server. [...]Continue Reading...\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"How to add new website into your Apache-based Debian server\",\"datePublished\":\"2016-04-07T12:21:09+00:00\",\"dateModified\":\"2021-02-06T05:00:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\"},\"wordCount\":263,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\",\"name\":\"How to add new website into your Apache-based Debian server - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"datePublished\":\"2016-04-07T12:21:09+00:00\",\"dateModified\":\"2021-02-06T05:00:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add new website into your Apache-based Debian server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add new website into your Apache-based Debian server - cPanel Plesk","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:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/","twitter_card":"summary_large_image","twitter_title":"How to add new website into your Apache-based Debian server - cPanel Plesk","twitter_description":"So we have already set up a working Debian server with an Apache, Now the question is how can we host a new website on this? Simply we can do it via Apache virtual host file where we can put necessary configuration regarding websites we want to host on our Server. [...]Continue Reading...","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"How to add new website into your Apache-based Debian server","datePublished":"2016-04-07T12:21:09+00:00","dateModified":"2021-02-06T05:00:36+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/"},"wordCount":263,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"articleSection":["Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/","url":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/","name":"How to add new website into your Apache-based Debian server - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"datePublished":"2016-04-07T12:21:09+00:00","dateModified":"2021-02-06T05:00:36+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/add-new-website-apache-based-debian-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"How to add new website into your Apache-based Debian server"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=3665"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/3665\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=3665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=3665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=3665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}