Linux Mint: Bitnami Xampp access issue - linux

I have installed Bitnami Xampp on linux mint, it is installed inside /opt/
The application is unable to access(Write/Read) files and hence not able to work on it.
Any Solution Please........
Thank You

It is simple access issue. So I need to give read write access to folder and file using chmod command:-
--$ sudo chmod -R 777 opt

I have to admit that I am don't really know Xampp but with the command you mentioned above you changed the the access rights for the top level directory /opt and thru using 777 you gave basically all rights to everbody using your system. If Xampp now tries to write something, it of course can because you gave it the rights (like to anyone else).
The -R option you used in the chmod-command above means, that you have changed the access rights for all subdirectories of /opt also (recursively).
I would recommend that you change this back to the original access rights for /opt and, if you need, just change the access rights for the directory where Xampp is placed. Then Xampp should also work because it can read an write in it's own subdirectory and there won't be any harm for or from other applications from /opt because they can't access /opt/Xampp and Xampp can't access their directories.

After the previous setting
--$ sudo chmod -R 777 opt Xampp is not working with following error
PhpMyAdmin “Wrong permissions on configuration file, should not be world writable!”
Then I followed PhpMyAdmin "Wrong permissions on configuration file, should not be world writable!" and now working fine...
Thank god it saved me from switching back to Windows. That I hate.....

Related

Laravel folder permission for not-yet made cache folders

I'm having an issue with directory permissions with Laravel when it comes to caching. Whenever it tries to upload a cache file to /var/www/laravel/storage/framework/cache/data/ it tells me that file_put_contents has no permissions.
To fix this I always do something like chmod -R 755 /var/www/laravel/storage/framework/cache/ but the problem here is that when it creates a new directory inside cache it does not inherit these chmod settings, thus giving me permission denied error again.
How can this be fixed permanently?
Edit:
Been thinking about letting it run as a cronjob regularly, but I'm not so sure that's a good way to deal with it.
You need to run chmod command with -R:
sudo chmod -R 755 storage
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should already be set.
https://laravel.com/docs/5.5#installation

How can i fix/restore linux permissions without reinstalling / deleting my files?

I was trying to change permissons of a folder, and i typed in:
sudo chmod -R 777 /.
I believe it changed my whole system's permissons.
I can no longer connect using ssh/stfp to it.
How can i restore my system permissions without reinstalling / deleting any of my files?
I am using Ubuntu Server
The computer is 64 bit
The files / servers are working fine (HTTP, Games, ETC)
As per this link https://askubuntu.com/questions/508359/restore-default-system-file-folder-permessions you can restore the default system file/folder permissions in linux
and check with the Ubuntu version too.

Workspace Settings permission denied

I'm running Ubuntu 12.04LTS.
Have unpacked Visual Studio Code in a folder owned by my user id. All vscode files are owned by my user id (user and group).
Have Node.js, npm, typescript installed via apt-get (and npm).
Visual Studio code runs fine, however File->Preferences->Workspace Settings gives this error:
Unable to create 'vscode/settings.json' (Error: EACCES: permission denied, mkdir '/.vscode').
Any ideas on how to resolve this? Where is it trying to do the mkdir?
Thanks,
Bob Wirka
UPDATE: Sudo'd mkdir "/.vscode" (literally at the root level), and chown'd it recursively to my user and group. Voila! Now I can edit the settings.
So, is there a way to tell Visual Studio Code that it shouldn't be trying to use the root folder?
Mentioned in the update by the OP but thought I'll mention it explicitly. You need to change the permissions for the folder. The following command will change the owner of the directory so that you can open it without needing root privileges.
$ sudo chown <user-name> -R <directory-name>
I had same issue on my osx. I was able to solve this issue by change the permission to read and write in project folder.
Simply type
sudo chmod 777 -R <your_app_name_directory>.
This will give all permissions to all users, groups and others for read, write, execute.
-R gives recursively permissions to all nested files folders inside your directory.
If -R is not given then it gives permissions to current directory only, not to other directories inside.
Change the permissions to your folder
sudo chmod ugo+rwx your_folder

XAMPP or any other service tool in /opt? Security

I am developing with Xampp for Linux and Tomcat (similar to Xampp on Windows). Many programs like /IDEA, Tomcat and Xampp are recommended to be installed under /opt Now I have heard that it is not recommended to run services as root, but on Ubuntu (I am using this) unpacking any directory to /opt implies that it belongs to root owner and root group. This may be specific to Xampp as per the instructions on their Linux page:
Step 2: Installation After downloading simply type in the following commands:
Go to a Linux shell and login as the system administrator root:
su
Extract the downloaded archive file to /opt:
tar xvfz xampp-linux-1.8.1.tar.gz -C /opt
Warning: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work.
Warning 2: already installed XAMPP versions get overwritten by this command.
That's all. XAMPP is now installed below the /opt/lampp directory.
* Step 3: Start To start XAMPP simply call this command:
/opt/lampp/lampp start
Placing it here implies that Apache must be run as root as one is only able to run it with sudo on Ubuntu.
This may be an issue specific to Ubuntu. Is it? Because Xampp is a development tool I posted this here as I am more likely to find an appropriate answer here from developers who use it on Ubuntu (and other Linux systems). I would appreciate any information on if the same problem occurs on other systems, I notice my production environment has Tomcat installed in /opt too, but belongs to tomcat: tomcat
The question here is how to get around this for all tools under /opt, because even though Xampp may not be the tool for my needs, I still want to place Tomcat under /opt to replicate my production environment and the same thing will surely happen unless this is just a Ubuntu issue?
Ubuntu and some other distributions differ to the general Linux principle where the account that you create upon install of the OS is added to specific groups that can be viewed with the following command:
groups username
You will notice that root is not amongst these. It is also not possible to log in or su to the root account. sudo is most likey a command that has been granted permission to be used from other accounts so I imagine the 'sudo' command has a file permission of 775 for user: root:root
Thus launching services from /opt' does not run them asroot`

working on lamp server in ubuntu

i m working on ubuntu and just installed lamp.As i m new to linux i m not sure how to create a directory or file under /var/www of lamp server to start working on my website project
Under *nix you can create a directory using mkdir newdirname and you can create a new and empty file, using touch newfilename. Those are commands you need to execute from a shell/terminal. In order to get to /var/www, you will need to cd /var/www.
If you are new to Linux I suggest reading any guide on basic like this or this.
Chances are you do not have sufficient privileges as your normal user to add files or create directories. You can either change the ownership of the /var/www directory (and everything within) or you can sudo each one you want to add.
From the prompt: chown [your_user_name].users -R /var/www
Then you can mkdir [directory name] to make a directory or touch [filename] to create a file.
If you do not change the permissions of the /var/www you may need to put sudo in front of each of the above commands (will be prompted for password)

Resources