Issue: I cannot make the webserver host multiple websites.

Solutions I have tried:
I made two different Vhost.conf for the different websites(named differently according the website name but with the .conf extension. I then targeted different document roots linked to the websites within these config files. – Failed, displayed “connection refused”

I then went to the second website directory I created and change the file permissions to 755 (and 777 just incase) to check if that was conflicting and creating the issue, this also failed and made the same error.
Also all files have “chown -R root:root dir/ “ on.

I then went on to open port 8080 in iptables and changed the targeted port in the vhost of the second website to 8080, this also failed with the same error.
I tried finding the second website using “ip:8080, ip/secondwebsitedirectory, ip:80/secondwebsitedirectory” none of these worked. I followed each step of multiple tutorials online and none of these worked.

When I tested just making a directory and displaying the in index.php within the directory, then targeting that with the document root of the first virtual host block, this worked but did not display the second block’s website (I used the domain to link the alias to this and forwarded the domain to the servers ip).

My current vhost.conf file looks like this **NOTE: I removed ip’s and domains on clients request. They do work and have been tested so that isn’t an issue. Anything with “testsite” was originally the clients domain. **
I have made it two separate VirtualHost blocks previously and had the same result as I am having currently, I have had on both blocks too.

<VirtualHost *>
        ServerAdmin webmaster@testsite.org
        ServerName ea
        ServerAlias *server ip was here*
        DocumentRoot /var/www/html/ea
        ErrorLog /var/www/html/ea/logs/error.log
        CustomLog /var/www/html/ea/logs/access.log combined


        ServerAdmin webmaster@testsite.org
        ServerName testsite
        ServerAlias www.testsite.co.uk 
        DocumentRoot /var/www/html/testsite/public_html
        ErrorLog /var/www/html/testsite/logs/error.log
        CustomLog /var/www/html/testsite/logs/access.log combined
</VirtualHost>

The end result I want to come to is to be able to host multiple sites on my cloud server, these website are using WordPress as that is the development platform I have been instructed to use and the server is running Centos 6.8 with all php and apache2 installed and working on one website.
As to a conclusion to this, I am stumped and need your help.

Read more here: I cannot get Vhost to host multiple wordpress websites on centos 6.8


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: