user3556889
user3556889

Reputation: 11

Apache web server

I have an application running on an apache webserver.

I have a number of domains pointing to this application (PHP) on the web sever so there is a single IP hosting these domains.

I need to create a copy of this application on the apache web server to use as a test site and I have a domain that I am not using (which is not already pointing to this app).

What I need to know is how to go about doing this as I want the test-site to work in isolation.

The site is called e.g:

 www.testxxx.com (site6)

It is on the apache server and I have placed a copy of the application (project folders in there) and I have created a separate database and updated the config files so they point to the test database.

I am unsure of what to do next so that I can access the site without it interfering with the main app.

Do I need to create a virtual host in httpd.conf? Can you please help me with the next steps.

Thanks

Upvotes: 0

Views: 145

Answers (1)

verheesj
verheesj

Reputation: 1458

To have this setup, you need to setup virtual hosts for each of the websites.

Within httpd.conf, do a search for NameVirtualHost. Directly under this, paste the following and amend the Directives:

<VirtualHost YOUR_SHARED_IP_ADDRESS:80>
DocumentRoot /path/to/your/live/site/public_html
ServerName example.com
ServerAlias www.example.com
</VirtualHost>

<VirtualHost YOUR_SHARED_IP_ADDRESS:80>
DocumentRoot /path/to/your/test/site/public_html
ServerName testxxx.com
ServerAlias www.testxxx.com
</VirtualHost>

Once you have done the above, Restart Apache

Upvotes: 2

Related Questions