LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting up websites on a dedicated hosting plan (https://www.linuxquestions.org/questions/linux-newbie-8/setting-up-websites-on-a-dedicated-hosting-plan-4175563327/)

AdultFoundry 01-07-2016 12:50 PM

Setting up websites on a dedicated hosting plan
 
I want to do the following thing:

1) Transfer domain1.com to this new hosting (it is a php script + database)

2) Install another script + database on sub.domain1.com

3) In the future, add more websites also based on a script + database model, like Wordpress or vBulletin:

domain2.com
domain3.com
domain4.com

This will be based on name based virtual hosting, and I am not sure how would I start this part. Create two separate Virtual hosts for domain1.com and sub.domain1.com? Is this how it works?

I know that this is kind of basic, and it should be obvious, but I am not sure.

This would be in folders like:

/home/www/html/domain1.com
/home/www/html/domain2.com
/home/www/html/domain3.com and so on.

I want to log to just one log and include the Virtual Host name in there, do some log rotation and other things like this...

AdultFoundry 01-07-2016 12:55 PM

Would I start this (the two first scripts) with something like this?

Code:

# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
    DocumentRoot "/home/www/html/domain1.com"
    ServerName domain1.com
 
    # Other directives here
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/home/www/html/sub.domain1.com"
    ServerName sub.domain1.com

    # Other directives here
</VirtualHost>

I already have two separate databases. Then, install two scripts in two separate folders, and get it to work like this?

After some time I want to change script A (current domain1.com) to sub.domain1.com and script B (current sub.domain1.com) to domain1.com (switch things around).

Again, this should be kind of obvious, but I dont work on it everyday, and I am not sure (just setting up websites from time to time, and working on them).


All times are GMT -5. The time now is 06:08 AM.