How to set up subdomains on Ubuntu Server
Here's my dillema. I have set up a dedicated server running Ubuntu Server Edition. I have apache2 installed and running great. I wish to let friends and family host their individiual websites on it, but I'm running into a bit of a dillema. It seems that my server automatically redirects them to my home page and not theirs.
This is how I am set up: All apache files stored in /var/www My main page is /var/www/index.html the website is www.tweakercat.tk redirects to /var/www/index.html However, for example: friends site is stored in folder /var/www/php he has file /var/www/php/index.html When i go to www.tweakercat.tk/php/index.html It redirects to my page (/var/www/index.html) Same thing happens if i type www.tweakercat.tk/request.html (/var/www/request.html) it automatically sends the browser to www.tweakercat.tk/index.html (/var/www/index.html) What have I set up wrong? Thanks in advance! |
UPDATE:
Just ran a test, skipping my domain name. 75.87.80.77/php works www.tweakercat.tk/php does not apparently www.tk doesnt allow domain extensions or something? |
You will need to configure apache to serve a virtual domain for tweakercat.tk
Currently apache only knows about the default domain, you will need to create a config file in /etc/apache2/sites-available and symlink it to /etc/apache2/sites-enabled The file will need the following contents (at least)... Code:
<VirtualHost tweakercat.tk> I generally create a directory structure something like... Code:
|
Hello and thanks for the reply!
Yes, I understand about not putting it in php. That was simply a test folder in which i created to solve this problem. Now heres the question that remains. How much of that do i need to repeat in the original config file to set up another one on top of that? And what whould I seperate the 2 with in the file? Thanks! |
I'm not sure if I understand the question correctly, but if you are asking how to create multiple virtual servers, you will need to create a config file as above for each site in the /etc/apache2/sites-available directory and then symlink it to /etc/apache2/sites-enabled, ensuring that the config files contain the correct directory information for the site they relate to.
I believe you can use debian provided scripts to do this also... I have no experience with them, but there is more information here. |
All times are GMT -5. The time now is 10:23 PM. |