At OSDN, we are looking for Mirror Providers who will host a mirror site for our file release system, at all times. If you are interested in helping us, please read the following information on OSDN's public mirror website. Please contact us when you create one.
First of all, you will need a mirror name on OSDN. Create one using Alphabet letters/numbers up to 10 figures. This will be used as host name and the mirror name within OSDN system. (We may ask you to change should there be any problem.)
In the following text, we will adopt mirror name “example” to explain. Also, directory for mirror will be called /path/to/mirror-dir .
Complete the configuration for http server as instructed below.
Here's a configuration example of apache2. When using other type of http server, configure to behave in the same way.
<VirtualHost *:80>
ServerName example.dl.osdn.net
ServerAlias example.dl.osdn.jp
DocumentRoot /path/to/mirror-dir
# Redirect missing file to master
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/[-a-z0-9]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://osdn.dl.osdn.net$1 [L,R=302]
# for server not to return Content-Encoding: x-gzip
AddType application/x-gzip .gz
# extra mime-types
AddType application/x-xpinstall .xpi
AddType application/x-apple-diskimage .dmg
</VirtualHost>
<Directory /path/to/mirror-dir>
AllowOverride None
<IfVersion < 2.3>
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
If you using nginx, please refer example below;
server {
server_name example.dl.osdn.net example.dl.osdn.jp;
root /path/to/mirror-dir;
location / {
try_files $uri @osdn_fallback;
}
location @osdn_fallback {
rewrite ^ http://osdn.dl.osdn.net$request_uri? redirect;
}
}
Please contact OSDN system admin (admin -at- osdn.net) to inform the following information.
If you don't have a problem that we use all the above information, we will contact you after we complete the DNS and rsync configuration.
Once you receive a message from us that the configuration has been completed, you can start mirroring via rsync. On mirror website, please be advised to execute rsync in the way shown below. (* Those of you who have already used rsync before must be familiar with it already, but let us remind you that the / at the end of a path has it own function, so please heed the instruction precisely.)
rsync -rplHtqSz --del rsync://master.dl.osdn.jp/download/ /path/to/mirror-dir/
After mirroring is done for the very first time, make sure to configure so that the above rsync gets executed once every hour using cron or something. By the way, mirroring website that doesn't get updated for over 12 hours will be automatically removed from the download's sorting destinations.
When you complete the configuration for mirroring via rsync, please let us know. After we confirm the condition, we will begin directing to the mirror server.