Answered

How to upload multiple websites on my vps

can i run multiple websites on single server IP address?

I am trying to host multiple websites using virtual host.

i upload my site on specific folder

set DirectryRoot too

add one entry to /etc/hosts page too

like 127.0.0.1 example.com

 

in file etc/httpd/conf.model.d/example.conf hosted two virtual site

<VirtualHost *:80>

    ServerName www.example1.co.in

    ServerAlias .co.in

    DocumentRoot /var/www/html/example1.co.in/public_html 

    ErrorLog /var/www/html/example1.co.in/error.log 

    CustomLog /var/www/html/example1.co.in/requests.log combined 

</VirtualHost>

 

<VirtualHost *:80>

    ServerName www.example2.co.in

    ServerAlias example2.co.in

    DocumentRoot /var/www/html/example2.co.in/public_html

    ErrorLog /var/www/html/example2.co.in/error.log

    CustomLog /var/www/html/example2.co.in/requests.log combined

</VirtualHost>


but only one site is running means example1.co.in

please give me a solution...


  • * Do you own the domains example1.co.in and example2.co.in?

    * Have you set up your DNS server(s) to point to your web server's IP address for both (www.)example1.co.in and (www.)example2.co.in?

    * I assume that your "virtual host" configuration is done OK on your web server's software (Apache, nginx, ...).


    1 person likes this
  • >> can i run multiple websites on single server IP address?


    Absolutely you can. Fedon is correct: both subdomains must be pointed to the server's IP, 


    It's nice to know how Apache works, but in practice, it is too much trouble. I suggest that you install a control panel. SkySilk offers three apps/control panels ready to install. However, I like http://centos-webpanel.com/  as a free panel. If you want to splurge, you could install Plesk. 


    I'm not an expert with virtualhosts, but it appears that nether ServerAlias is correct. It appears that your first vhost is matching everything. I would use something like


    ServerAlias *.example1.co.in
    ServerAlias *.example2.co.in
    
Login or Signup to post a comment