A
A
Alexander2019-04-30 08:50:26
Apache HTTP Server
Alexander, 2019-04-30 08:50:26

How do I upload files to a site hosted by a different user?

Good afternoon!
I have SSD and HDD drives installed on my server. The OS is installed on an SSD. There are 2 users ssd and hdd. The first saves all data on the SSD, the second on the HDD. There are 2 sites that run on Apache (PHP 5.6.40):
site.ru - user: ssd , group: ssd
dw.site.ru - user: hdd , group: hdd
Please tell me how to access dw files. site.ru from site.ru ?
I tried to disable and configure the paths in open_basedir, but nothing happened. Maybe set it up wrong. I tried to add the files of both sites to the same group, also there is no result. Verification was done through file_exists(path_to_dw.site.ru).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-05-01
@PR0Z0N

In short, I implemented it like this:
1. In the Apache config of the site.ru site, I added the path of the second site through open_basedir:

<IfModule php5_module>
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
  php_admin_value upload_tmp_dir "/var/www/ssd/data/mod-tmp"
  php_admin_value session.save_path "/var/www/ssd/data/mod-tmp"
  php_admin_value open_basedir "/var/www/ssd/data:/var/www/hdd/data/www/dw.site.ru"
</IfModule>

2. Set access rights 777 to all folders in the directory: "/var/www/hdd/data/www/dw.site.ru".
Everything is working! Maybe someone will come in handy)

C
CityCat4, 2019-04-30
@CityCat4

Write the Directory block in the Apache config of the first site, which will refer to the directory of the second site. Then inside the first site it will be possible to open a URL that will actually refer to the files of the second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question