nginx change basepath html folder to another disk ubuntu 18.4 - nginx-location

Hello I'm new to ubuntu 18.4
I want to change html folder from
/var/www/html
to another directory usually at ubuntu 16.4 i used to change basepath at
/etc/nginx/sites-available/default
to the location but the new location is at another partition so i used to put it like that
/mnt/7282B48E0BE626E0/www/html
but now i don't know how to change it to the same directory because of mnt folder empty and when i put
/dev/sda7/www/html
it doesn't work too any help
thank you

so the main problem was that i'm unable to put the directory with user name at nginx config so i mount partition inside mnt folder here what I did
i created folder name "7282B48E0BE626E0"
sudo mkdir /mnt/7282B48E0BE626E0
and mount it with sda7
sudo mount /dev/sda7 /mnt/7282B48E0BE626E0
its working now.

Related

Udisk - Error creating mount point no such file or directory

I'm trying to automatically mount a USB drive on linux. With all default settings it works and the drive is mounted to /run/media/username/drivename.
I tried to change the default mount point to /media/drivename by following the guide linked here: https://wiki.archlinux.org/index.php/Udisks#Mount_to_/media_(udisks2)
I added the file /etc/udev/rules.d/99-udisks2.rules with the following contents:
# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
I then rebooted my machine. Now every time I try to access the drive, I get the following error:
Unable to mount drivename
Error creating mount point '/media/drivename': No such file or directory
If I remove the file I created and reboot again, the drives are mounted to /run/media/username/drivename like normal, and I can access them fine.
I'm on Arch linux. Any help is appreciated! Thanks!
For anyone running into a similar issue, I simply created the /media folder and then rebooted and everything worked. Apparently udisks expected /media to already exist.
Put 99-udisks2.rules in /etc/udev/rules.d/
run mkdir /media (as sudo)
run reboot
Profit!

How do I change file permissions on ElasticBeanstalk before docker image gets built?

I am deploying a Docker image (Wordpress) on Elastic Beanstalk using a single container deployment.
My deployment zip file includes:
public folder containing a complete wordpress build
Dockerfile
.ebextensions/permissions.config
The standard Wordpress image creates a volume VOLUME /var/www/html and in my Dockerfile I do
COPY ./public /var/www/html
Now the problem is that I cannot upload media using Wordpress admin dashboard.
Unable to create directory wp-content/uploads/2019/02. Is its parent directory writable by the server?
I've tried to change the permissions on the uploads folder using the EB config in .ebextensions/permissions.config
container_commands:
91writable_dirs:
command: |
chmod -R 777 /var/app/current/public/wp-content/uploads
cwd: "/var/app/current"
I see from the logs that the docker image gets built before running chmod. I've seen on other SO posts that some run the script on /var/app/ondeck/, but that fails with the directory doesn't exist
Despite all the above, my question is actually how do I get to upload media to Wordpress with my current setup.
EDIT: When I attach a shell to the docker container and change the file permissions of wp-content/uploads in the VOLUME /var/www/html I am able to upload media. So how can this be made permanent on the VOLUME?
Whenever wordpress docker image is built and run, the docker ENTRYPOINT of the wordpress image is executed first. Hence your command to change the directory permissions is not getting executed.
This ENTRYPOINT is a bash script located in /usr/local/bin/docker-entrypoint.sh
If you want your command to be executed, you could add your command to this script and it will be called every time your container starts.
You could do it the following way -
Start your container and copy the contents of the existing
docker-entrypoint.sh
Create a new docker-entrypoint.sh outside the container and edit
that script to add your chmod command at appropriate location.
In your Dockerfile add a line to copy this new entrypoint to the
location /usr/local/bin/docker-entrypoint.sh

meteor specify working directory in container

I'm trying to install a meteor application inside a container (singularity), but when I start the application it wants to write to a read only part of the image. Is it possible to specify a working directory different from the application directory? Or, start the application from a writeable directory and point to the applications install directory?
.../promise_server.js:165 throw error;
Error: EROFS, mkdir '/usr/local/mindcontrol/.meteor/local'
Did you install the application to /usr/local yourself? Maybe you can install it to another directory inside the container, e.g. /mindcontrol.
Then you can mount a directory for which you have write-permissions (your home for example):
singularity exec --bind <some_dir>:/mindcontrol <container.img> <command>

Unable to locate WordPress Content directory (wp-content) - localhost on Mac

My configuration
- Mac OS 10.9
- XAMPP
- ProFTPD
- WordPress 3.8.3
Unlike most other posts on the internet for the same problem, I was not on some hosting website rather on a locally hosted instance on Mac.Everytime I tried to access the site, I got the error that the server was unable to locate the wp-content directory.
In macOS httpd server is executed as user "daemon".
Therefore you need to change ownership of htdocs to daemon user:
$ sudo chown -R daemon:daemon htdocs
After a few hours of tweaking around, I did the following
Delete previous installation of WordPress and install fresh copy
Set the permissions on wp-content directory via termina shell using the command chmod -R 777 wp-content. This sets the permission of all underlying files and folders as well
I went to this link and used the solution provided here - http://wordpress.org/support/topic/auto-update-failure-in-wordpress-27?replies=17#post-982487
Essentially, I added the following line at the bottom of my wp-config file - putenv('TMPDIR=' . ini_get('upload_tmp_dir'));
Vola!! it worked and I can now focus on more important things.

Will Symlink do as im hoping - treat one folder same as another

I want to symlink:
/var/www/ThisFolder
to this folder
/var/www/htdocs/Thisfolder
I.e Symlink the folder that is in a non web accessible directory to link to one that is.
I plan to do this via:
ln -s /var/www/ThisFolder /var/www/htdocs/Thisfolder
Will my server then treat the folder outside the root as if it were inside the root?
Permissions on symbolic links are kind of funny. If you don't have permissions to view your target folder (/var/www/htdocs/Thisfolder) you wont be able to access it through the symlink. The permissions you will see by doing an ls -l on your symlink will show its permissions for renaming/unlinking the symlink, not for the target.

Resources