Jump to content

Recommended Posts

Hey guys,

I'm developing an online ordering system portal with multiple accounts. Each account will access the one system so if I make any updates on the system, all accounts will receive the updates.I'm thinking to have each account as a sub domain.

eg.

shop1.example.com

shop2.example.com

 

Each account will be accessed by external websites. I'm not sure if this is possible or how to go about this.

How do I make it so when they go to shop1.example.com it will display there website. So if there website was shop1.com and they go the ordering section, how would i make it so shop1.example.com will be aliased as shop1.com. This is so when people go on there website it seems like the ordering system is on their website account not on another website.

 

I hope this makes sense. Any advice would be much appreciated.

 

Thanks

 

Daniel

Link to comment
https://forums.phpfreaks.com/topic/194565-domain-name-aliasing/
Share on other sites

You would be much better off actually using separate virtual hosts for each site. You can simply share your application through soft links and correct usage of your include path if the application is designed well.

 

Running multiple sites through one virtual host will not scale too well.

hi thorpe,

thanks for your prompt reply.

I'm going to use a VPS to host the application.

I'm not sure exactly what you mean or how to access the application from other accounts on the vps.

 

However there are going to websites that don't sit on this vps. Is this not possible for these domains?

 

Daniel

Your application should be designed in such a way that it sits in a common area. You then setup a virtualhost within Apache for site.

 

I have done this myself with a CMS that is currently hosting over 900 sites. Maintaining them all within one Apache virtualhost became a nightmare at around 200 sites and they where all split off. This should (in hind site) have been done in the first place (I didn't build the application, just maintain the server configs) and that is what I would advise you to do.

Thats what I was planning to do. I was hoping to have the application in a central point which each account will access the application. However each account to appear as if they are on there own server rather than appearing on the central point in which they access the application from. Im still a little confused how to go about this.

 

 

Its not too difficult. At its simplest you would simply setup a new virtualhost for each site. eg;

 

<VirtualHost *:80>
    ServerName serverA.com
    DocumentRoot /var/www/sites/serverA/htdocs
</VirtualHost>

<VirtualHost *:80>
    ServerName serverB.com
    DocumentRoot /var/www/sites/serverB/htdocs
</VirtualHost>

<VirtualHost *:80>
    ServerName serverC.com
    DocumentRoot /var/www/sites/serverC/htdocs
</VirtualHost>

 

Of course there are more options available within a virtual host, but you get the idea.

thanks for your help thorpe. I will give it a go and get back to you. I have no experience in web services so its all new to me. I am a web developer and have been programing in PHP for many years. I did a little bit of research and i am assuming these lines go in the file httpd.conf. Now I'm using a hosting company to host my sites, so i will need to get in contact with them to get me access to this file.

 

Thanks

Daniel

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.