HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Subdomain not working (http://www.howtoforge.com/forums/showthread.php?t=55932)

RioSif 26th January 2012 11:34

Subdomain not working
 
Hello,
I am trying to make a subdomain to work for almost 2 days with no luck. I searched the forum and google to find a solution but i can't make it work.
My domain is riosif.gr
I made it forward www to non-www and that works.
I want a my subdomain to be kb.riosif.gr and look at the directory /kb/ where is at riosif.gr/kb/ but i want it to always stay to kb.riosif.gr and work like kb.riosif.gr/index.php, kb.riosif.gr/icons/ where icons is at /kb/icons/ etc(i hope you understand what i mean.
Could someone tell me step by step what i should do? From the very beginning please. From the dns entries until add website and add subdomain? Please...

Thank you very much

till 26th January 2012 12:08

When a subdomain shall have its own directory, then you should add it as website and not as subdomain (see instructions in the manual) as subdomains use rewrite rules so that you can not install php scripts like scm systems into the subdirectory then.

1) Delete the subdomain.
2) Add a new website and enter "kb.riosif.gr" into the domain field.

RioSif 26th January 2012 12:14

I red that too but that will create a different home directory, won't it?
Then the index.php of riosif.gr would be at web1/index.php and the index.php of the kb.riosif.gr would be at the web2/index.php, and web1 and web2 would have the same home directory, right?
Ok, i'll try that. What entries should i add at the dns section for that?

till 26th January 2012 12:21

Quote:

Then the index.php of riosif.gr would be at web1/index.php and the index.php of the kb.riosif.gr would be at the web2/index.php, and web1 and web2
Yes.

Quote:

nd web1 and web2 would have the same home directory, right?
No. They are different websites (vhosts) that run under different Linux users.

Quote:

Ok, i'll try that. What entries should i add at the dns section for that?
Add a dns A-record for "kb" in the zone "riosif.gr" that points to the IP address of your server.

RioSif 26th January 2012 12:37

I'll try that and reply, thanks for the quick replies

RioSif 27th January 2012 02:53

Ok, you are right, it works, thanks.
But i have some questions. I red on other posts your replies say that that's how apache works(i guess nginx too). But how does cpanel manage to do it without a new website? No offense, i am just curious.
Now second and more important. I don't want to have one ftp for every website. If i have 10-20 subdomains(then 10-20 websites) it's not handy to have to use 10-20 ftp accounts. I tried change the home directory of my ftp user to have /var/www/clients/client1/ as root but i can't see files of any site than the one i entered at the site field of the ftp user at the creation time, i cant just browse the directories. It would be handy a client could browse and upload files to all of his sites.
Is that at any way possible? Something like admin ftp account?

till 27th January 2012 09:25

Quote:

But how does cpanel manage to do it without a new website?
cpanel creates a new website (vhost), they just label it differently.

Quote:

Is that at any way possible?
This cant work. Please search the forum, I explained why thats the case in a lot of posts already. When one of your sites get hacked the first time, then you will see why a decent security concept and site separation is a good idea.

H2SO4 28th January 2012 03:00

Quote:

Originally Posted by till (Post 272453)
cpanel creates a new website (vhost), they just label it differently.

Why cant you guys do the same as cpanel?
I ask this because if i want to sell a hosting package with 5 domains and unlimited subdomains, i cant.
When the customer have 5 main domains already, then cant make a new site for subdomains.

domain1.tld 1/5
domain2.tld 2/5 sub.domain2.tld it is only a redirect to domain2.tld/subdir but not subdomain
domain3.tld 3/5
domain4.tld 4/5
domain5.tld 5/5
sub.domain2.tld 6/5 error, there is no more website available.

So the package failed because i can give unlimited redirect only instead subdomain.
Cant understand why dont you guys see the problem with this solution. :(

RioSif 29th January 2012 20:39

Yes please! Do something for that! Or just give the choice! I want the choice to manage my security too, with the ftps. I want the choice to have one ftp account for all subdomains or one for each!


All times are GMT +2. The time now is 01:41.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.