hosting_more_than_one_website_on_the_same_apache2_server
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
hosting_more_than_one_website_on_the_same_apache2_server [2016/07/24 19:32] – walkeradmin | hosting_more_than_one_website_on_the_same_apache2_server [2016/08/08 22:32] – walkeradmin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Hosting more than one website on the same Apache2 Server ====== | + | ====== Hosting more than one website on the same Apache2 Server |
\\ | \\ | ||
\\ | \\ | ||
Line 18: | Line 18: | ||
</ | </ | ||
\\ | \\ | ||
- | We need to copy and paste this section for each site we wish to create. | + | We need to copy and paste this section for each site we wish to create.\\ |
\\ | \\ | ||
In this example we will have two websites, site one and site2, and they are located in the following place: | In this example we will have two websites, site one and site2, and they are located in the following place: | ||
\\ | \\ | ||
\\ | \\ | ||
- | / | + | / |
- | / | + | / |
\\ | \\ | ||
\\ | \\ | ||
Line 42: | Line 42: | ||
\\ | \\ | ||
Save this file and exit back to the command line. | Save this file and exit back to the command line. | ||
+ | \\ | ||
+ | \\ | ||
+ | now we need to navigate to the folder // | ||
+ | \\ | ||
+ | sudo / | ||
+ | \\ | ||
+ | Use the hash # to comment out every line | ||
+ | \\ | ||
+ | \\ | ||
+ | Now add the following: | ||
+ | \\ | ||
+ | < | ||
+ | ServerAdmin al@nwalker.co.uk | ||
+ | ServerName site1.alanwalker.eu --- (this has to match the url of your website) | ||
+ | DocumentRoot / | ||
+ | DirectoryIndex index.html --- (this is the first page of your website) | ||
+ | </ | ||
+ | < | ||
+ | ServerAdmin al@nwalker.co.uk | ||
+ | ServerName site2.alanwalker.eu --- (this has to match the url of your website) | ||
+ | DocumentRoot / | ||
+ | DirectoryIndex index.html --- (this is the first page of your website) | ||
+ | </ | ||
+ | \\ | ||
+ | Don't forget to restart the apache web server: | ||
+ | \\ | ||
+ | sudo / | ||
+ | \\ | ||
+ | \\ | ||
+ | Now if I navigate to // | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | If I navigate to // | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
\\ | \\ | ||
\\ | \\ | ||
hosting_more_than_one_website_on_the_same_apache2_server.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1