LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to start more than 1 virtual server on any Linux distro? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-start-more-than-1-virtual-server-on-any-linux-distro-755918/)

nayaksuraj 09-17-2009 06:06 AM

How to start more than 1 virtual server on any Linux distro?
 
hi,

I am newbie in Linux world. I have fedora 9. I have installed one virtual server and have default www directory. So when I start my virtual server(/www/bin/apachectl start), it start perfectly, on the same when i am going start my default server which is located at /var/www it won't start. I have to stop my previous virtual server and then I can start my default one.

So question is 1. In one pc we only start one virtual server or we can run several virtual servers on one pc at the same time ?

Please help...

Regards,

Suraj Nayak

linuxlover.chaitanya 09-17-2009 06:19 AM

Quote:

Originally Posted by nayaksuraj (Post 3686740)
hi,

I am newbie in Linux world. I have fedora 9. I have installed one virtual server and have default www directory. So when I start my virtual server(/www/bin/apachectl start), it start perfectly, on the same when i am going start my default server which is located at /var/www it won't start. I have to stop my previous virtual server and then I can start my default one.

So question is 1. In one pc we only start one virtual server or we can run several virtual servers on one pc at the same time ?

Please help...

Regards,

Suraj Nayak

Sorry. This is not the place to ask the question. This thread was started by jeremy for specific purpose.
Start your own thread for your issue in a relevant forum.

jeremy 09-17-2009 09:32 AM

// moved.

--jeremy

Wim Sturkenboom 09-17-2009 10:48 AM

Yes, that can be done using virtual hosts. And you will only have one 'instance' of apache running.

From my apache webserver
Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# catch-all
<VirtualHost *:80>
    ServerAdmin me@mydomain
    DocumentRoot /srv/httpd/htdocs
    ServerName btd-techweb02
</VirtualHost>

# site 1
<VirtualHost *:80>
    ServerAdmin me@mydomain
    DocumentRoot /home/wim/www/site1/web
    ServerName site1.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site1/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

# site2
<VirtualHost *:80>
    ServerAdmin me@mydomain
    DocumentRoot /home/wim/www/site2/web
    ServerName site2.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site2/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Where you place this in Fedora, I don't know as I don't use Fedora. In Slackware it's in a separate file that is included in httpd.conf. You can also dump it in httpd.conf.

PS Ubuntu is definitely different


All times are GMT -5. The time now is 08:54 PM.