Hosting multiple sites on single ip with same code apache - php

Actually i have one idea regarding web hosting. The thing is i have two different games sites which are hosted on single IP but different codes. The codes are also same. Means i have created 2 databases and 2 FTP's for different websites. The directory structure and the content for both the sites are same.
Here i have one doubt that can i use the same FTP for hosting many websites. Like if i add any content then the added content should be reflected in all the sites. Is it possible through Apache hosted website. Because for every site if i upload the content the usage of disk space takes more for all the websites. Can anyone suggest me?

Please read this blogpost about domain redirection:
http://www.site5.com/blog/apache/htaccess/redirect-to-blog/20090427/
You can create 2 subfolders on your hosting and let .htaccess redirect to the correct folder.

Related

Including a PHP file from a different website on the same managed hosting computer?

So the old shared web hosting company I used to use allowed me to include a PHP file from one website in my collection in the file of another.
For example:
/home/mywebsite/public_html/functions/functions_xml.php
… could be included in in:
/home/myotherwebsite/public_html/index.php
Now that I am with GoDaddy managed hosting, this doesn't seem to be possible. I've been unable to reach support with Covid19 going on so I'm wondering if there's a PHP setting I can set that will allow files from the same computer but different websites? This worked for shared hosting but apparently not managed. I could use allow_url_include but that just sounds like a bad idea.
Is there something I'm missing?
GoDaddy Managed Hosting had to turn off some protection flag that kept different websites on the same computer from affecting one another.

transfer magento website from one domain to another

I have been trying to transfer my magento website to another domain of mine on the same hosting server.
I have searched over the Internet for this but unfortunately didn't find answer about the transfer within same hosting server. However there are a lot of solutions if someone transfer from one server to another.
I have 2 domains on a hosting server. One is mydomain.ca and other is mydomain.com, currently mydomain.ca is running and the folder of mydomain.com is empty.
What I wanna do is to run mydomain.com with the same website which is running on mydomain.ca
If anyone can help that would be greatly appreciated.
If your server has any hosting panel, then there must be an option to copy content from one place to another. You can easily copy content from current virtual host directory (say mydomain.ca) to virtual host directory of (say mydomain.com).
Then login to DB administration tool (say phpMyAdmin), select database of current website, click on operations, then click on copy database.
Then provide name of database where you want to copy existing database.
Now you have to do only 2 changes:
In core_config_data table of copied database, change unsecure base url and secure base url.
In app >> etc >> local.xml of new virtual host folder, change database connectivity details (i.e. host, username, password and database name).
Now delete var/cache, var/session folders from new virtual host directory.
That's all.
If you are planning to have them both running the same website then I think there's a simpler approach.
if your website is currently running as mydomain.ca, then all you need to do is "park" your other domain on this same account. Cpanel etc will usually allow you to do this no problem.
This will basically setup mydomain.ca as a pointer to mydomain.ca. they will both point to the same directory/document root, so you'll only have one set of files and no extra directories to worry about.
some info on doing this via some shared hosting platforms:
https://documentation.cpanel.net/display/ALD/Parked+Domains
http://support.hostgator.com/articles/cpanel/what-is-a-parked-domain-how-do-i-create-and-delete-one
Once the second domain is "parked" they will both point to the same website. If you then wanted to have them use different store fronts, themes etc, you could manage this inside magento without the need to change anything else on the hosting side of things.

How to make same Website as multiple subdomain

