Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
scarecrow

A technical Apache question

Recommended Posts

I have set up a webserver on a machine with 3 static IP's, pointing to a certain domain name. The domain name is set on a virtual Apache host, while the physical host points to the base IP of the server.

It's using a rather popular CMS, which is working fine.

However, I want to test an alternative CMS on the same server. I can put that one in a folder inside the root folder, and I can assign a DNS to it (say a free one from dyndns). I also want, if possible, to use another port for that one- say 8088 instead of 80.

Question no.1: Can I create another Apache virtual host, which will use as root the subfolder with the new CMS?

Question no.2: Is it possible to run on Apache two virtual hosts, which are using a different port?

You may well assume that I'm no techie, when coming to Apache configs- hence the questions...

Thanks in advance.

 

 

[moved from Everything Linux by spinynorman]

Share this post


Link to post
Share on other sites

In answer to your first question, yes you can create a virtual host that uses the sub-folder. For example, you could have a virtual host that uses /var/www/html and you could have the second virtual host using /var/www/html/test for example. I do this already to have multiple sites on a server and I have only one public IP address - but apache knows which host to display based on the domain name accessing the server.

 

As for your second question, yes, you can also to the same with that and use a different port, but if you are using multiple IP's you wouldn't need to use another port, unless you have a particular reason for wanting to assign another port. Your config would look something like:

 

<VirtualHost *:80>
   rest of config here for virtualhost
</VirtualHost>

<VirtualHost *:8088>
   rest of config here for virtualhost
</VirtualHost>

 

of course the * could have been replaced with your particular public IP, unless of course you are using the domain name to distinguish between which virtualhost is detected by the url used.

Share this post


Link to post
Share on other sites

Ah, fine! These are good news. Thanks for the answer! :)

Actually, the server is using CentOS with DirectAdmin, so the safest way is most probably creating a "reseller" for the task. But this is rather easy to manage.

Edited by scarecrow

Share this post


Link to post
Share on other sites

I tend to have my virtual hosts set up under /var/www and then the sub-folders are the domains, for example:

 

/var/www/domain1
/var/www/domain2

 

and I then create the VirtualHost accordingly in Apache's /etc/httpd/conf/httpd.conf file (location in CentOS), and towards the bottom of the file is where you'll locate the VirtualHost section.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×