Multi country using...
 
Notifications
Clear all

Multi country using subdomains and dns wildcard

8 Posts
3 Users
1 Reactions
1,058 Views
(@oltom)
Posts: 4
Active Member
Topic starter
 

Hello,

This a rather complex question. I would appreciate any (ANY) help on this.

I have an Osclass installation for a year or so, with 3 countries. Normal way, just added 3 countries. No subdomains, no any particular setup.

Since it is performing rather poorly, i think i could try to setup each country as subdomain, not real ones-sites but  using a pseudo wildcard dns.

While my hosting company was able to help me on the wildcard dns, i have the following problem: in all countries-subdomains the home page listing shows ALL the ads from ALL countries.

Is that normal? Is there any special setup i have not done?

Not sure if i explained fully what my setup is and what i want to do. If needed i can provide any information requested.

Many Thanks

 
Posted : April 27, 2020 01:06
Johannes de Sacrobosco
(@johannes-de-sacrobosco)
Posts: 83
Member Moderator
 

btw: here are the instructions from the old Osclass dev wiki:

_______

 

Use categories, countries, regions or cities as subdomains

It’s not plug and play configure Osclass or any other service to work with multiple subdomains. There are three steps:

DNS Wildcard
Apache Wildcard
Osclass subdomain configuration

DNS Wildcard

First of all you need to let know to the whole internet which IP resolve any of your subdomains. So, region.example.net will resolve the same IP as region2.example.net.

In the examples I will use as your IP server 127.0.0.1 and as a domain example.net. You should replace this values for your IP and domain. Furthermore, I’m not sure if the following solutions varies depending the DNS Manager you use but here I put two examples:
Bind

*.example.net. A 127.0.0.1

Linode

As you can see the value you have to change is the A record. Finally, if you have another subdomain pointing to another IP, you should just specify it before the *.

Once you’ve done this, it could take up to 24 or 72 hours to take
Apache Wildcard

I’m not sure how it can be done in each specific hosting service, so I would explain what you have to specify in the VirtualHost configuration.

<VirtualHost *:80>
ServerName example.net
ServerAlias *.example.net

CustomLog /var/log/apache2/example.net_access_log combined
ErrorLog /var/log/apache2/example.net_error_log
<Directory /var/www/example.net/web>
Options -Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>

What we’re saying with this configuration is that all the petitions that come to any subdomain of example.net will go to the folder where Osclass is installed.
Changes in config.php

In order to accept any subdomain, Osclass’ config.php have to be modified, the line that contain the WEB_PATH have to be changed to

define('WEB_PATH', 'http://'.$_SERVER['HTTP_HOST'].'/path/to/Osclass/');

Cookies configuration

Cookies have to be set to accept all subdomains as only one website, change your php.ini file, search for the line

session.cookies_domain = 

and change it to 

session.cookies_domain = .domain.tld

Note: From Osclass 3.3 and newer versions, if you’re not able to modify your server’s configuration files, you could define COOKIE_DOMAIN in the config.php

define('COOKIE_DOMAIN', '.domain.tld');

Note: It’s important to have a “.” (dot) before the domain. Do not include “www” or anything else.

Osclass subdomain configuration

Now we have to specify which type of subdomain we want: categories, countries, regions or cities. You can change this configuration in your oc-admin > Settings > Advanced.

 
Posted : April 27, 2020 01:25
Editor reacted
Editor
(@editor)
Posts: 553
Honorable Member Admin
 

@oltom This is the way Osclass pseudo-subdomains work. All ads from every country are listed at home page(s) of each subdomain.

This an other feature that Osclass team started and NEVER finished. Their excuse was that there was no demand for it.

Go figure. So that feature was abandoned and neglected.

A developer said to me once that if ads only for each country were shown at home pages, it would put heavy load to the database. I have no idea if this is true or false.

Also don't expect anything of the above to be fixed EVER.

The best was is to created REAL subdomains, if of cource you have 2-3 countries. Otherwise it is hard and needs a lot of maintenance.

Reak subdomains means each subdomain (country in our case) has his own database and his own directory. As a normal website/domain.

 

 
Posted : April 27, 2020 13:03
(@oltom)
Posts: 4
Active Member
Topic starter
 

Thanks for the replies. So you are telling me that this is a normal behavior (in home page) and that there is no problem from my side?

Also not sure i understand what is a "separate subdomain for each country". Can you explain better?

 
Posted : April 28, 2020 01:56
Editor
(@editor)
Posts: 553
Honorable Member Admin
 

Yes it is normal behavior of Osclass. This is how is works.

As for your second question, you should install each country/subdomain as a REAL subdomain within your Cpanel and also REMOVE the wildcard dns settings from your DNS entries.

Then a complete set should be uploaded via ftp and a database/user must be created. Like you do for a new domain.

Also ask your hosting company for any more help on this.

 
Posted : April 28, 2020 19:28
(@oltom)
Posts: 4
Active Member
Topic starter
 

ok, got it.

An other question: i have a total of 3 countries so i decided to go with the real (as you say) subdomains as site. Is there a way to NOT start from empty databases and have all those ads in each country lost?

Also in reverse, if i do that and after 1 year i switch back to ONE site, will all the ads be lost or i can save them to this "one site" ?

Thanks

 
Posted : April 28, 2020 22:45
Editor
(@editor)
Posts: 553
Honorable Member Admin
 

@Oltom

What you can do is use the original database for each subdomain (the db with ALL the countries you have now).

After installed and sure it is ok, just delete the countries you do not need for each one. The ads will be gone also, the users will stay but it doesn't matter.

Now, the reverse is not possible easily, i'm afraid. When and if you decide to go back to ONE db for all counties, you will have to export and import.

It can be done, still some work may be needed.

Just keep in mind that SEO is messed up totally when you do all those changed back and forth. I mean google seo rankings.

 
Posted : April 29, 2020 12:18
Page 1 / 2