I need a big big help from you guys.
I have a website, say for an example www.abc.com. My Client need to change this entire website for three subdomains to address three countries.all three should be identical copies.
Example:
http://us.abc.com
http://in.abc.com
All the three subdomains should work like the main website.
I thought to copy all my site folders to copy into three folders as US, IN, FR and uploading it into the host and direct those folders to subdomains. Since this will create large number of files and folders I'll hesitate to do this.
Is this method is good or how should I overcome the situation... Glad if you can give me a clue. Thanks.
I'm not entirely sure what your question is:
It sounds like you want to use Apache virtual hosts (so the different domain names will be handled by the same server):
http://www.thegeekstuff.com/2011/07/apache-virtual-host/
Of course, you need to have DNS for the three domains point to your web server
You can use Apache configuration to allow the content to be shared or distinguished between the different domains as you wish.
'Hope that helps...
PS:
To answer your original question:
If "http://us.abc.com" and "http://in.abc.com" were different domains with identical content, you wouldn't even need virtual hosts: you could have "abc.com" serve both. But virtual hosts would still be cleaner - in case you wanted to customize one site or the other in the future.
If, on the other hand, you had "http://mysite.abc.com" and "http://mysite.abc.com.in", then you could still serve both sites from the same server. But you must use virtual hosts (because "abc.com" and "abc.com.in" are different domains).
Again - I hope that helps.

Best practices for hosting marketing/landing pages

I am working on a web application (LAMP stack) that has the code/dependencies for the marketing/landing pages tied in with the application code. The app is hosted on the rackspace cloud.
I've been thinking about whether or not these two sites should be left together, separated on the same server, or hosted on entirely separate servers.
What is common when it comes to hosting marketing/landing pages for web apps? If I need to host the sites on separate ip's or separate servers, what steps will I need to take to have two separate ip's referring to the same base URL. Is it going to be a problem to have a https connection from two seperate ips? If it is, I can likely have all the secure pages on one IP. What would be the correct term used to describe two ips pointing to one base url?
The structure would be:
example.com/landing-page (hosted on x.x.x.1)
example.com/module/app-page (hosted on x.x.x.2)
Any articles or blog posts that discuss this topic?
THANKS!
So, you want the 2 web apps to have access to the same underlying PHP files, like functions, classes, etc? Yeah, that's possible, but not sure if the Rackspace cloud allows this. A dedicated server that you can set 2 IP addresses to with separate virtual hosts will allow this with simple symbolic links and as long as the files are executable by the web user (usually apache)
Hope that answers your question. If you give more details, I may be able to answer your question more accurately.

Seamlessly direct multiple domains to a single set of PHP files?

I need to direct multiple domains to a single set of (PHP) files. So I point a domain at my server, which then goes to a single index.php file. This index.php file then detects the domain accessing it and returns the appropriate content. I do not want to add domains or set-up sites manually though as this is for a content management service. So it should be a case of a user signing up and it immediately works without me having to manually do anything. The file set must also exist only once, so updates can easily be applied to everyone.
I am currently on shared hosting, but I believe I may need to move to a VPS (running Apache) to achieve this.
How do I go about doing this?
Thanks
Unless I'm missing something about what you're trying to do, a simple CNAME DNS record may work. Just CNAME the new domain to your existing 'main' domain.
However, if you need to know what domain was requested using shared hosting this very well may not work. The catch is you would also have to setup the hosting account to accept requests from the new domain. This seems to be what you're trying to avoid.
If this is the case, you'll need a static IP, and Apache setup to accept wildcard domains and pass them to your application (index.php in this case). You may not need a VPS for this, just a relatively configurable shared hosting account.
Update: To get this working on shared hosting, check out the Apache VirtualHost directive. That's what Apache uses to setup a (wait for it) 'virtual' web server (document root, logs, etc) allowing a single server to host multiple sites. Also checkout Named Based Virtual Hosting, you'll need an account that doesn't do virtual hosting that way.
"So it should be a case of a user signing up and it immediately works without me having to manually do anything"... So you want magic. Anyways domains point to a directory so that is easy just point all domains to the same directory. PHP can examine the full URL so you can use that to select the content.
If you are using something like Joomla you might be able to customize the starting extension. For example all joomla content is stored in tables named jos_XXX.
It should theoretically be modifyable to the base table is domain_com_XXX
Maybe, but you really need to find a good programmer for this, I don't know of any systems that will do this out of the box. Maybe someone else might know of one.

Categories